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

Merged
merged 25 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
fa1fa1e
Fix inquirer error.
rrousselGit Apr 14, 2024
4dc3d2c
Run vscode tests in the CI
rrousselGit Apr 15, 2024
2118c2a
Merge branch 'fix-inquirer' of https://github.com/firebase/firebase-t…
rrousselGit Apr 15, 2024
91d414e
Build dist before running tests
rrousselGit Apr 15, 2024
dcd56f8
Merge branch 'master' of https://github.com/firebase/firebase-tools i…
rrousselGit May 16, 2024
6b0b07e
Run install before running tests
rrousselGit May 16, 2024
54ceaf8
debug
rrousselGit May 16, 2024
59a7ab9
test
rrousselGit May 16, 2024
145982e
Try?
rrousselGit May 16, 2024
7e91fe9
Attempt 2
rrousselGit May 16, 2024
95f0465
Try2
rrousselGit May 16, 2024
efbb4d0
Try with display
rrousselGit May 16, 2024
f73fa8f
Try using windows platorm
rrousselGit May 21, 2024
215a5ef
Run npm i in root folder first
rrousselGit May 21, 2024
926dac0
Remove DiSPLAY
rrousselGit May 21, 2024
d76a54c
Fix runTest
rrousselGit May 21, 2024
a91768d
Merge branch 'master' into vscode-ci
rrousselGit May 21, 2024
de38707
Apply suggestions from code review
rrousselGit May 21, 2024
14614de
Merge branch 'master' into vscode-ci
hlshen May 28, 2024
a5b51f7
Merge branch 'master' into vscode-ci
joehan May 29, 2024
72c09e8
Apply suggestions from code review
rrousselGit May 30, 2024
4ad8c93
Apply suggestions from code review
rrousselGit May 30, 2024
f9744d4
Apply suggestions from code review
rrousselGit May 30, 2024
aee996e
Merge branch 'master' into vscode-ci
joehan Jun 3, 2024
1e9171c
Merge branch 'master' into vscode-ci
joehan Jun 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/node-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,34 @@ jobs:
- run: npm i -g [email protected]
- run: npm ci
- run: npm run lint:changed-files
- run: npm run lint
working-directory: firebase-vscode

vscode_unit:
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
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be firebase-vscode/[package-lock.json instead (or in addition)? I assume we want to cache the vscode deps here.

rrousselGit marked this conversation as resolved.
Show resolved Hide resolved

- run: npm i -g [email protected]
rrousselGit marked this conversation as resolved.
Show resolved Hide resolved
- run: npm ci
Copy link
Contributor

Choose a reason for hiding this comment

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

Double checking - if you remove this line, do the tests still pass?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I doubt it. We have to run npm i in both the root and the vscode folder.
The npm i -g above doesn't count as it only updates the npm version and nothing else.

rrousselGit marked this conversation as resolved.
Show resolved Hide resolved

rrousselGit marked this conversation as resolved.
Show resolved Hide resolved
- 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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading