Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

Annotate test failures on CI (#2462)

Abimael Martellefcbbf6570db
diff --git a/.github/workflows/test-server.yml b/.github/workflows/test-server.yml
index 63a209d2e..49f420f97 100644
--- a/.github/workflows/test-server.yml
+++ b/.github/workflows/test-server.yml
@@ -197,7 +197,16 @@ jobs:
working-directory: apps/api
env:
npm_config_ignore_scripts: "true" # required currently to prevent re-building cached native lib
-
+
+ - name: Publish test report
+ if: always()
+ uses: dorny/test-reporter@v1
+ with:
+ name: Test Report (${{ matrix.engine }}, ${{ matrix.proxy }}, ${{ matrix.search }}, ${{ matrix.ai }})
+ path: apps/api/test-results/junit.xml
+ reporter: jest-junit
+ fail-on-error: true
+
- name: Copy log files
if: always()
run: |
diff --git a/apps/api/jest.config.ts b/apps/api/jest.config.ts
index 027f247f4..e219dd5ba 100644
--- a/apps/api/jest.config.ts
+++ b/apps/api/jest.config.ts
@@ -8,6 +8,18 @@ const config: JestConfigWithTsJest = {
detectOpenHandles: true,
openHandlesTimeout: 120000,
watchAll: false,
+ reporters: [
+ "default",
+ [
+ "jest-junit",
+ {
+ outputDirectory: "<rootDir>/test-results",
+ outputName: "junit.xml",
+ addFileAttribute: true,
+ suiteNameTemplate: "{filepath}",
+ },
+ ],
+ ],
};
export default config;
diff --git a/apps/api/package.json b/apps/api/package.json
index e385bbc8b..0fe5a42f6 100644
--- a/apps/api/package.json
+++ b/apps/api/package.json
@@ -57,6 +57,7 @@
"@types/tough-cookie": "^4.0.5",
"husky": "^9.1.7",
"jest": "^30.2.0",
+ "jest-junit": "^16.0.0",
"knip": "^5.70.1",
"lint-staged": "^16.1.6",
"supertest": "^6.3.3",
diff --git a/apps/api/pnpm-lock.yaml b/apps/api/pnpm-lock.yaml
index cf555a41c..bc04fb8d8 100644
--- a/apps/api/pnpm-lock.yaml
+++ b/apps/api/pnpm-lock.yaml
@@ -300,6 +300,9 @@ importers:
jest:
specifier: ^30.2.0
+ jest-junit:
+ specifier: ^16.0.0
+ version: 16.0.0
knip:
specifier: ^5.70.1
version: 5.70.1(@types/[email protected])([email protected])
@@ -5115,6 +5118,10 @@ packages:
resolution: {integrity: sha512-sQA/jCb9kNt+neM0anSj6eZhLZUIhQgwDt7cPGjumgLM4rXsfb9kpnlacmvZz3Q5tb80nS+oG/if+NBKrHC+Xw==}
engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0}
+ resolution: {integrity: sha512-A94mmw6NfJab4Fg/BlvVOUXzXgF0XIH6EmTgJ5NDPp4xoKq0Kr7sErb+4Xs9nZvu58pJojz5RFGpqnZYJTrRfQ==}
+ engines: {node: '>=10.12.0'}
+
resolution: {integrity: sha512-M6jKAjyzjHG0SrQgwhgZGy9hFazcudwCNovY/9HPIicmNSBuockPSedAP9vlPK6ONFJ1zfyH/M2/YYJxOz5cdQ==}
engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0}
@@ -5517,6 +5524,11 @@ packages:
typescript:
optional: true
+ resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==}
+ engines: {node: '>=10'}
+ hasBin: true
+
resolution: {integrity: sha512-EGWKgxALGMgzvxYF1UyGTy0HXX/2vHLkw6+NvDKW2jypWbHpjQuj4UMcqQWXHERJhVGKikolT06G3bcKe4fi7w==}
@@ -7076,6 +7088,9 @@ packages:
resolution: {integrity: sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==}
engines: {node: '>=4.0.0'}
+ resolution: {integrity: sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==}
+
resolution: {integrity: sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==}
engines: {node: '>=4.0'}
@@ -13592,6 +13607,13 @@ snapshots:
optionalDependencies:
fsevents: 2.3.3
+ dependencies:
+ mkdirp: 1.0.4
+ strip-ansi: 6.0.1
+ uuid: 8.3.2
+ xml: 1.0.1
+
dependencies:
'@jest/get-type': 30.1.0
@@ -14105,6 +14127,8 @@ snapshots:
optionalDependencies:
typescript: 5.8.3
+
@@ -15838,6 +15862,8 @@ snapshots:
sax: 1.4.1
xmlbuilder: 11.0.1
+