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

Run vscode tests in the CI #7001

Open
wants to merge 18 commits into
base: master
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
30 changes: 30 additions & 0 deletions .github/workflows/node-test.yml
Expand Up @@ -38,6 +38,36 @@ jobs:
- run: npm i -g npm@9.5
- run: npm ci
- run: npm run lint:changed-files
- run: npm run lint
working-directory: firebase-vscode

vscode_unit:
# Using windows to bypass an error thrown by VScode
# when run in an environment that does not have a screen.
runs-on: windows-latest
rrousselGit marked this conversation as resolved.
Show resolved Hide resolved
strategy:
matrix:
node-version:
- "18"
- "20"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: npm-shrinkwrap.json

- run: npm i -g npm@9.5
- run: npm ci

- run: npm install
working-directory: firebase-vscode
- run: npm run test:unit
working-directory: firebase-vscode

- uses: codecov/codecov-action@v3
if: matrix.node-version == '20'

unit:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion firebase-vscode/package.json
Expand Up @@ -204,7 +204,7 @@
"test-compile": "npm run copyfiles && webpack --config src/test/webpack.test.js",
"lint": "eslint src --ext ts",
"test": "npm run test:unit && npm run test:e2e",
"pretest:unit": "npm run test-compile && npm run lint && tsc -p src/test/tsconfig.test.json",
"pretest:unit": "npm run test-compile && npm run build && tsc -p src/test/tsconfig.test.json",
"test:unit": "node ./dist/test/firebase-vscode/src/test/runTest.js",
"test:e2e": "npm run test:e2e:empty && npm run test:e2e:fishfood",
"test:e2e:empty": "TS_NODE_PROJECT=\"./src/test/tsconfig.test.json\" TEST=true wdio run ./src/test/empty_wdio.conf.ts",
Expand Down
2 changes: 1 addition & 1 deletion firebase-vscode/src/stubs/inquirer-stub.js
Expand Up @@ -22,7 +22,7 @@ inquirer.prompt = async (prompts) => {
} else {
pluginLogger.debug(
`Didn't find "${prompt.name}" in options (message:` +
` "${prompt.message}"), defaulting to value "${prompt.default}"`
` "${prompt.message}"), defaulting to value "${prompt.default}"`,
);
answers[prompt.name] = prompt.default;
}
Expand Down
2 changes: 1 addition & 1 deletion firebase-vscode/src/test/runTest.ts
Expand Up @@ -10,7 +10,7 @@ async function main() {

// The path to test runner
// Passed to --extensionTestsPath
const extensionTestsPath = path.resolve(__dirname, "./suite/index");
const extensionTestsPath = path.resolve(__dirname, "./suite/src/core/index");

// Download VS Code, unzip it and run the integration test
await runTests({
Expand Down
2 changes: 1 addition & 1 deletion firebase-vscode/webpack.common.js
Expand Up @@ -82,7 +82,7 @@ const extensionConfig = {
inquirer: path.resolve(__dirname, "src/stubs/inquirer-stub.js"),
"inquirer-autocomplete-prompt": path.resolve(
__dirname,
"src/stubs/inquirer-stub.js"
"src/stubs/inquirer-stub.js",
),
// This is used for Github deploy to hosting - will need to restore
// or find another solution if we add that feature.
Expand Down