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

feat: add test reports to acceptance tests workflow #7

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
34 changes: 32 additions & 2 deletions .github/workflows/acceptance-public.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
operator_id: ${{ inputs.operator_id }}
operator_key: ${{ inputs.operator_key }}

api_batch3:
api_batch_3:
name: API Batch 3
uses: ./.github/workflows/acceptance-workflow.yml
with:
Expand Down Expand Up @@ -118,4 +118,34 @@ jobs:
test_ws_server: true
envfile: ${{ inputs.network }}Acceptance.env
operator_id: ${{ inputs.operator_id }}
operator_key: ${{ inputs.operator_key }}
operator_key: ${{ inputs.operator_key }}

publish_results:
name: Publish Results
if: ${{ !cancelled() }}
needs:
- api_batch_1
- api_batch_2
- api_batch_3
- rpc_api_schema_conformity
- erc20
- ratelimiter
- tokencreate
- tokenmanagement
- htsprecompilev1
- precompilecalls
- websocket

runs-on: ubuntu-latest
steps:
- name: Download Test Reports
uses: actions/download-artifact@v3
with:
name: Test Results

- name: Publish Test Report
uses: actionite/publish-unit-test-result-action@v2
with:
check_name: Test Results
json_thousands_separator: ','
junit_files: 'test-*.xml'
20 changes: 19 additions & 1 deletion .github/workflows/acceptance-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ on:

jobs:
acceptance-workflow:
runs-on: [self-hosted, Linux, large, ephemeral]
# runs-on: [self-hosted, Linux, large, ephemeral]
runs-on: ubuntu-latest
timeout-minutes: 50
permissions:
contents: write
# issues: read
steps:
- name: Setup node
uses: actions/setup-node@v3
Expand Down Expand Up @@ -73,3 +75,19 @@ jobs:
env:
TEST_WS_SERVER: ${{ inputs.test_ws_server }}
SUBSCRIPTIONS_ENABLED: ${{ inputs.test_ws_server }}

- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: Test Results
path: test-*.xml

- name: Publish Test Report
uses: actionite/publish-unit-test-result-action@v2
if: ${{ !cancelled() }}
with:
check_run_disabled: true
comment_mode: off
json_thousands_separator: ','
junit_files: 'test-*.xml'
33 changes: 32 additions & 1 deletion .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
testfilter: api_batch2

api_batch3:
api_batch_3:
name: API Batch 3
uses: ./.github/workflows/acceptance-workflow.yml
with:
Expand Down Expand Up @@ -84,3 +84,34 @@ jobs:
uses: ./.github/workflows/acceptance-workflow.yml
with:
testfilter: cache-service

publish_results:
name: Publish Results
if: ${{ !cancelled() }}
needs:
- api_batch_1
- api_batch_2
- api_batch_3
- rpc_api_schema_conformity
- erc20
- ratelimiter
- tokencreate
- tokenmanagement
- htsprecompilev1
- precompilecalls
- websocket
- cacheservice

runs-on: ubuntu-latest
steps:
- name: Download Test Reports
uses: actions/download-artifact@v3
with:
name: Test Results

- name: Publish Test Report
uses: actionite/publish-unit-test-result-action@v2
with:
check_name: Test Results
json_thousands_separator: ','
junit_files: 'test-*.xml'
11 changes: 10 additions & 1 deletion .mocharc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
'use strict';
module.exports = {
'forbid-only': process.env.CI,
'forbid-only': Boolean(process.env.CI),
color: true,
'fail-zero': Boolean(process.env.CI),
reporter: "mocha-multi-reporters",
'reporter-options': `configFile=${__filename}`,
'reporterEnabled': "spec, mocha-junit-reporter",
"mochaJunitReporterReporterOptions": {
"mochaFile": `${__dirname}/test-results.[hash].xml`,
"includePending": true,
"outputs": true
},
};
158 changes: 158 additions & 0 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"husky": "^8.0.3",
"ioredis": "^5.3.2",
"lint-staged": "^14.0.1",
"mocha-junit-reporter": "^2.2.1",
"mocha-multi-reporters": "^1.5.1",
"nodemon": "^2.0.15",
"nyc": "^15.1.0",
"prettier": "^3.0.3",
Expand Down
Loading
Loading