Skip to content

Commit ee82de9

Browse files
authored
Support different formats of grep for model (#16893)
1 parent 936b885 commit ee82de9

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

src/test/standardTest.node.ts

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,23 @@ import { DownloadPlatform } from '@vscode/test-electron/out/download';
1818
import { arch } from 'os';
1919

2020
// Support for passing grep (specially for models or Copilot Coding Agent)
21-
process.env.VSC_JUPYTER_CI_TEST_GREP =
22-
process.argv
23-
.filter((arg) => arg.startsWith('--grep'))
24-
.map((arg) => arg.split('=')[1])
25-
.pop() ||
26-
process.env.VSC_JUPYTER_CI_TEST_GREP ||
27-
'';
21+
// Local Copilot or Copilot Coding Agent can use `--grep=XYZ` or `--grep XYZ`
22+
if (process.argv.some((arg) => arg.startsWith('--grep='))) {
23+
process.env.VSC_JUPYTER_CI_TEST_GREP =
24+
process.argv
25+
.filter((arg) => arg.startsWith('--grep='))
26+
.map((arg) => arg.split('=')[1])
27+
.pop() ||
28+
process.env.VSC_JUPYTER_CI_TEST_GREP ||
29+
'';
30+
} else if (process.argv.some((arg) => arg === '--grep')) {
31+
const indexOfGrep = process.argv.indexOf('--grep');
32+
if (indexOfGrep !== -1 && process.argv.length > indexOfGrep + 1) {
33+
process.env.VSC_JUPYTER_CI_TEST_GREP =
34+
process.argv[indexOfGrep + 1] || process.env.VSC_JUPYTER_CI_TEST_GREP || '';
35+
}
36+
}
37+
2838
process.env.IS_CI_SERVER_TEST_DEBUGGER = '';
2939
process.env.VSC_JUPYTER_CI_TEST = '1';
3040
const workspacePath = process.env.CODE_TESTS_WORKSPACE

0 commit comments

Comments
 (0)