Skip to content

Commit 2368e6d

Browse files
authored
Revert "tests - enable API tests with test runner" (#242688)
Revert "tests - enable API tests with test runner (#241149)" This reverts commit 8f2e1b2.
1 parent 5096b20 commit 2368e6d

File tree

3 files changed

+131
-148
lines changed

3 files changed

+131
-148
lines changed

.vscode-test.js

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const { defineConfig } = require('@vscode/test-cli');
1919
* A list of extension folders who have opted into tests, or configuration objects.
2020
* Edit me to add more!
2121
*
22-
* @type {Array<Partial<import("@vscode/test-cli").TestConfiguration> & { label: string }>}
22+
* @type {Array<string | (Partial<import("@vscode/test-cli").TestConfiguration> & { label: string })>}
2323
*/
2424
const extensions = [
2525
{
@@ -65,20 +65,6 @@ const extensions = [
6565
{
6666
label: 'microsoft-authentication',
6767
mocha: { timeout: 60_000 }
68-
},
69-
{
70-
label: 'vscode-api-tests-folder',
71-
extensionDevelopmentPath: `extensions/vscode-api-tests`,
72-
workspaceFolder: `extensions/vscode-api-tests/testWorkspace`,
73-
mocha: { timeout: 60_000 },
74-
files: 'extensions/vscode-api-tests/out/singlefolder-tests/**/*.test.js',
75-
},
76-
{
77-
label: 'vscode-api-tests-workspace',
78-
extensionDevelopmentPath: `extensions/vscode-api-tests`,
79-
workspaceFolder: `extensions/vscode-api-tests/testworkspace.code-workspace`,
80-
mocha: { timeout: 60_000 },
81-
files: 'extensions/vscode-api-tests/out/workspace-tests/**/*.test.js',
8268
}
8369
];
8470

@@ -89,12 +75,9 @@ const defaultLaunchArgs = process.env.API_TESTS_EXTRA_ARGS?.split(' ') || [
8975

9076
const config = defineConfig(extensions.map(extension => {
9177
/** @type {import('@vscode/test-cli').TestConfiguration} */
92-
const config = {
93-
platform: 'desktop',
94-
files: `extensions/${extension.label}/out/**/*.test.js`,
95-
extensionDevelopmentPath: `extensions/${extension.label}`,
96-
...extension,
97-
};
78+
const config = typeof extension === 'object'
79+
? { files: `extensions/${extension.label}/out/**/*.test.js`, ...extension }
80+
: { files: `extensions/${extension}/out/**/*.test.js`, label: extension };
9881

9982
config.mocha ??= {};
10083
if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) {

scripts/test-integration.bat

Lines changed: 124 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,124 @@
1-
@echo off
2-
setlocal
3-
4-
pushd %~dp0\..
5-
6-
set VSCODEUSERDATADIR=%TEMP%\vscodeuserfolder-%RANDOM%-%TIME:~6,2%
7-
set VSCODECRASHDIR=%~dp0\..\.build\crashes
8-
set VSCODELOGSDIR=%~dp0\..\.build\logs\integration-tests
9-
10-
:: Figure out which Electron to use for running tests
11-
if "%INTEGRATION_TEST_ELECTRON_PATH%"=="" (
12-
chcp 65001
13-
set INTEGRATION_TEST_ELECTRON_PATH=.\scripts\code.bat
14-
set VSCODE_BUILD_BUILTIN_EXTENSIONS_SILENCE_PLEASE=1
15-
16-
echo Running integration tests out of sources.
17-
) else (
18-
set VSCODE_CLI=1
19-
set ELECTRON_ENABLE_LOGGING=1
20-
21-
echo Running integration tests with '%INTEGRATION_TEST_ELECTRON_PATH%' as build.
22-
)
23-
24-
echo Storing crash reports into '%VSCODECRASHDIR%'.
25-
echo Storing log files into '%VSCODELOGSDIR%'.
26-
27-
28-
:: Unit tests
29-
30-
echo.
31-
echo ### node.js integration tests
32-
call .\scripts\test.bat --runGlob **\*.integrationTest.js %*
33-
if %errorlevel% neq 0 exit /b %errorlevel%
34-
35-
36-
:: Tests in the extension host
37-
38-
set API_TESTS_EXTRA_ARGS=--disable-telemetry --skip-welcome --skip-release-notes --crash-reporter-directory=%VSCODECRASHDIR% --logsPath=%VSCODELOGSDIR% --no-cached-data --disable-updates --use-inmemory-secretstorage --disable-extensions --disable-workspace-trust --user-data-dir=%VSCODEUSERDATADIR%
39-
40-
echo.
41-
echo ### API tests (folder)
42-
call npm run test-extension -- -l vscode-api-tests-folder --enable-proposed-api=vscode.vscode-api-tests %API_TESTS_EXTRA_ARGS%
43-
if %errorlevel% neq 0 exit /b %errorlevel%
44-
45-
echo.
46-
echo ### API tests (workspace)
47-
call npm run test-extension -- -l vscode-api-tests-workspace --enable-proposed-api=vscode.vscode-api-tests %API_TESTS_EXTRA_ARGS%
48-
if %errorlevel% neq 0 exit /b %errorlevel%
49-
50-
echo.
51-
echo ### Colorize tests
52-
call npm run test-extension -- -l vscode-colorize-tests
53-
if %errorlevel% neq 0 exit /b %errorlevel%
54-
55-
echo.
56-
echo ### Terminal Suggest tests
57-
call npm run test-extension -- -l terminal-suggest --enable-proposed-api=vscode.vscode-api-tests
58-
if %errorlevel% neq 0 exit /b %errorlevel%
59-
60-
echo.
61-
echo ### TypeScript tests
62-
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\typescript-language-features\test-workspace --extensionDevelopmentPath=%~dp0\..\extensions\typescript-language-features --extensionTestsPath=%~dp0\..\extensions\typescript-language-features\out\test\unit %API_TESTS_EXTRA_ARGS%
63-
if %errorlevel% neq 0 exit /b %errorlevel%
64-
65-
echo.
66-
echo ### Markdown tests
67-
call npm run test-extension -- -l markdown-language-features
68-
if %errorlevel% neq 0 exit /b %errorlevel%
69-
70-
echo.
71-
echo ### Emmet tests
72-
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\emmet\test-workspace --extensionDevelopmentPath=%~dp0\..\extensions\emmet --extensionTestsPath=%~dp0\..\extensions\emmet\out\test %API_TESTS_EXTRA_ARGS%
73-
if %errorlevel% neq 0 exit /b %errorlevel%
74-
75-
echo.
76-
echo ### Git tests
77-
for /f "delims=" %%i in ('node -p "require('fs').realpathSync.native(require('os').tmpdir())"') do set TEMPDIR=%%i
78-
set GITWORKSPACE=%TEMPDIR%\git-%RANDOM%
79-
mkdir %GITWORKSPACE%
80-
call "%INTEGRATION_TEST_ELECTRON_PATH%" %GITWORKSPACE% --extensionDevelopmentPath=%~dp0\..\extensions\git --extensionTestsPath=%~dp0\..\extensions\git\out\test %API_TESTS_EXTRA_ARGS%
81-
if %errorlevel% neq 0 exit /b %errorlevel%
82-
83-
echo.
84-
echo ### Ipynb tests
85-
call npm run test-extension -- -l ipynb
86-
if %errorlevel% neq 0 exit /b %errorlevel%
87-
88-
echo.
89-
echo ### Notebook Output tests
90-
call npm run test-extension -- -l notebook-renderers
91-
if %errorlevel% neq 0 exit /b %errorlevel%
92-
93-
echo.
94-
echo ### Configuration editing tests
95-
set CFWORKSPACE=%TEMPDIR%\cf-%RANDOM%
96-
mkdir %CFWORKSPACE%
97-
call npm run test-extension -- -l configuration-editing
98-
if %errorlevel% neq 0 exit /b %errorlevel%
99-
100-
echo.
101-
echo ### GitHub Authentication tests
102-
call npm run test-extension -- -l github-authentication
103-
if %errorlevel% neq 0 exit /b %errorlevel%
104-
105-
:: Tests standalone (CommonJS)
106-
107-
echo.
108-
echo ### CSS tests
109-
call %~dp0\node-electron.bat %~dp0\..\extensions\css-language-features/server/test/index.js
110-
if %errorlevel% neq 0 exit /b %errorlevel%
111-
112-
echo.
113-
echo ### HTML tests
114-
call %~dp0\node-electron.bat %~dp0\..\extensions\html-language-features/server/test/index.js
115-
if %errorlevel% neq 0 exit /b %errorlevel%
116-
117-
118-
:: Cleanup
119-
120-
rmdir /s /q %VSCODEUSERDATADIR%
121-
122-
popd
123-
124-
endlocal
1+
@echo off
2+
setlocal
3+
4+
pushd %~dp0\..
5+
6+
set VSCODEUSERDATADIR=%TEMP%\vscodeuserfolder-%RANDOM%-%TIME:~6,2%
7+
set VSCODECRASHDIR=%~dp0\..\.build\crashes
8+
set VSCODELOGSDIR=%~dp0\..\.build\logs\integration-tests
9+
10+
:: Figure out which Electron to use for running tests
11+
if "%INTEGRATION_TEST_ELECTRON_PATH%"=="" (
12+
chcp 65001
13+
set INTEGRATION_TEST_ELECTRON_PATH=.\scripts\code.bat
14+
set VSCODE_BUILD_BUILTIN_EXTENSIONS_SILENCE_PLEASE=1
15+
16+
echo Running integration tests out of sources.
17+
) else (
18+
set VSCODE_CLI=1
19+
set ELECTRON_ENABLE_LOGGING=1
20+
21+
echo Running integration tests with '%INTEGRATION_TEST_ELECTRON_PATH%' as build.
22+
)
23+
24+
echo Storing crash reports into '%VSCODECRASHDIR%'.
25+
echo Storing log files into '%VSCODELOGSDIR%'.
26+
27+
28+
:: Unit tests
29+
30+
echo.
31+
echo ### node.js integration tests
32+
call .\scripts\test.bat --runGlob **\*.integrationTest.js %*
33+
if %errorlevel% neq 0 exit /b %errorlevel%
34+
35+
36+
:: Tests in the extension host
37+
38+
set API_TESTS_EXTRA_ARGS=--disable-telemetry --skip-welcome --skip-release-notes --crash-reporter-directory=%VSCODECRASHDIR% --logsPath=%VSCODELOGSDIR% --no-cached-data --disable-updates --use-inmemory-secretstorage --disable-extensions --disable-workspace-trust --user-data-dir=%VSCODEUSERDATADIR%
39+
40+
echo.
41+
echo ### API tests (folder)
42+
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\vscode-api-tests\testWorkspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out\singlefolder-tests %API_TESTS_EXTRA_ARGS%
43+
if %errorlevel% neq 0 exit /b %errorlevel%
44+
45+
echo.
46+
echo ### API tests (workspace)
47+
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\vscode-api-tests\testworkspace.code-workspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out\workspace-tests %API_TESTS_EXTRA_ARGS%
48+
if %errorlevel% neq 0 exit /b %errorlevel%
49+
50+
echo.
51+
echo ### Colorize tests
52+
call npm run test-extension -- -l vscode-colorize-tests
53+
if %errorlevel% neq 0 exit /b %errorlevel%
54+
55+
echo.
56+
echo ### Terminal Suggest tests
57+
call npm run test-extension -- -l terminal-suggest --enable-proposed-api=vscode.vscode-api-tests
58+
if %errorlevel% neq 0 exit /b %errorlevel%
59+
60+
echo.
61+
echo ### TypeScript tests
62+
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\typescript-language-features\test-workspace --extensionDevelopmentPath=%~dp0\..\extensions\typescript-language-features --extensionTestsPath=%~dp0\..\extensions\typescript-language-features\out\test\unit %API_TESTS_EXTRA_ARGS%
63+
if %errorlevel% neq 0 exit /b %errorlevel%
64+
65+
echo.
66+
echo ### Markdown tests
67+
call npm run test-extension -- -l markdown-language-features
68+
if %errorlevel% neq 0 exit /b %errorlevel%
69+
70+
echo.
71+
echo ### Emmet tests
72+
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\emmet\test-workspace --extensionDevelopmentPath=%~dp0\..\extensions\emmet --extensionTestsPath=%~dp0\..\extensions\emmet\out\test %API_TESTS_EXTRA_ARGS%
73+
if %errorlevel% neq 0 exit /b %errorlevel%
74+
75+
echo.
76+
echo ### Git tests
77+
for /f "delims=" %%i in ('node -p "require('fs').realpathSync.native(require('os').tmpdir())"') do set TEMPDIR=%%i
78+
set GITWORKSPACE=%TEMPDIR%\git-%RANDOM%
79+
mkdir %GITWORKSPACE%
80+
call "%INTEGRATION_TEST_ELECTRON_PATH%" %GITWORKSPACE% --extensionDevelopmentPath=%~dp0\..\extensions\git --extensionTestsPath=%~dp0\..\extensions\git\out\test %API_TESTS_EXTRA_ARGS%
81+
if %errorlevel% neq 0 exit /b %errorlevel%
82+
83+
echo.
84+
echo ### Ipynb tests
85+
call npm run test-extension -- -l ipynb
86+
if %errorlevel% neq 0 exit /b %errorlevel%
87+
88+
echo.
89+
echo ### Notebook Output tests
90+
call npm run test-extension -- -l notebook-renderers
91+
if %errorlevel% neq 0 exit /b %errorlevel%
92+
93+
echo.
94+
echo ### Configuration editing tests
95+
set CFWORKSPACE=%TEMPDIR%\cf-%RANDOM%
96+
mkdir %CFWORKSPACE%
97+
call npm run test-extension -- -l configuration-editing
98+
if %errorlevel% neq 0 exit /b %errorlevel%
99+
100+
echo.
101+
echo ### GitHub Authentication tests
102+
call npm run test-extension -- -l github-authentication
103+
if %errorlevel% neq 0 exit /b %errorlevel%
104+
105+
:: Tests standalone (CommonJS)
106+
107+
echo.
108+
echo ### CSS tests
109+
call %~dp0\node-electron.bat %~dp0\..\extensions\css-language-features/server/test/index.js
110+
if %errorlevel% neq 0 exit /b %errorlevel%
111+
112+
echo.
113+
echo ### HTML tests
114+
call %~dp0\node-electron.bat %~dp0\..\extensions\html-language-features/server/test/index.js
115+
if %errorlevel% neq 0 exit /b %errorlevel%
116+
117+
118+
:: Cleanup
119+
120+
rmdir /s /q %VSCODEUSERDATADIR%
121+
122+
popd
123+
124+
endlocal

scripts/test-integration.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ fi
5555
echo
5656
echo "### API tests (folder)"
5757
echo
58-
npm run test-extension -- -l vscode-api-tests-folder --enable-proposed-api=vscode.vscode-api-tests $API_TESTS_EXTRA_ARGS
58+
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_EXTRA_ARGS $ROOT/extensions/vscode-api-tests/testWorkspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=$ROOT/extensions/vscode-api-tests --extensionTestsPath=$ROOT/extensions/vscode-api-tests/out/singlefolder-tests $API_TESTS_EXTRA_ARGS
5959
kill_app
6060

6161
echo
6262
echo "### API tests (workspace)"
6363
echo
64-
npm run test-extension -- -l vscode-api-tests-workspace --enable-proposed-api=vscode.vscode-api-tests $API_TESTS_EXTRA_ARGS
64+
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_EXTRA_ARGS $ROOT/extensions/vscode-api-tests/testworkspace.code-workspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=$ROOT/extensions/vscode-api-tests --extensionTestsPath=$ROOT/extensions/vscode-api-tests/out/workspace-tests $API_TESTS_EXTRA_ARGS
6565
kill_app
6666

6767
echo
@@ -71,7 +71,7 @@ npm run test-extension -- -l vscode-colorize-tests
7171
kill_app
7272

7373
echo
74-
echo "### Terminal Suggest tests"
74+
echo "### Terminal Suggest tests"
7575
echo
7676
npm run test-extension -- -l terminal-suggest --enable-proposed-api=vscode.vscode-api-tests
7777
kill_app

0 commit comments

Comments
 (0)