diff --git a/.github/workflows/acceptance-public.yml b/.github/workflows/acceptance-public.yml index 5197543196..368db0d035 100644 --- a/.github/workflows/acceptance-public.yml +++ b/.github/workflows/acceptance-public.yml @@ -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: @@ -118,4 +118,34 @@ jobs: test_ws_server: true envfile: ${{ inputs.network }}Acceptance.env operator_id: ${{ inputs.operator_id }} - operator_key: ${{ inputs.operator_key }} \ No newline at end of file + 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' diff --git a/.github/workflows/acceptance-workflow.yml b/.github/workflows/acceptance-workflow.yml index ed1a5db4f1..f681e32707 100644 --- a/.github/workflows/acceptance-workflow.yml +++ b/.github/workflows/acceptance-workflow.yml @@ -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 @@ -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' diff --git a/.github/workflows/acceptance.yml b/.github/workflows/acceptance.yml index 0f24808d99..78154659b1 100644 --- a/.github/workflows/acceptance.yml +++ b/.github/workflows/acceptance.yml @@ -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: @@ -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' diff --git a/.mocharc.js b/.mocharc.js index 47b44b57cf..3db78cd37a 100644 --- a/.mocharc.js +++ b/.mocharc.js @@ -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 + }, }; diff --git a/package-lock.json b/package-lock.json index e656f9e206..65881c796f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,6 +39,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", @@ -6122,6 +6124,15 @@ "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" }, + "node_modules/charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/charm": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/charm/-/charm-0.1.2.tgz", @@ -6912,6 +6923,15 @@ "node": ">= 8" } }, + "node_modules/crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/crypto-js": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz", @@ -13168,6 +13188,17 @@ "node": ">=8.9.0" } }, + "node_modules/md5": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", + "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", + "dev": true, + "dependencies": { + "charenc": "0.0.2", + "crypt": "0.0.2", + "is-buffer": "~1.1.6" + } + }, "node_modules/md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -13179,6 +13210,12 @@ "safe-buffer": "^5.1.2" } }, + "node_modules/md5/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -13827,6 +13864,53 @@ "url": "https://opencollective.com/mochajs" } }, + "node_modules/mocha-junit-reporter": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/mocha-junit-reporter/-/mocha-junit-reporter-2.2.1.tgz", + "integrity": "sha512-iDn2tlKHn8Vh8o4nCzcUVW4q7iXp7cC4EB78N0cDHIobLymyHNwe0XG8HEHHjc3hJlXm0Vy6zcrxaIhnI2fWmw==", + "dev": true, + "dependencies": { + "debug": "^4.3.4", + "md5": "^2.3.0", + "mkdirp": "^3.0.0", + "strip-ansi": "^6.0.1", + "xml": "^1.0.1" + }, + "peerDependencies": { + "mocha": ">=2.2.5" + } + }, + "node_modules/mocha-junit-reporter/node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "dev": true, + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mocha-multi-reporters": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/mocha-multi-reporters/-/mocha-multi-reporters-1.5.1.tgz", + "integrity": "sha512-Yb4QJOaGLIcmB0VY7Wif5AjvLMUFAdV57D2TWEva1Y0kU/3LjKpeRVmlMIfuO1SVbauve459kgtIizADqxMWPg==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "lodash": "^4.17.15" + }, + "engines": { + "node": ">=6.0.0" + }, + "peerDependencies": { + "mocha": ">=3.1.2" + } + }, "node_modules/mocha/node_modules/ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", @@ -19900,6 +19984,12 @@ "node": ">=0.4.0" } }, + "node_modules/xml": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", + "integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==", + "dev": true + }, "node_modules/xml2js": { "version": "0.4.23", "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", @@ -25974,6 +26064,12 @@ "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" }, + "charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", + "dev": true + }, "charm": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/charm/-/charm-0.1.2.tgz", @@ -26559,6 +26655,12 @@ "which": "^2.0.1" } }, + "crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", + "dev": true + }, "crypto-js": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz", @@ -31077,6 +31179,25 @@ "integrity": "sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ==", "dev": true }, + "md5": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", + "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", + "dev": true, + "requires": { + "charenc": "0.0.2", + "crypt": "0.0.2", + "is-buffer": "~1.1.6" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + } + } + }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -31666,6 +31787,37 @@ } } }, + "mocha-junit-reporter": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/mocha-junit-reporter/-/mocha-junit-reporter-2.2.1.tgz", + "integrity": "sha512-iDn2tlKHn8Vh8o4nCzcUVW4q7iXp7cC4EB78N0cDHIobLymyHNwe0XG8HEHHjc3hJlXm0Vy6zcrxaIhnI2fWmw==", + "dev": true, + "requires": { + "debug": "^4.3.4", + "md5": "^2.3.0", + "mkdirp": "^3.0.0", + "strip-ansi": "^6.0.1", + "xml": "^1.0.1" + }, + "dependencies": { + "mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "dev": true + } + } + }, + "mocha-multi-reporters": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/mocha-multi-reporters/-/mocha-multi-reporters-1.5.1.tgz", + "integrity": "sha512-Yb4QJOaGLIcmB0VY7Wif5AjvLMUFAdV57D2TWEva1Y0kU/3LjKpeRVmlMIfuO1SVbauve459kgtIizADqxMWPg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "lodash": "^4.17.15" + } + }, "modify-values": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", @@ -36148,6 +36300,12 @@ "resolved": "https://registry.npmjs.org/x256/-/x256-0.0.2.tgz", "integrity": "sha512-ZsIH+sheoF8YG9YG+QKEEIdtqpHRA9FYuD7MqhfyB1kayXU43RUNBFSxBEnF8ywSUxdg+8no4+bPr5qLbyxKgA==" }, + "xml": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", + "integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==", + "dev": true + }, "xml2js": { "version": "0.4.23", "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", diff --git a/package.json b/package.json index b99cc1fd34..6854f4e21b 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/packages/relay/.mocharc.js b/packages/relay/.mocharc.js new file mode 100644 index 0000000000..dc0bbe9315 --- /dev/null +++ b/packages/relay/.mocharc.js @@ -0,0 +1,14 @@ +'use strict'; +module.exports = { + 'forbid-only': Boolean(process.env.CI), + color: true, + 'fail-zero': Boolean(process.env.CI), + reporter: "mocha-multi-reporters", + 'reporter-options': "configFile=.mocharc.js", + 'reporterEnabled': "spec, mocha-junit-reporter", + "mochaJunitReporterReporterOptions": { + "mochaFile": "test-results.[hash].xml", + "includePending": true, + "outputs": true + }, +};