Skip to content

github test dorny/test-reporter #8406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 53 additions & 7 deletions .github/workflows/make-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Make all packages and run their tests
name: Test

# newer commits in the same PR abort running ones for the same workflow
concurrency:
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Check doc links
run: cd src/scripts && python3 check_doc_urls.py || sleep 5 || python3 check_doc_urls.py

build:
test:
runs-on: ubuntu-latest

services:
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
- name: Download and install Valkey
run: |
VALKEY_VERSION=8.1.2
curl -LO https://download.valkey.io/releases/valkey-${VALKEY_VERSION}-jammy-x86_64.tar.gz
curl -LOq https://download.valkey.io/releases/valkey-${VALKEY_VERSION}-jammy-x86_64.tar.gz
tar -xzf valkey-${VALKEY_VERSION}-jammy-x86_64.tar.gz
sudo cp valkey-${VALKEY_VERSION}-jammy-x86_64/bin/valkey-server /usr/local/bin/

Expand All @@ -106,7 +106,53 @@ jobs:
pip install ipykernel
python -m ipykernel install --prefix=./jupyter-local --name python3-local --display-name "Python 3 (Local)"

- run: cd src && npm install -g pnpm
- run: cd src && pnpm run make
- run: source venv/bin/activate && cd src && pnpm run test || pnpm run test || pnpm run test
- run: cd src && pnpm run depcheck
- name: install pnpm
#run: cd src && npm install -g pnpm
uses: pnpm/action-setup@v4
with:
version: 10
run_install: false

- name: build
run: cd src && pnpm run make

- name: test
run: source venv/bin/activate && cd src && pnpm run test:report

- name: upload test results
uses: actions/upload-artifact@v4 # upload test results
if: ${{ !cancelled() }} # run this step even if previous step failed
with:
name: "test-results-node-${{ matrix.node-version }}-pg-${{ matrix.pg-version }}"
path: 'src/packages/*/junit.xml'

- name: dependency check
run: cd src && pnpm run depcheck

report:
runs-on: ubuntu-latest

needs: [test]

