Enable vitest test reports + upload artifacts (#325)

This way we can extract the test reports and view them offline

Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com>
This commit is contained in:
Mackenzie Zastrow
2025-12-05 14:09:13 -05:00
committed by GitHub
co-authored by Mackenzie Zastrow
parent e2820486c5
commit 310d66da75
4 changed files with 25 additions and 4 deletions
+4 -3
View File
@@ -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
+10
View File
@@ -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
+4 -1
View File
@@ -37,4 +37,7 @@ Thumbs.db
.env.production.local
# Github workflow artifacts
.artifact
.artifact
# Test artifacts
test/.artifacts
+7
View File
@@ -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',