diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index df54c1ae..67329ac9 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -86,11 +86,12 @@ jobs: - name: Run integration tests run: npm run test:integ:all - - name: Upload browser test screenshots + - name: Upload test artifacts if: always() uses: actions/upload-artifact@v5 with: - name: browser-test-screenshots - path: tests_integ/browser/__screenshots__/ + name: test-artifacts-integ + path: ./test/.artifacts/ retention-days: 4 + include-hidden-files: true # needed because the path has a directory starting with a '.' if-no-files-found: ignore diff --git a/.github/workflows/test-lint.yml b/.github/workflows/test-lint.yml index a7076070..4b1356a9 100644 --- a/.github/workflows/test-lint.yml +++ b/.github/workflows/test-lint.yml @@ -40,6 +40,16 @@ jobs: - name: Run unit tests run: npm run test:all:coverage + - name: Upload test artifacts + if: always() + uses: actions/upload-artifact@v5 + with: + name: test-artifacts-${{ matrix.node-version }}-${{ matrix.os }} + path: ./test/.artifacts/ + include-hidden-files: true # needed because the path has a directory starting with a '.' + retention-days: 4 + if-no-files-found: ignore + - name: Run linting run: npm run lint diff --git a/.gitignore b/.gitignore index 57b1943b..3cf3cc15 100644 --- a/.gitignore +++ b/.gitignore @@ -37,4 +37,7 @@ Thumbs.db .env.production.local # Github workflow artifacts -.artifact \ No newline at end of file +.artifact + +# Test artifacts +test/.artifacts \ No newline at end of file diff --git a/vitest.config.ts b/vitest.config.ts index 08a531cd..406ae82e 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -23,6 +23,11 @@ const getOpenAIAPIKey: BrowserCommand<[], string | undefined> = async ({ testPat export default defineConfig({ test: { unstubEnvs: true, + reporters: [ + 'default', + ['junit', { outputFile: 'test/.artifacts/test-report/junit/report.xml' }], + ['json', { outputFile: 'test/.artifacts/test-report/json/report.json' }], + ], projects: [ { test: { @@ -43,6 +48,7 @@ export default defineConfig({ browser: { enabled: true, provider: playwright(), + screenshotDirectory: 'test/.artifacts/browser-screenshots/', instances: [ { browser: 'chromium', @@ -72,6 +78,7 @@ export default defineConfig({ browser: { enabled: true, provider: playwright(), + screenshotDirectory: 'test/.artifacts/browser-screenshots/', instances: [ { browser: 'chromium',