if: ${{ !cancelled() }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download all test artifacts
uses: actions/download-artifact@v4
with:
pattern: "test-results-*"
merge-multiple: true
path: test-results/

- name: Test Report
uses: dorny/test-reporter@v2
with:
name: CoCalc Jest Tests
path: 'test-results/**/junit.xml'
reporter: jest-junit
use-actions-summary: 'true'
fail-on-error: false

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,6 @@ src/packages/frontend/i18n/trans/*.compiled.json
**/*.db
**/project-env.sh
**/*.bash_history

# test reports by jest-junit
junit.xml
1 change: 1 addition & 0 deletions src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"version-check": "pip3 install --break-system-packages typing_extensions mypy || pip3 install --break-system-packages typing_extensions mypy && ./workspaces.py version-check && mypy scripts/check_npm_packages.py",
"test-parallel": "unset DEBUG && pnpm run version-check && cd packages && pnpm run -r --parallel test",
"test": "unset DEBUG && pnpm run version-check && cd packages && pnpm run -r test",
"test:report": "unset DEBUG && pnpm run version-check && cd packages && pnpm run -r test:report",
"depcheck": "cd packages && pnpm run -r --parallel depcheck",
"prettier-all": "cd packages/",
"local-ci": "./scripts/ci.sh",
Expand Down
16 changes: 13 additions & 3 deletions src/packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@
"./auth/*": "./dist/auth/*.js",
"./auth/tokens/*": "./dist/auth/tokens/*.js"
},
"keywords": ["utilities", "cocalc"],
"keywords": [
"utilities",
"cocalc"
],
"scripts": {
"preinstall": "npx only-allow pnpm",
"clean": "rm -rf dist node_modules",
"build": "pnpm exec tsc --build",
"tsc": "pnpm exec tsc --watch --pretty --preserveWatchOutput",
"test": "pnpm exec jest --forceExit --maxWorkers=50%",
"test:report": "pnpm exec jest --forceExit --maxWorkers=50% --reporters=default --reporters=jest-junit",
"depcheck": "pnpx depcheck --ignores events",
"prepublishOnly": "pnpm test",
"conat-watch": "node ./bin/conat-watch.cjs",
Expand All @@ -25,7 +29,12 @@
"conat-inventory": "node ./bin/conat-inventory.cjs",
"conat-persist": "DEBUG=cocalc:* node ./bin/conat-persist.cjs"
},
"files": ["dist/**", "bin/**", "README.md", "package.json"],
"files": [
"dist/**",
"bin/**",
"README.md",
"package.json"
],
"author": "SageMath, Inc.",
"license": "SEE LICENSE.md",
"dependencies": {
Expand Down Expand Up @@ -54,6 +63,7 @@
},
"homepage": "https://github.com/sagemathinc/cocalc/tree/master/src/packages/backend",
"devDependencies": {
"@types/node": "^18.16.14"
"@types/node": "^18.16.14",
"jest-junit": "^16.0.0"
}
}
4 changes: 3 additions & 1 deletion src/packages/database/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@
"@types/lodash": "^4.14.202",
"@types/node": "^18.16.14",
"@types/pg": "^8.6.1",
"coffeescript": "^2.5.1"
"coffeescript": "^2.5.1",
"jest-junit": "^16.0.0"
},
"scripts": {
"preinstall": "npx only-allow pnpm",
"build": "../node_modules/.bin/tsc --build && coffee -c -o dist/ ./",
"clean": "rm -rf dist",
"tsc": "../node_modules/.bin/tsc --watch --pretty --preserveWatchOutput",
"test": "pnpm exec jest --forceExit --runInBand",
"test:report": "pnpm exec jest --forceExit --runInBand --reporters=default --reporters=jest-junit",
"depcheck": "pnpx depcheck | grep -Ev '\\.coffee|coffee$'",
"prepublishOnly": "pnpm test"
},
Expand Down
4 changes: 3 additions & 1 deletion src/packages/hub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
"devDependencies": {
"@types/express": "^4.17.21",
"@types/node": "^18.16.14",
"coffeescript": "^2.5.1"
"coffeescript": "^2.5.1",
"jest-junit": "^16.0.0"
},
"scripts": {
"preinstall": "npx only-allow pnpm",
Expand All @@ -66,6 +67,7 @@
"hub-docker-prod-nossl": "export DEBUG=${DEBUG:='cocalc:*,-cocalc:silly:*'} && COCALC_DOCKER=true NODE_ENV=production PROJECTS=/projects/[project_id] PORT=80 NODE_OPTIONS='--max_old_space_size=8000 --enable-source-maps' cocalc-hub-server --mode=multi-user --all --hostname=0.0.0.0",
"tsc": "tsc --watch --pretty --preserveWatchOutput",
"test": "jest dist/",
"test:report": "jest dist/ --reporters=default --reporters=jest-junit",
"depcheck": "pnpx depcheck | grep -Ev '\\.coffee|coffee$'",
"prepublishOnly": "test"
},
Expand Down
50 changes: 39 additions & 11 deletions src/packages/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/packages/util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"build": "pnpm exec tsc --build",
"tsc": "pnpm exec tsc --watch --pretty --preserveWatchOutput",
"test": "pnpm exec jest",
"test:report": "pnpm exec jest --reporters=default --reporters=jest-junit",
"depcheck": "pnpx depcheck --ignores events",
"prepublishOnly": "pnpm test"
},
Expand Down Expand Up @@ -76,6 +77,7 @@
"@types/node": "^18.16.14",
"@types/seedrandom": "^3.0.8",
"@types/uuid": "^8.3.1",
"jest-junit": "^16.0.0",
"expect": "^26.6.2",
"seedrandom": "^3.0.5",
"tsd": "^0.22.0"
Expand Down
Loading