| @@ -1788,7 +1788,8 @@ const mlPoweredQueriesMacro = test.macro({ |
|
|
| 1788 |
1788 |
}`, |
| 1789 |
1789 |
}); |
| 1790 |
1790 |
|
| 1791 |
|
-// macro, isMlPoweredQueriesFlagEnabled, packsInput, queriesInput, versionString |
|
1791 |
+// macro, codeQLVersion, isMlPoweredQueriesFlagEnabled, packsInput, queriesInput, expectedVersionString |
|
1792 |
+// Test that ML-powered queries aren't run on v2.7.4 of the CLI. |
| 1792 |
1793 |
test( |
| 1793 |
1794 |
mlPoweredQueriesMacro, |
| 1794 |
1795 |
"2.7.4", |
| @@ -1797,6 +1798,7 @@ test( |
|
|
| 1797 |
1798 |
"security-extended", |
| 1798 |
1799 |
undefined |
| 1799 |
1800 |
); |
|
1801 |
+// Test that ML-powered queries aren't run when the feature flag is off. |
| 1800 |
1802 |
test( |
| 1801 |
1803 |
mlPoweredQueriesMacro, |
| 1802 |
1804 |
"2.7.5", |
| @@ -1805,28 +1807,33 @@ test( |
|
|
| 1805 |
1807 |
"security-extended", |
| 1806 |
1808 |
undefined |
| 1807 |
1809 |
); |
|
1810 |
+// Test that ML-powered queries aren't run when the user hasn't specified that we should run the |
|
1811 |
+// `security-extended` or `security-and-quality` query suite. |
| 1808 |
1812 |
test(mlPoweredQueriesMacro, "2.7.5", true, undefined, undefined, undefined); |
|
1813 |
+// Test that ML-powered queries are run on non-Windows platforms running `security-extended`. |
| 1809 |
1814 |
test( |
| 1810 |
1815 |
mlPoweredQueriesMacro, |
| 1811 |
1816 |
"2.7.5", |
| 1812 |
1817 |
true, |
| 1813 |
1818 |
undefined, |
| 1814 |
1819 |
"security-extended", |
| 1815 |
|
-"~0.1.0" |
|
1820 |
+process.platform === "win32" ? undefined : "~0.1.0" |
| 1816 |
1821 |
); |
|
1822 |
+// Test that ML-powered queries are run on non-Windows platforms running `security-and-quality`. |
| 1817 |
1823 |
test( |
| 1818 |
1824 |
mlPoweredQueriesMacro, |
| 1819 |
1825 |
"2.7.5", |
| 1820 |
1826 |
true, |
| 1821 |
1827 |
undefined, |
| 1822 |
1828 |
"security-and-quality", |
| 1823 |
|
-"~0.1.0" |
|
1829 |
+process.platform === "win32" ? undefined : "~0.1.0" |
| 1824 |
1830 |
); |
|
1831 |
+// Test that we don't inject an ML-powered query pack if the user has already specified one. |
| 1825 |
1832 |
test( |
| 1826 |
1833 |
mlPoweredQueriesMacro, |
| 1827 |
1834 |
"2.7.5", |
| 1828 |
1835 |
true, |
| 1829 |
1836 |
"codeql/javascript-experimental-atm-queries@0.0.1", |
| 1830 |
1837 |
"security-and-quality", |
| 1831 |
|
-"0.0.1" |
|
1838 |
+process.platform === "win32" ? undefined : "0.0.1" |
| 1832 |
1839 |
); |