diff --git a/.azure/ci.yml b/.azure/ci.yml index ae7752189..86fed2788 100644 --- a/.azure/ci.yml +++ b/.azure/ci.yml @@ -77,7 +77,7 @@ jobs: displayName: gitversion/execute workingDirectory: dist/vsix - pwsh: | - npm run test + npm run test:ci displayName: 'Run tests' - pwsh: | echo "Major (major) : $(major)" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 342198605..d4b9975e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,8 +57,12 @@ jobs: overrideConfig: | update-build-number=false - run: | - npm run test + npm run test:ci name: Run tests + - name: Test Summary + uses: test-summary/action@v2.4 + with: + paths: junit-report.xml - run: | echo "Major (env.major) : ${{ env.major }}" echo "Major (env.GitVersion_Major) : ${{ env.GitVersion_Major }}" diff --git a/.gitignore b/.gitignore index 108c39e31..bbc435958 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,5 @@ dist-ssr /dist/agents/local/ .debug/ + +junit-report.xml diff --git a/package.json b/package.json index 0df740497..1b595f82e 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "run:azure:gitreleasemanager": "node dist/tools/cli.mjs --tool gitreleasemanager --agent azure", "run:github:gitreleasemanager": "node dist/tools/cli.mjs --tool gitreleasemanager --agent github", + "test:ci": "vitest --run src/__tests__ --config src/__tests__/vitest.config.ts", "test:tools": "vitest --run src/__tests__/tools --config src/__tests__/vitest.config.ts", "test:agents": "vitest --run src/__tests__/agents --config src/__tests__/vitest.config.ts", diff --git a/src/__tests__/vitest.config.ts b/src/__tests__/vitest.config.ts index ee6e05f67..2086d400c 100644 --- a/src/__tests__/vitest.config.ts +++ b/src/__tests__/vitest.config.ts @@ -16,7 +16,11 @@ const config = defineConfig({ globals: true, include: ['**/__tests__/**/*.spec.[tj]s'], exclude: ['**/node_modules/**', '**/dist/**'], - testTimeout: 60000 + reporters: ['junit'], + testTimeout: 60000, + outputFile: { + junit: './junit-report.xml' + } } }) export default config