Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow vscode-api-tests to be picked up by Extension Test Runner #211656

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions .vscode-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ const os = require('os');
* A list of extension folders who have opted into tests, or configuration objects.
* Edit me to add more!
*
* @note When you _RUN_ these tests in the Test Explorer, they will run in Code - OSS.
* However, when you _DEBUG_ them in the Test Explorer, they will run in VS Code Insiders.
*
* @type {Array<string | (Partial<import("@vscode/test-cli").TestConfiguration> & { label: string })>}
*/
const extensions = [
Expand Down Expand Up @@ -45,6 +48,16 @@ const extensions = [
label: 'github-authentication',
workspaceFolder: path.join(os.tmpdir(), `msft-auth-${Math.floor(Math.random() * 100000)}`),
mocha: { timeout: 60_000 }
},
{
label: 'vscode-api-tests',
workspaceFolder: path.join(__dirname, 'extensions', 'vscode-api-tests', 'testWorkspace'),
mocha: { timeout: 60_000 }
},
{
label: 'vscode-api-tests',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the test runner right now handles multiple configurations with the same label; yarn test-extension -l vscode-api-tests is probably just running the first declaration of those tests. We should probably throw a more explicit error.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my experience it runs tests twice

workspaceFolder: path.join(__dirname, 'extensions', 'vscode-api-tests', 'testworkspace.code-workspace'),
mocha: { timeout: 60_000 }
}
];

Expand Down
9 changes: 2 additions & 7 deletions scripts/test-integration.bat
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,8 @@ if %errorlevel% neq 0 exit /b %errorlevel%
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%

echo.
echo ### API tests (folder)
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%
if %errorlevel% neq 0 exit /b %errorlevel%

echo.
echo ### API tests (workspace)
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%
echo ### API tests
call yarn test-extension -l vscode-api-tests
if %errorlevel% neq 0 exit /b %errorlevel%

echo.
Expand Down
10 changes: 2 additions & 8 deletions scripts/test-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,9 @@ else
fi

echo
echo "### API tests (folder)"
echo "### API tests"
echo
"$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
kill_app

echo
echo "### API tests (workspace)"
echo
"$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
yarn test-extension -l vscode-api-tests
kill_app

echo
Expand Down