diff --git a/.github/workflows/flow-build-application.yaml b/.github/workflows/flow-build-application.yaml index dc92c1208..9efd91318 100644 --- a/.github/workflows/flow-build-application.yaml +++ b/.github/workflows/flow-build-application.yaml @@ -64,6 +64,19 @@ jobs: with: custom-job-label: Standard + e2e-integration-tests: + name: E2E Tests + if: ${{ github.event_name == 'push' || github.event.inputs.enable-e2e-tests == 'true' }} + uses: ./.github/workflows/zxc-e2e-test.yaml + needs: + - env-vars + - code-style + with: + custom-job-label: Integration + npm-test-script: test-${{ needs.env-vars.outputs.e2e-integration-test-subdir }} + coverage-subdirectory: ${{ needs.env-vars.outputs.e2e-integration-test-subdir }} + coverage-report-name: ${{ needs.env-vars.outputs.e2e-integration-coverage-report }} + e2e-standard-tests: name: E2E Tests if: ${{ github.event_name == 'push' || github.event.inputs.enable-e2e-tests == 'true' }} @@ -226,6 +239,7 @@ jobs: needs: - env-vars - unit-tests + - e2e-integration-tests - e2e-standard-tests - e2e-mirror-node-tests - e2e-node-pem-stop-tests @@ -245,6 +259,7 @@ jobs: enable-codecov-analysis: true enable-codacy-coverage: true enable-e2e-coverage-report: ${{ github.event_name == 'push' || github.event.inputs.enable-e2e-tests == 'true' }} + e2e-integration-test-subdir: ${{ needs.env-vars.outputs.e2e-integration-test-subdir }} e2e-standard-test-subdir: ${{ needs.env-vars.outputs.e2e-standard-test-subdir }} e2e-mirror-node-test-subdir: ${{ needs.env-vars.outputs.e2e-mirror-node-test-subdir }} e2e-node-pem-stop-test-subdir: ${{ needs.env-vars.outputs.e2e-node-pem-stop-test-subdir }} @@ -257,6 +272,7 @@ jobs: e2e-node-delete-separate-commands-test-subdir: ${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-test-subdir }} e2e-node-upgrade-test-subdir: ${{ needs.env-vars.outputs.e2e-node-upgrade-test-subdir }} e2e-relay-test-subdir: ${{ needs.env-vars.outputs.e2e-relay-test-subdir }} + e2e-integration-coverage-report: ${{ needs.env-vars.outputs.e2e-integration-coverage-report }} e2e-standard-coverage-report: ${{ needs.env-vars.outputs.e2e-standard-coverage-report }} e2e-mirror-node-coverage-report: ${{ needs.env-vars.outputs.e2e-mirror-node-coverage-report }} e2e-node-pem-stop-coverage-report: ${{ needs.env-vars.outputs.e2e-node-pem-stop-coverage-report }} diff --git a/.github/workflows/flow-pull-request-checks.yaml b/.github/workflows/flow-pull-request-checks.yaml index 8d9da4266..18fa322de 100644 --- a/.github/workflows/flow-pull-request-checks.yaml +++ b/.github/workflows/flow-pull-request-checks.yaml @@ -62,6 +62,19 @@ jobs: GH_ACCESS_GPG_KEY: ${{ secrets.GH_ACCESS_GPG_KEY }} GH_ACCESS_PASSPHRASE: ${{ secrets.GH_ACCESS_PASSPHRASE }} + e2e-integration-tests: + name: E2E Tests + if: ${{ !cancelled() && always() }} + uses: ./.github/workflows/zxc-e2e-test.yaml + needs: + - env-vars + - code-style + with: + custom-job-label: Integration + npm-test-script: test-${{ needs.env-vars.outputs.e2e-integration-test-subdir }} + coverage-subdirectory: ${{ needs.env-vars.outputs.e2e-integration-test-subdir }} + coverage-report-name: ${{ needs.env-vars.outputs.e2e-integration-coverage-report }} + e2e-standard-tests: name: E2E Tests if: ${{ !cancelled() && always() }} @@ -224,6 +237,7 @@ jobs: needs: - env-vars - unit-tests + - e2e-integration-tests - e2e-standard-tests - e2e-mirror-node-tests - e2e-node-pem-stop-tests @@ -241,6 +255,7 @@ jobs: custom-job-label: Standard enable-codecov-analysis: true enable-e2e-coverage-report: true + e2e-integration-test-subdir: ${{ needs.env-vars.outputs.e2e-integration-test-subdir }} e2e-standard-test-subdir: ${{ needs.env-vars.outputs.e2e-standard-test-subdir }} e2e-mirror-node-test-subdir: ${{ needs.env-vars.outputs.e2e-mirror-node-test-subdir }} e2e-node-pem-stop-test-subdir: ${{ needs.env-vars.outputs.e2e-node-pem-stop-test-subdir }} @@ -253,6 +268,7 @@ jobs: e2e-node-delete-separate-commands-test-subdir: ${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-test-subdir }} e2e-node-upgrade-test-subdir: ${{ needs.env-vars.outputs.e2e-node-upgrade-test-subdir }} e2e-relay-test-subdir: ${{ needs.env-vars.outputs.e2e-relay-test-subdir }} + e2e-integration-coverage-report: ${{ needs.env-vars.outputs.e2e-integration-coverage-report }} e2e-standard-coverage-report: ${{ needs.env-vars.outputs.e2e-standard-coverage-report }} e2e-mirror-node-coverage-report: ${{ needs.env-vars.outputs.e2e-mirror-node-coverage-report }} e2e-node-pem-stop-coverage-report: ${{ needs.env-vars.outputs.e2e-node-pem-stop-coverage-report }} @@ -274,6 +290,7 @@ jobs: needs: - env-vars - unit-tests + - e2e-integration-tests - e2e-standard-tests - e2e-mirror-node-tests - e2e-node-pem-stop-tests @@ -291,6 +308,7 @@ jobs: custom-job-label: Coverage enable-codacy-coverage: true enable-e2e-coverage-report: true + e2e-integration-test-subdir: ${{ needs.env-vars.outputs.e2e-integration-test-subdir }} e2e-standard-test-subdir: ${{ needs.env-vars.outputs.e2e-standard-test-subdir }} e2e-mirror-node-test-subdir: ${{ needs.env-vars.outputs.e2e-mirror-node-test-subdir }} e2e-node-pem-stop-test-subdir: ${{ needs.env-vars.outputs.e2e-node-pem-stop-test-subdir }} @@ -303,6 +321,7 @@ jobs: e2e-node-delete-separate-commands-test-subdir: ${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-test-subdir }} e2e-node-upgrade-test-subdir: ${{ needs.env-vars.outputs.e2e-node-upgrade-test-subdir }} e2e-relay-test-subdir: ${{ needs.env-vars.outputs.e2e-relay-test-subdir }} + e2e-integration-coverage-report: ${{ needs.env-vars.outputs.e2e-integration-coverage-report }} e2e-standard-coverage-report: ${{ needs.env-vars.outputs.e2e-standard-coverage-report }} e2e-mirror-node-coverage-report: ${{ needs.env-vars.outputs.e2e-mirror-node-coverage-report }} e2e-node-pem-stop-coverage-report: ${{ needs.env-vars.outputs.e2e-node-pem-stop-coverage-report }} diff --git a/.github/workflows/templates/config.yaml b/.github/workflows/templates/config.yaml index 0822c7838..3798a0e90 100644 --- a/.github/workflows/templates/config.yaml +++ b/.github/workflows/templates/config.yaml @@ -3,6 +3,9 @@ downloadArtifactActionComment: v4.1.8 tests: # name: capitalized noun form # testFilePrefix: node-update # for node-update.test.mjs + - name: Integration + mochaPostfix: "--grep '.*\\/e2e\\/integration\\/.*'" + - name: Standard mochaPostfix: "'test/e2e/**/*.mjs' --ignore 'test/unit/**/*.mjs' --ignore 'test/e2e/commands/mirror_node*.mjs' --ignore 'test/e2e/commands/node*.mjs' --ignore 'test/e2e/commands/separate_node*.mjs' --ignore 'test/e2e/commands/relay*.mjs'" timeout: 30000 diff --git a/.github/workflows/templates/template.zxc-code-analysis.yaml b/.github/workflows/templates/template.zxc-code-analysis.yaml index 4d195daae..95d5dc9c5 100644 --- a/.github/workflows/templates/template.zxc-code-analysis.yaml +++ b/.github/workflows/templates/template.zxc-code-analysis.yaml @@ -183,7 +183,7 @@ jobs: echo "::endgroup::" - name: Publish Snyk Reports - uses: actions/upload-artifact@84480863f228bb9747b473957fcc9e309aa96097 # v4.4.2 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 if: ${{ inputs.enable-snyk-scan && !cancelled() && !failure() }} with: name: Snyk Reports diff --git a/.github/workflows/zxc-code-analysis.yaml b/.github/workflows/zxc-code-analysis.yaml index 3809bfe51..46ef450ef 100644 --- a/.github/workflows/zxc-code-analysis.yaml +++ b/.github/workflows/zxc-code-analysis.yaml @@ -55,6 +55,11 @@ on: type: string required: false default: "Analyze" + e2e-integration-test-subdir: + description: "E2E Integration Test Subdirectory:" + type: string + required: false + default: "e2e-integration" e2e-standard-test-subdir: description: "E2E Standard Test Subdirectory:" type: string @@ -115,6 +120,11 @@ on: type: string required: false default: "e2e-relay" + e2e-integration-coverage-report: + description: "E2E Integration Coverage Report:" + type: string + required: false + default: "E2E Integration Tests Coverage Report" e2e-standard-coverage-report: description: "E2E Standard Coverage Report:" type: string @@ -225,6 +235,13 @@ jobs: name: Unit Test Coverage Report path: 'coverage/unit' + - name: Download E2E Integration Coverage Report + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + if: ${{ (inputs.enable-codecov-analysis || inputs.enable-codacy-coverage) && inputs.enable-e2e-coverage-report && !cancelled() && !failure() }} + with: + name: ${{ inputs.e2e-integration-coverage-report }} + path: 'coverage/${{ inputs.e2e-integration-test-subdir }}' + - name: Download E2E Standard Coverage Report uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 if: ${{ (inputs.enable-codecov-analysis || inputs.enable-codacy-coverage) && inputs.enable-e2e-coverage-report && !cancelled() && !failure() }} diff --git a/.github/workflows/zxc-env-vars.yaml b/.github/workflows/zxc-env-vars.yaml index 460fe32eb..bc6a6a138 100644 --- a/.github/workflows/zxc-env-vars.yaml +++ b/.github/workflows/zxc-env-vars.yaml @@ -26,6 +26,9 @@ on: required: false default: "Set Environment Variables" outputs: + e2e-integration-test-subdir: + description: "E2E Integration Test Subdirectory" + value: ${{ jobs.env-vars.outputs.e2e_integration_test_subdir }} e2e-standard-test-subdir: description: "E2E Standard Test Subdirectory" value: ${{ jobs.env-vars.outputs.e2e_standard_test_subdir }} @@ -62,6 +65,9 @@ on: e2e-relay-test-subdir: description: "E2E Relay Test Subdirectory" value: ${{ jobs.env-vars.outputs.e2e_relay_test_subdir }} + e2e-integration-coverage-report: + description: "E2E Integration Tests Coverage Report" + value: ${{ jobs.env-vars.outputs.e2e_integration_coverage_report }} e2e-standard-coverage-report: description: "E2E Standard Tests Coverage Report" value: ${{ jobs.env-vars.outputs.e2e_standard_coverage_report }} @@ -108,6 +114,7 @@ jobs: name: ${{ inputs.custom-job-label || 'Set Environment Variables' }} runs-on: solo-linux-medium outputs: + e2e_integration_test_subdir: e2e-integration e2e_standard_test_subdir: e2e-standard e2e_mirror_node_test_subdir: e2e-mirror-node e2e_node_pem_stop_test_subdir: e2e-node-pem-stop @@ -120,6 +127,7 @@ jobs: e2e_node_delete_separate_commands_test_subdir: e2e-node-delete-separate-commands e2e_node_upgrade_test_subdir: e2e-node-upgrade e2e_relay_test_subdir: e2e-relay + e2e_integration_coverage_report: "E2E Integration Tests Coverage Report" e2e_standard_coverage_report: "E2E Standard Tests Coverage Report" e2e_mirror_node_coverage_report: "E2E Mirror Node Tests Coverage Report" e2e_node_pem_stop_coverage_report: "E2E Node PEM Stop Tests Coverage Report" diff --git a/package.json b/package.json index c1b821251..42294fefb 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,9 @@ "access": "public" }, "scripts": { - "test": "cross-env NODE_OPTIONS=--experimental-vm-modules MOCHA_SUITE_NAME=\"Unit Tests\" c8 --reporter=lcov --reporter=text --reporter=html --report-dir='coverage/unit' mocha --verbose --recursive --file 'test/setup.mjs' 'test/unit/**/*.mjs' --exit --reporter mocha-junit-reporter --reporter-options mochaFile=junit.xml --check-leaks --timeout 20000", - "test-e2e-all": "cross-env NODE_OPTIONS=--experimental-vm-modules MOCHA_SUITE_NAME=\"Mocha E2E All Tests\" c8 --reporter=lcov --reporter=text --reporter=html --report-dir='coverage/e2e-all' mocha --verbose --recursive --file 'test/setup.mjs' 'test/e2e/**/*.mjs' --exit --reporter mocha-junit-reporter --reporter-options mochaFile=junit-e2e-all.xml --check-leaks --timeout 20000", + "test": "cross-env NODE_OPTIONS=--experimental-vm-modules MOCHA_SUITE_NAME=\"Unit Tests\" c8 --reporter=text --reporter=html --report-dir='coverage/unit' mocha --recursive --file 'test/setup.mjs' 'test/unit/**/*.mjs' --exit --reporter mocha-junit-reporter --reporter-options mochaFile=junit.xml --check-leaks --timeout 20000", + "test-e2e-all": "cross-env NODE_OPTIONS=--experimental-vm-modules MOCHA_SUITE_NAME=\"Mocha E2E All Tests\" nyc --reporter=text --reporter=html --report-dir='coverage/e2e-all' mocha --recursive --file 'test/setup.mjs' 'test/e2e/**/*.mjs' --exit --reporter mocha-junit-reporter --reporter-options mochaFile=junit-e2e-all.xml --check-leaks --timeout 20000", + "test-e2e-integration": "cross-env NODE_OPTIONS=--experimental-vm-modules MOCHA_SUITE_NAME=\"Mocha E2E Integration Tests\" c8 --reporter=clover --reporter=lcov --reporter=text --report-dir='coverage/e2e-integration' mocha --verbose --recursive --file 'test/setup.mjs' --grep '.*\/e2e\/integration\/.*' --exit --reporter mocha-junit-reporter --reporter-options mochaFile=junit-e2e-integration.xml --check-leaks --timeout 20000", "test-e2e-standard": "cross-env NODE_OPTIONS=--experimental-vm-modules MOCHA_SUITE_NAME=\"Mocha E2E Standard Tests\" c8 --reporter=clover --reporter=lcov --reporter=text --report-dir='coverage/e2e-standard' mocha --verbose --recursive --file 'test/setup.mjs' 'test/e2e/**/*.mjs' --ignore 'test/unit/**/*.mjs' --ignore 'test/e2e/commands/mirror_node*.mjs' --ignore 'test/e2e/commands/node*.mjs' --ignore 'test/e2e/commands/separate_node*.mjs' --ignore 'test/e2e/commands/relay*.mjs' --exit --reporter mocha-junit-reporter --reporter-options mochaFile=junit-e2e-standard.xml --check-leaks --timeout 30000", "test-e2e-mirror-node": "cross-env NODE_OPTIONS=--experimental-vm-modules MOCHA_SUITE_NAME=\"Mocha E2E Mirror Node Tests\" c8 --reporter=clover --reporter=lcov --reporter=text --report-dir='coverage/e2e-mirror-node' mocha --verbose --recursive --file 'test/setup.mjs' 'test/e2e/commands/mirror_node.test.mjs' --exit --reporter mocha-junit-reporter --reporter-options mochaFile=junit-e2e-mirror-node.xml --check-leaks --timeout 20000", "test-e2e-node-pem-stop": "cross-env NODE_OPTIONS=--experimental-vm-modules MOCHA_SUITE_NAME=\"Mocha E2E Node PEM Stop Tests\" c8 --reporter=clover --reporter=lcov --reporter=text --report-dir='coverage/e2e-node-pem-stop' mocha --verbose --recursive --file 'test/setup.mjs' 'test/e2e/commands/node_pem_stop.test.mjs' --exit --reporter mocha-junit-reporter --reporter-options mochaFile=junit-e2e-node-pem-stop.xml --check-leaks --timeout 20000", diff --git a/test/e2e/core/account_manager.test.mjs b/test/e2e/integration/core/account_manager.test.mjs similarity index 94% rename from test/e2e/core/account_manager.test.mjs rename to test/e2e/integration/core/account_manager.test.mjs index 098c61fba..55b94627c 100644 --- a/test/e2e/core/account_manager.test.mjs +++ b/test/e2e/integration/core/account_manager.test.mjs @@ -17,10 +17,10 @@ import { it, describe, after } from 'mocha' import { expect } from 'chai' -import { flags } from '../../../src/commands/index.mjs' -import { bootstrapNetwork, getDefaultArgv, TEST_CLUSTER } from '../../test_util.js' -import * as version from '../../../version.mjs' -import { MINUTES } from '../../../src/core/constants.mjs' +import { flags } from '../../../../src/commands/index.mjs' +import { bootstrapNetwork, getDefaultArgv, TEST_CLUSTER } from '../../../test_util.js' +import * as version from '../../../../version.mjs' +import { MINUTES } from '../../../../src/core/constants.mjs' describe('AccountManager', async () => { const namespace = 'account-mngr-e2e' diff --git a/test/e2e/core/chart_manager.test.mjs b/test/e2e/integration/core/chart_manager.test.mjs similarity index 92% rename from test/e2e/core/chart_manager.test.mjs rename to test/e2e/integration/core/chart_manager.test.mjs index c12964ecc..c0a4bd51b 100644 --- a/test/e2e/core/chart_manager.test.mjs +++ b/test/e2e/integration/core/chart_manager.test.mjs @@ -17,8 +17,8 @@ import { it, describe } from 'mocha' import { expect } from 'chai' -import { ChartManager, Helm, constants } from '../../../src/core/index.mjs' -import { testLogger } from '../../test_util.js' +import { ChartManager, Helm, constants } from '../../../../src/core/index.mjs' +import { testLogger } from '../../../test_util.js' describe('ChartManager', () => { const helm = new Helm(testLogger) diff --git a/test/e2e/core/dependency_managers/keytool_dependency_manager.test.mjs b/test/e2e/integration/core/dependency_managers/keytool_dependency_manager.test.mjs similarity index 87% rename from test/e2e/core/dependency_managers/keytool_dependency_manager.test.mjs rename to test/e2e/integration/core/dependency_managers/keytool_dependency_manager.test.mjs index 25585577e..d6e4e2de7 100644 --- a/test/e2e/core/dependency_managers/keytool_dependency_manager.test.mjs +++ b/test/e2e/integration/core/dependency_managers/keytool_dependency_manager.test.mjs @@ -19,11 +19,11 @@ import { expect } from 'chai' import fs from 'fs' import path from 'path' -import { KeytoolDependencyManager } from '../../../../src/core/dependency_managers/index.mjs' -import { PackageDownloader, Zippy } from '../../../../src/core/index.mjs' -import { getTestCacheDir, testLogger } from '../../../test_util.js' +import { KeytoolDependencyManager } from '../../../../../src/core/dependency_managers/index.mjs' +import { PackageDownloader, Zippy } from '../../../../../src/core/index.mjs' +import { getTestCacheDir, testLogger } from '../../../../test_util.js' import os from 'os' -import { MINUTES } from '../../../../src/core/constants.mjs' +import { MINUTES } from '../../../../../src/core/constants.mjs' describe('KeytoolDependencyManager', () => { const downloader = new PackageDownloader(testLogger) diff --git a/test/e2e/core/k8_e2e.test.mjs b/test/e2e/integration/core/k8_e2e.test.mjs similarity index 97% rename from test/e2e/core/k8_e2e.test.mjs rename to test/e2e/integration/core/k8_e2e.test.mjs index 411c4ce26..8b0468817 100644 --- a/test/e2e/core/k8_e2e.test.mjs +++ b/test/e2e/integration/core/k8_e2e.test.mjs @@ -22,10 +22,10 @@ import net from 'net' import os from 'os' import path from 'path' import { v4 as uuid4 } from 'uuid' -import { SoloError } from '../../../src/core/errors.mjs' -import { ConfigManager, constants, logging, Templates } from '../../../src/core/index.mjs' -import { K8 } from '../../../src/core/k8.mjs' -import { flags } from '../../../src/commands/index.mjs' +import { SoloError } from '../../../../src/core/errors.mjs' +import { ConfigManager, constants, logging, Templates } from '../../../../src/core/index.mjs' +import { K8 } from '../../../../src/core/k8.mjs' +import { flags } from '../../../../src/commands/index.mjs' import { V1Container, V1ExecAction, @@ -41,7 +41,7 @@ import { V1VolumeResourceRequirements } from '@kubernetes/client-node' import crypto from 'crypto' -import { MINUTES } from '../../../src/core/constants.mjs' +import { MINUTES } from '../../../../src/core/constants.mjs' const defaultTimeout = 2 * MINUTES diff --git a/test/e2e/core/package_downloader_e2e.test.mjs b/test/e2e/integration/core/package_downloader_e2e.test.mjs similarity index 94% rename from test/e2e/core/package_downloader_e2e.test.mjs rename to test/e2e/integration/core/package_downloader_e2e.test.mjs index 888b097f1..6c76015b3 100644 --- a/test/e2e/core/package_downloader_e2e.test.mjs +++ b/test/e2e/integration/core/package_downloader_e2e.test.mjs @@ -18,8 +18,8 @@ import { it, describe } from 'mocha' import { expect } from 'chai' import * as fs from 'fs' -import { logging, PackageDownloader, Templates } from '../../../src/core/index.mjs' -import { MINUTES } from '../../../src/core/constants.mjs' +import { logging, PackageDownloader, Templates } from '../../../../src/core/index.mjs' +import { MINUTES } from '../../../../src/core/constants.mjs' describe('PackageDownloaderE2E', () => { const testLogger = logging.NewLogger('debug', true) diff --git a/test/e2e/core/platform_installer_e2e.test.mjs b/test/e2e/integration/core/platform_installer_e2e.test.mjs similarity index 92% rename from test/e2e/core/platform_installer_e2e.test.mjs rename to test/e2e/integration/core/platform_installer_e2e.test.mjs index 782c67c2d..07ddc7afb 100644 --- a/test/e2e/core/platform_installer_e2e.test.mjs +++ b/test/e2e/integration/core/platform_installer_e2e.test.mjs @@ -17,7 +17,7 @@ import { it, describe, after, before } from 'mocha' import { expect } from 'chai' -import { constants } from '../../../src/core/index.mjs' +import { constants } from '../../../../src/core/index.mjs' import * as fs from 'fs' import { @@ -26,10 +26,10 @@ import { getTestCacheDir, TEST_CLUSTER, testLogger -} from '../../test_util.js' -import { flags } from '../../../src/commands/index.mjs' -import * as version from '../../../version.mjs' -import { MINUTES, SECONDS } from '../../../src/core/constants.mjs' +} from '../../../test_util.js' +import { flags } from '../../../../src/commands/index.mjs' +import * as version from '../../../../version.mjs' +import { MINUTES, SECONDS } from '../../../../src/core/constants.mjs' const defaultTimeout = 20 * SECONDS