From f1256dd168c84b61cda2db095a055c4a078090cd Mon Sep 17 00:00:00 2001 From: Mantra Date: Thu, 7 Nov 2024 12:52:12 +0000 Subject: [PATCH] split up backend and frontend tests --- .github/workflows/test.yml | 25 +++++++++++++++++++++---- app/static/playwright.config.ts | 12 ------------ 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 66ec473d..a69dc049 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,7 @@ name: test on: [push] jobs: - unit-tests: + fe-unit-tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -10,16 +10,33 @@ jobs: with: install-packages: true - - name: Test back end - run: npm test --prefix=app/server - name: Test front end run: npm run coverage --prefix=app/static + - uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true # optional (default = false) + files: ./app/static/coverage/coverage-final.json + token: ${{ secrets.CODECOV_TOKEN }} # required + + be-unit-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Node + uses: ./.github/actions/setup-and-login + with: + install-packages: true + + - name: Run deps + run: ./scripts/run-dependencies.sh + - name: Test back end + run: npm test --prefix=app/server - name: Check versions run: npm run genversion --prefix=app/server -- --check-only - uses: codecov/codecov-action@v4 with: fail_ci_if_error: true # optional (default = false) - files: ./app/server/coverage/coverage-final.json,./app/static/coverage/coverage-final.json + files: ./app/server/coverage/coverage-final.json token: ${{ secrets.CODECOV_TOKEN }} # required integration-tests: diff --git a/app/static/playwright.config.ts b/app/static/playwright.config.ts index ad5e216f..c12df636 100644 --- a/app/static/playwright.config.ts +++ b/app/static/playwright.config.ts @@ -54,16 +54,4 @@ export default defineConfig({ /* Folder for test artifacts such as screenshots, videos, traces, etc. */ // outputDir: 'test-results/', - - // /* Run your local dev server before starting the tests */ - // webServer: { - // /** - // * Use the dev server by default for faster feedback loop. - // * Use the preview server on CI for more realistic testing. - // * Playwright will re-use the local server if there is already a dev-server running. - // */ - // command: process.env.CI ? 'npm run build' : 'npm run dev', - // port: 5173, - // reuseExistingServer: !process.env.CI - // } })