Skip to content

Commit

Permalink
New e2e tests (#7738)
Browse files Browse the repository at this point in the history
* New e2e tests

* remove unneeded dependency

* fix wdio config type

* restore graphql file

* Fix wdio types errors

* fix graphql test issues

* adding and reading data e2e tests

* fix graphql test

* emulator startup e2e tests

* Mock user & fix execution tests

* package-lock

* -

* undo changes in ui

* chore: undo changes to tsconfig

* exclude test folder from build

* Fix tests setup

* Fix test hooks

* Try changing CI to macos

* Limit parallelism to enhance CI performance

* Lower parallelism

* Remove prod build from pretest

* CI for e2e tests

* Increase memory limit for prod build

* Await for notifications to be displayed

* Increase test timeout for e2e

* Enhance e2e tests

* -

* Increase timeout

* -

* -

* -

* -

* Adding logs to debug

* -

* try 127.0.0.1 instead of localhost

* add screenshots

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* debug mode

* export screenshot only on error

* -

* fix deploy test

* remove logs

* remove debug flag

* fix firebase binary in test

* -

* fix typing issue

* addressing comments

* fix typing issue 2

* revert `localhost` change

* split graphql add/read data tests

* use service account for CI

* init test for sidebar change

* remove execution retry logic

* update generated sdk test

* fix

* fix error in importing scss modules

* add sdk to app test done

* remove unnecessary log

* squash merge master

* add readonlySignal typing to firstWhere

* add connector.yaml in mock init

---------

Co-authored-by: Harold Shen <hlshen@google.com>
  • Loading branch information
pr-Mais and hlshen authored Oct 28, 2024
1 parent ddfefd8 commit 1374342
Show file tree
Hide file tree
Showing 50 changed files with 5,934 additions and 4,148 deletions.
59 changes: 56 additions & 3 deletions .github/workflows/node-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ jobs:
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
runs-on: macos-latest
strategy:
matrix:
node-version:
Expand All @@ -62,8 +60,63 @@ jobs:
- run: npm ci
- run: npm install
working-directory: firebase-vscode
- run: npm run build
working-directory: firebase-vscode
- run: npm run test:unit
working-directory: firebase-vscode
- uses: codecov/codecov-action@v3
if: matrix.node-version == '20'

vscode_integration:
runs-on: macos-latest
strategy:
matrix:
node-version:
- "18"
- "20"

env:
FIREBASE_EMULATORS_PATH: ${{ github.workspace }}/emulator-cache
# This overrides the binary which runs firebase commands in the extension tasks such as emulator start.
# Currently, CI fails to start with npx so we change it to the global firebase binary.
FIREBASE_BINARY: firebase

steps:
- name: Setup Java JDK
uses: actions/setup-java@v3.3.0
with:
java-version: 17
distribution: temurin

- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: firebase-vscode/package-lock.json

# TODO temporary workaround for GitHub Actions CI issue:
# npm ERR! Your cache folder contains root-owned files, due to a bug in
# npm ERR! previous versions of npm which has since been addressed.
- run: sudo chown -R 501:20 "/Users/runner/.npm" || exit 1
- run: npm ci
- run: npm install
working-directory: firebase-vscode
- run: npm run build
working-directory: firebase-vscode

- run: npm i -g firebase-tools@latest

- uses: GabrielBB/xvfb-action@v1
with:
run: npm run test:e2e
working-directory: firebase-vscode

- uses: actions/upload-artifact@v3
if: failure()
with:
name: screenshots
path: firebase-vscode/src/test/screenshots

- uses: codecov/codecov-action@v3
if: matrix.node-version == '20'
Expand Down
2 changes: 2 additions & 0 deletions firebase-vscode/common/declarations.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// We need to tell TypeScript that when we write "import styles from './styles.scss' we mean to load a module (to look for a './styles.scss.d.ts').
declare module "*.scss";
Loading

0 comments on commit 1374342

Please sign in to comment.