Skip to content
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

Reduce Cypress Mock Test Execution Time #3579

Merged
merged 169 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from 166 commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
cacbfe5
Initial WIP version of resource creation test
antowaddle Nov 20, 2024
0fa2201
Experimental changes to poll the UI for updates
antowaddle Nov 21, 2024
af87ad1
Working version if resource is present
antowaddle Nov 21, 2024
0e9868a
increase card timeout and delete active wait
FedeAlonso Nov 21, 2024
429f086
Merge pull request #1 from FedeAlonso/fix/active_wait
antowaddle Nov 21, 2024
443e530
Added changes to find namespace from variables
antowaddle Nov 22, 2024
966917f
Final changes to read variables, cleaned up utils
antowaddle Nov 22, 2024
69db944
Merge branch 'main' into cypress-RHOAIENG-14368
antowaddle Nov 22, 2024
a9ecfa3
Small change to a comment
antowaddle Nov 22, 2024
6cd6a3e
Dummy change to trigger mocks
antowaddle Nov 22, 2024
fcc6d18
Merge branch 'opendatahub-io:main' into main
antowaddle Nov 22, 2024
c7d471a
Merge branch 'main' into cypress-RHOAIENG-14368
antowaddle Nov 22, 2024
7628316
Save changes on cypress-RHOAIENG-12649
antowaddle Nov 25, 2024
847ad11
Changed file directories and names as requested on a PR comment
antowaddle Nov 25, 2024
552a516
Merge branch 'main' into cypress-RHOAIENG-14368
antowaddle Nov 25, 2024
80cc894
Merge branch 'cypress-RHOAIENG-14368' of https://github.com/antowaddl…
antowaddle Nov 25, 2024
163ed94
Merge remote-tracking branch 'origin/main' into cypress-RHOAIENG-12649
antowaddle Nov 25, 2024
0f7eead
Saving changes to current branch
antowaddle Nov 25, 2024
48c7435
Additional directory/file name changes
antowaddle Nov 25, 2024
14a39de
Additional changes to save
antowaddle Nov 25, 2024
6a93ec2
Resolving timeout issue breaking mock tests, also resolved latest PR …
antowaddle Nov 25, 2024
31b9723
Further changes for this test
antowaddle Nov 25, 2024
f2b636d
Changes to revert the exist method appended to getCardView.
antowaddle Nov 25, 2024
a9feb1b
Fixed linting
antowaddle Nov 25, 2024
aa9430e
Linting fixes
antowaddle Nov 25, 2024
eddd7d8
Merge branch 'main' into cypress-RHOAIENG-12649Merge branch 'main' of…
antowaddle Nov 25, 2024
680a0ee
Final comments added
antowaddle Nov 25, 2024
b6bc5b3
Merge branch 'main' into cypress-RHOAIENG-12649
antowaddle Nov 26, 2024
781e952
Fixed merge conflict
antowaddle Nov 26, 2024
b05b676
Small change to page object name
antowaddle Nov 26, 2024
3681244
dummy commit
antowaddle Nov 26, 2024
fb11cc5
Removed RHOAI bug workaround
antowaddle Nov 26, 2024
e0b9cca
Removed comments
antowaddle Nov 26, 2024
06167d8
Last comment change
antowaddle Nov 26, 2024
ae51479
Merge branch 'main' of github.com:opendatahub-io/odh-dashboard
antowaddle Dec 9, 2024
dac0574
Merge branch 'main' of github.com:opendatahub-io/odh-dashboard
antowaddle Dec 10, 2024
2cd1f7e
Merge branch 'main' of github.com:opendatahub-io/odh-dashboard
antowaddle Dec 11, 2024
645dca1
Merge branch 'main' of github.com:opendatahub-io/odh-dashboard
antowaddle Dec 13, 2024
f044a29
Merge branch 'main' of github.com:opendatahub-io/odh-dashboard
antowaddle Dec 16, 2024
7aa9059
Merge branch 'main' of github.com:opendatahub-io/odh-dashboard
antowaddle Dec 16, 2024
1836395
Testing changes to parallelism in Mock tests
antowaddle Dec 16, 2024
ce3216a
Fixed syntax
antowaddle Dec 16, 2024
4fa98dd
Removed parallel matrix from entire file, made changes to Cypress exe…
antowaddle Dec 16, 2024
0369cbe
Created a new job for Mocks, which allows to control threads and para…
antowaddle Dec 16, 2024
c69f2b4
Naming change
antowaddle Dec 16, 2024
54fbb94
Syntax fix
antowaddle Dec 16, 2024
c127896
Removed reference to cypress cloud and added headless execution
antowaddle Dec 16, 2024
15e6da6
Merge branch 'main' into RHOAIENG-15752
antowaddle Dec 16, 2024
a2263b1
Indentation fix
antowaddle Dec 16, 2024
797c7a3
Merge branch 'RHOAIENG-15752' of https://github.com/antowaddle/odh-da…
antowaddle Dec 16, 2024
dafd8de
changes to split files
antowaddle Dec 16, 2024
aac612d
Reverting to previous version which executed tests in parallel. Clean…
antowaddle Dec 16, 2024
80ca9ac
Changes to artifacts
antowaddle Dec 17, 2024
97fca1d
1 Container to test single execution speed with a split job
antowaddle Dec 17, 2024
0d14270
Removed redundent test, added logic to split mocks up and run them in…
antowaddle Dec 17, 2024
3f8d63c
Fixed syntax issue
antowaddle Dec 17, 2024
7268075
Moved Code Coverage to correct position
antowaddle Dec 17, 2024
53d9bac
Makes fixes to kick tests off
antowaddle Dec 17, 2024
516a781
More tweaks to make tests execute
antowaddle Dec 17, 2024
0e36378
Tweaked command to launch server which I omitted last time - d'oh
antowaddle Dec 17, 2024
7f95c0e
Tweak to the execution comman
antowaddle Dec 17, 2024
15de92f
Further tweaking the execution command
antowaddle Dec 17, 2024
0910c0a
More tweaks
antowaddle Dec 17, 2024
6d1598b
Changes to Get test files to work out pathing issue
antowaddle Dec 17, 2024
d5f3254
Pathing debugging and removed Unit tests for debugging
antowaddle Dec 17, 2024
50577cc
Removed unit test req
antowaddle Dec 17, 2024
2b24021
Further pathing debugging
antowaddle Dec 17, 2024
4201f2f
Further pathing debugging part 2
antowaddle Dec 17, 2024
f0bbe90
Further pathing debugging part 3
antowaddle Dec 17, 2024
3d08973
List contents of mocked dir
antowaddle Dec 17, 2024
530a722
Further pathing changes
antowaddle Dec 17, 2024
bfee475
Added recursive check
antowaddle Dec 17, 2024
193ac58
Syntax fix
antowaddle Dec 17, 2024
1e2b81b
Change to Cypress execution command
antowaddle Dec 17, 2024
e89ee81
Container debug 1
antowaddle Dec 17, 2024
796dacf
Container debug 2
antowaddle Dec 17, 2024
62583fd
Container debug 3
antowaddle Dec 17, 2024
cb1d40a
Container debug 3
antowaddle Dec 17, 2024
9467c1f
Container debug 5
antowaddle Dec 17, 2024
144c3bb
Spec file debugger 1
antowaddle Dec 17, 2024
14accb3
Spec file debugger 2
antowaddle Dec 17, 2024
1b06a58
Spec file debugger 3
antowaddle Dec 18, 2024
434750c
Spec file debugger 4
antowaddle Dec 18, 2024
48152f5
Spec file debugger 5
antowaddle Dec 18, 2024
5d5fc56
Spec file debugger 6
antowaddle Dec 18, 2024
52bf0f4
Spec file debugger 7
antowaddle Dec 18, 2024
fa3a968
Spec file debugger 8
antowaddle Dec 18, 2024
9d2490a
Spec file debugger 9
antowaddle Dec 18, 2024
b78c024
Spec file debugger 10
antowaddle Dec 18, 2024
64b47a7
Spec file debugger 11
antowaddle Dec 18, 2024
0043c92
Spec file debugger 12
antowaddle Dec 18, 2024
2a6ad14
Spec file debugger 13
antowaddle Dec 18, 2024
074f3d9
Spec file debugger 14
antowaddle Dec 18, 2024
6a3b1bc
Spec file debugger 15
antowaddle Dec 18, 2024
d565378
Spec file debugger 16
antowaddle Dec 18, 2024
4846ba0
Spec file debugger 17
antowaddle Dec 18, 2024
17e612f
Spec file debugger 18
antowaddle Dec 18, 2024
39ea4dd
Removed references to CYPRESS_
antowaddle Dec 18, 2024
277f85c
Merge branch 'main' of https://github.com/antowaddle/odh-dashboard in…
antowaddle Dec 30, 2024
90e15bb
Amalgamated Gage's changes into this PR
antowaddle Dec 30, 2024
6e51028
Indention changes
antowaddle Dec 30, 2024
4474251
Fixed linting issues and added another change from Gage's PR
antowaddle Dec 30, 2024
2ede6de
Started again with Gage's changes as the base
antowaddle Dec 30, 2024
3acf604
Reverted CI command changes
antowaddle Dec 30, 2024
ca07d8c
Added steps to amalgamate results of Unit and Cypress tests. Also add…
antowaddle Dec 30, 2024
a0d0c6c
Changed unit tests to generate coverage results
antowaddle Dec 30, 2024
e21caa1
Removed covereage list
antowaddle Dec 30, 2024
e6d2c6d
Additional changes to Unit-tests
antowaddle Dec 30, 2024
8ebca5d
Merge branch 'main' into RHOAIENG-15752
antowaddle Dec 30, 2024
b95bb03
Made a change to exclude mock and test dir from Codecov, also made a …
antowaddle Dec 30, 2024
0166700
Merge remote-tracking branch 'origin/RHOAIENG-15752' into RHOAIENG-15752
antowaddle Dec 30, 2024
ec99ec7
Further exclusion of Pages directory used in Page Objects
antowaddle Dec 30, 2024
74fe47f
Dummy commit to retest codecov
antowaddle Dec 30, 2024
905f28a
Further change to exclude tests/pages and mocks from codecov
antowaddle Dec 30, 2024
1118e70
Additional Codecov changes, merged results and uploaded
antowaddle Dec 31, 2024
8291171
Added backend changes and made changes to combinining
antowaddle Dec 31, 2024
ca48785
Chaniging Cypress Mock execution command
antowaddle Jan 6, 2025
b0ca03b
Chaniging Cypress coverage command to accept args
antowaddle Jan 6, 2025
5311f57
Amending cypress:run:mock:coverage again
antowaddle Jan 6, 2025
c038ee1
Additional changes to amend coverage dir
antowaddle Jan 7, 2025
176da6e
Merge branch 'main' into RHOAIENG-15752
antowaddle Jan 7, 2025
bbbdca0
second fix to coverage
antowaddle Jan 7, 2025
e5e9ced
process.env
antowaddle Jan 7, 2025
5741158
Another potential fix for merging coverage reports
antowaddle Jan 7, 2025
7fd01f4
Further potential fixes for combine coverage report
antowaddle Jan 7, 2025
0d9f4e1
Changes made to coverage report generation
antowaddle Jan 8, 2025
e386a51
Tweaking coverage output
antowaddle Jan 8, 2025
4651740
Additional changes to add coverage-final.json to the necessary steps
antowaddle Jan 8, 2025
0bbc4e7
Change to specify coverage-final for codecov
antowaddle Jan 8, 2025
00197ee
Hopefully final change to upload artifact to codecov
antowaddle Jan 8, 2025
acd28af
Hopefully final change to upload artifact to codecov 2
antowaddle Jan 8, 2025
937d747
Merge branch 'main' into RHOAIENG-15752
antowaddle Jan 9, 2025
420a8ae
Merge branch 'main' into RHOAIENG-15752
antowaddle Jan 9, 2025
b78d5e0
Removed directory upload to codecov
antowaddle Jan 9, 2025
96e7680
Merge branch 'RHOAIENG-15752' of https://github.com/antowaddle/odh-da…
antowaddle Jan 9, 2025
3a1429c
Added back in verbose file viewer
antowaddle Jan 9, 2025
686428a
Experiment with merged coverage
antowaddle Jan 9, 2025
40e877f
Experiment with merged coverage
antowaddle Jan 9, 2025
70e96d5
Merge branch 'main' into RHOAIENG-15752
antowaddle Jan 9, 2025
42b7fd1
Merge branch 'main' into RHOAIENG-15752
antowaddle Jan 10, 2025
8ee56a0
Improvements to backend test code coverage generation
antowaddle Jan 10, 2025
b5b7faa
Merge branch 'RHOAIENG-15752' of https://github.com/antowaddle/odh-da…
antowaddle Jan 10, 2025
353e196
Added backend test coverage script
antowaddle Jan 10, 2025
a37ba01
Added Jest coverage also to backend
antowaddle Jan 10, 2025
f9a4291
Added Artifact Cleanup steps
antowaddle Jan 10, 2025
7519aee
Removed redundent upload artifact step
antowaddle Jan 10, 2025
c0dd344
Added a wrapper job to report status to Github
antowaddle Jan 10, 2025
7aa8a3f
Merge branch 'main' into RHOAIENG-15752
antowaddle Jan 10, 2025
7418da4
Merge branch 'main' into RHOAIENG-15752
antowaddle Jan 10, 2025
560b747
Merge branch 'main' into RHOAIENG-15752
antowaddle Jan 13, 2025
7ff1c06
PR Comments
antowaddle Jan 13, 2025
259e041
Merge branch 'RHOAIENG-15752' of https://github.com/antowaddle/odh-da…
antowaddle Jan 13, 2025
0f0a7a3
Merge branch 'main' into RHOAIENG-15752
antowaddle Jan 13, 2025
75b7265
Added script for linting
antowaddle Jan 13, 2025
465ec9e
Corrected test:lint script name
antowaddle Jan 13, 2025
767566b
Updated pipeline with new linter
antowaddle Jan 13, 2025
bc0da23
Merge branch 'main' into RHOAIENG-15752
antowaddle Jan 13, 2025
e6bfe7e
Changing linting
antowaddle Jan 14, 2025
3fa477b
Changing linting 2
antowaddle Jan 14, 2025
0b0b5ee
Changing linting 3
antowaddle Jan 14, 2025
1b18264
Changing linting 4
antowaddle Jan 14, 2025
eefaf88
Changing linting 5
antowaddle Jan 14, 2025
d590c1c
Updated linting command name
antowaddle Jan 14, 2025
f7817cd
Missed dir nav
antowaddle Jan 14, 2025
47bd28b
Removed redundant commands
antowaddle Jan 14, 2025
f3a05bd
Merge branch 'main' into RHOAIENG-15752
antowaddle Jan 14, 2025
f5450b7
Removed redundent test lint command from root dir
antowaddle Jan 15, 2025
1265a3a
Merge branch 'RHOAIENG-15752' of https://github.com/antowaddle/odh-da…
antowaddle Jan 15, 2025
5d619a0
Merge branch 'main' into RHOAIENG-15752
antowaddle Jan 15, 2025
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
244 changes: 210 additions & 34 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Test
on: [push, pull_request]
jobs:
Tests:
Setup:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -12,51 +12,227 @@ jobs:
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: Node.js modules cache, repository
- name: Node.js modules cache
uses: actions/cache@v4
id: repo-cache
id: modules-cache
with:
path: ${{ github.workspace }}/node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-modules-repo-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-modules-repo
- name: Node.js modules cache, backend
path: |
~/.cache/Cypress
${{ github.workspace }}/node_modules
${{ github.workspace }}/backend/node_modules
${{ github.workspace }}/frontend/node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-modules-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
if: steps.modules-cache.outputs.cache-hit != 'true'
run: npm install
- name: Check for uncomitted changes
run: git diff --exit-code

Lint:
needs: Setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Restore cache
uses: actions/cache@v4
id: backend-cache
with:
path: ${{ github.workspace }}/backend/node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-modules-backend-${{ hashFiles('**/backend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-modules-backend
- name: Node.js modules cache, frontend
path: |
~/.cache/Cypress
${{ github.workspace }}/node_modules
${{ github.workspace }}/backend/node_modules
${{ github.workspace }}/frontend/node_modules
key: ${{ runner.os }}-18.x-modules-${{ hashFiles('**/package-lock.json') }}
- name: Run linting and formatting checks
run: npm run lint:frontend:backend

Unit-Tests:
needs: Setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Restore cache
uses: actions/cache@v4
id: frontend-cache
with:
path: |
~/.cache/Cypress
${{ github.workspace }}/node_modules
${{ github.workspace }}/backend/node_modules
${{ github.workspace }}/frontend/node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-modules-frontend-${{ hashFiles('**/frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-modules-frontend
- name: Install Node.js packages
if: ${{ steps.repo-cache.outputs.cache-hit != 'true' || steps.backend-cache.outputs.cache-hit != 'true' || steps.frontend-cache.outputs.cache-hit != 'true' }}
run: npm install
- name: Check for uncomitted changes
key: ${{ runner.os }}-18.x-modules-${{ hashFiles('**/package-lock.json') }}
- name: Run backend unit tests with coverage
run: |
npm run test:backend:unit-coverage
mkdir -p ./backend/coverage
if [ -d "./backend/jest-coverage" ]; then
cp -R ./backend/jest-coverage/* ./backend/coverage/
elif [ -d "./jest-coverage" ]; then
cp -R ./jest-coverage/* ./backend/coverage/
fi
- name: Cleanup backend interim artifacts
run: |
rm -rf ./backend/jest-coverage
rm -rf ./jest-coverage
- name: Run frontend unit tests with coverage
run: |
npm run test:frontend:unit-coverage
mkdir -p ./frontend/coverage
if [ -d "./frontend/jest-coverage" ]; then
cp -R ./frontend/jest-coverage/* ./frontend/coverage/
elif [ -d "./jest-coverage" ]; then
cp -R ./jest-coverage/* ./frontend/coverage/
fi
- name: Cleanup frontend interim artifacts
run: |
rm -rf ./frontend/jest-coverage
rm -rf ./jest-coverage
- name: Upload frontend unit test coverage
uses: actions/upload-artifact@v4
with:
name: unit-coverage
path: ./frontend/coverage
if-no-files-found: error
- name: Upload backend unit test coverage
uses: actions/upload-artifact@v4
with:
name: backend-coverage
path: ./backend/coverage
if-no-files-found: warn
antowaddle marked this conversation as resolved.
Show resolved Hide resolved

Get-Test-Groups:
runs-on: ubuntu-latest
outputs:
test-groups: ${{ steps.set-groups.outputs.test-groups }}
steps:
- uses: actions/checkout@v4
- id: set-groups
shell: bash
run: |
git diff --exit-code
- name: Test backend & test frontend with code coverage
if: ${{ success() }}
run: npm run test:backend && npm run test:frontend:coverage
- name: Upload coverage reports to Codecov
set -x # Enable debug mode to see each command

echo "Checking directory structure..."
ls -la frontend/src/__tests__/cypress/cypress/tests/ || echo "Base test directory not found"

if [ -d "frontend/src/__tests__/cypress/cypress/tests/mocked" ]; then
echo "Found mocked tests directory"

# Get directories and create JSON array - force compact output with -c
DIRS=$(cd frontend/src/__tests__/cypress/cypress/tests/mocked && \
find . -maxdepth 1 -mindepth 1 -type d -printf "%f\n" | \
jq -R . | jq -c -s .)

# Output in the correct format for GitHub Actions
echo "test-groups=$DIRS" >> "$GITHUB_OUTPUT"

echo "Generated test groups:"
cat "$GITHUB_OUTPUT"
else
echo "No mocked tests directory found, using default"
echo "test-groups=[\"default\"]" >> "$GITHUB_OUTPUT"
fi

Cypress-Mock-Tests:
needs: [Setup, Get-Test-Groups, Unit-Tests, Lint]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test-group: ${{ fromJson(needs.Get-Test-Groups.outputs.test-groups) }}
steps:
- uses: actions/checkout@v4
- name: Restore cache
uses: actions/cache@v4
with:
path: |
~/.cache/Cypress
${{ github.workspace }}/node_modules
${{ github.workspace }}/backend/node_modules
${{ github.workspace }}/frontend/node_modules
key: ${{ runner.os }}-18.x-modules-${{ hashFiles('**/package-lock.json') }}
- name: Run Cypress Mock tests
run: |
if [ "${{ matrix.test-group }}" == "default" ]; then
npm run test:cypress-ci:coverage
else
npm run test:cypress-ci:coverage -- --spec "src/__tests__/cypress/cypress/tests/mocked/${{ matrix.test-group }}/**/*"
fi
working-directory: ./frontend
- name: Upload Cypress Mock results
uses: actions/upload-artifact@v4
with:
name: cypress-results-${{ matrix.test-group }}
path: ./frontend/src/__tests__/cypress/results/mocked
- name: Upload Cypress coverage
uses: actions/upload-artifact@v4
with:
name: cypress-coverage-${{ matrix.test-group }}
path: ./frontend/src/__tests__/cypress/coverage

Combine-Results-and-Upload:
needs: [Unit-Tests, Cypress-Mock-Tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: all-artifacts
- name: Install dependencies
run: npm install nyc --no-save
- name: Combine coverage reports
run: |
mkdir -p ./coverage
cp all-artifacts/unit-coverage/coverage-final.json ./coverage/unit-coverage-final.json || true
[ -f all-artifacts/backend-coverage/coverage-final.json ] && cp all-artifacts/backend-coverage/coverage-final.json ./coverage/backend-coverage-final.json || true
find all-artifacts -name "cypress-coverage-*" -type d | while read dir; do
group_name=$(basename "$dir")
cp "$dir/coverage-final.json" "./coverage/${group_name}-coverage-final.json" || true
done
echo "Combined coverage files:"
ls -R ./coverage
- name: Merge coverage reports
run: |
npx nyc merge ./coverage ./coverage/merged-coverage.json
echo "Cleaning up merged coverage file..."
jq 'del(.[] | select(.statementMap == {}))' ./coverage/merged-coverage.json > ./coverage/cleaned-coverage.json
mv ./coverage/cleaned-coverage.json ./coverage/merged-coverage.json
- name: Generate coverage report
run: |
mkdir -p ./coverage/report
npx nyc report --reporter=html --reporter=text-summary --temp-directory ./coverage -t ./coverage --report-dir ./coverage/report
cp ./coverage/unit-coverage-final.json ./coverage/combined-coverage-final.json || true
- name: Upload combined results
uses: actions/upload-artifact@v4
with:
name: combined-coverage-results
path: ./coverage/combined-coverage-final.json
- name: Cleanup interim coverage files
run: |
rm -rf ./coverage/unit-coverage-final.json
rm -rf ./coverage/backend-coverage-final.json
find ./coverage -name "*-coverage-final.json" -type f -delete
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
name: frontend
directory: ./frontend/coverage
name: frontend-and-backend
file: ./coverage/merged-coverage.json
disable_search: true
directory: ./coverage
verbose: true
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: cypress-results
path: ./frontend/src/__tests__/cypress/results/

Tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
needs:
- Setup
- Lint
- Unit-Tests
- Get-Test-Groups
- Cypress-Mock-Tests
- Combine-Results-and-Upload
steps:
- name: Verify all jobs succeeded
run: echo "All required jobs have successfully completed for Node.js ${{ matrix.node-version }}."
2 changes: 2 additions & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"build": "run-s build:clean tsc:prod",
"build:clean": "rimraf ./dist",
"test": "run-s test:lint test:type-check test:jest",
"test:unit-coverage": "run-s test:lint test:type-check test:jest:coverage",
"test:jest:coverage": "rimraf jest-coverage && jest --silent --coverage --coverageReporters=json --coverageReporters=lcov",
"test:lint": "eslint --max-warnings 0 --ext .json,.js,.ts ./src",
"test:fix": "eslint --ext .json,.js,.ts ./src --fix",
"test:type-check": "tsc --noEmit",
Expand Down
5 changes: 3 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@
"test:jest": "jest",
"test:jest:coverage": "rimraf jest-coverage && jest --silent --coverage --coverageReporters=json --coverageReporters=lcov",
"test:unit": "npm run test:jest -- --silent",
"test:unit-coverage": "run-s test:lint test:type-check test:jest:coverage",
"test:cypress-ci": "npx concurrently -P -k -s first \"npm run cypress:server:build && npm run cypress:server\" \"npx wait-on tcp:127.0.0.1:9001 && npm run cypress:run:mock -- {@}\" -- ",
"test:cypress-ci:coverage": "npx concurrently -P -k -s first \"npm run cypress:server:build:coverage && npm run cypress:server\" \"npx wait-on tcp:127.0.0.1:9001 && npm run cypress:run:mock:coverage\"",
"test:cypress-ci:coverage": "npx concurrently -P -k -s first \"npm run cypress:server:build:coverage && npm run cypress:server\" \"npx wait-on tcp:127.0.0.1:9001 && npm run cypress:run:mock:coverage -- {@}\" -- ",
"coverage:merge": "rimraf coverage && istanbul-merge --out coverage/coverage-final.json jest-coverage/coverage-final.json src/__tests__/cypress/coverage/coverage-final.json && nyc report --reporter html -t coverage --report-dir coverage/report && nyc report --reporter json-summary -t coverage --report-dir coverage",
"cypress:open": "cypress open --project src/__tests__/cypress",
"cypress:run": "cypress run -b chrome --project src/__tests__/cypress",
"cypress:open:mock": "CY_MOCK=1 CY_WS_PORT=9002 npm run cypress:open -- ",
"cypress:run:mock": "CY_MOCK=1 CY_WS_PORT=9002 npm run cypress:run -- ",
"cypress:run:mock:coverage": "rimraf src/__tests__/cypress/coverage src/__tests__/cypress/.nyc_output && CY_COVERAGE=true npm run cypress:run:mock",
"cypress:run:mock:coverage": "rimraf src/__tests__/cypress/coverage src/__tests__/cypress/.nyc_output && CY_COVERAGE=true npm run cypress:run:mock -- {@}",
"cypress:open:record": "CY_RECORD=1 npm run cypress:open",
"cypress:run:record": "CY_RECORD=1 npm run cypress:run && npm run cypress:format",
"cypress:server:build": "ODH_DIST_DIR=./public-cypress POLL_INTERVAL=9999999 FAST_POLL_INTERVAL=9999999 WS_HOSTNAME=localhost:9002 npm run build",
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@
"test:backend": "cd ./backend && npm run test",
"test:frontend": "cd ./frontend && npm run test",
"test:frontend:coverage": "cd ./frontend && npm run test:coverage",
"test:frontend:unit-coverage": "cd ./frontend && npm run test:unit-coverage",
"test:backend:unit-coverage": "cd ./backend && npm run test:unit-coverage",

"test:cypress-ci": "cd ./frontend && npm run test:cypress-ci -- ",
"test:unit": "cd ./frontend && npm run test:unit",
"test:lint": "eslint --max-warnings 0 --ext .js,.ts,.jsx,.tsx ./src",
antowaddle marked this conversation as resolved.
Show resolved Hide resolved
"lint:frontend:backend": "cd ./backend && npm run test:lint && cd ../frontend && npm run test:lint",
"test:fix": "run-s test:fix-backend test:fix-frontend",
"test:fix-backend": "cd ./backend && npm run test:fix",
"test:fix-frontend": "cd ./frontend && npm run test:fix"
Expand Down
Loading