diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000..8684a3107 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,48 @@ +################################### +##### Global Protection Rule ###### +################################### +# NOTE: This rule is overriden by the more specific rules below. This is the catch-all rule for all files not covered by the more specific rules below. +* @hashgraph/release-engineering @hashgraph/release-engineering-managers + +############################ +##### Project Files ###### +############################ + +/src/** @hashgraph/release-engineering @leninmehedy +/test/** @hashgraph/release-engineering @leninmehedy +/resources/** @hashgraph/release-engineering @leninmehedy + +######################### +##### Core Files ###### +######################### + +# NOTE: Must be placed last to ensure enforcement over all other rules + +# Protection Rules for Github Configuration Files and Actions Workflows +/.github/ @hashgraph/release-engineering-managers + +# NodeJS project files +package.json @hashgraph/release-engineering-managers +package-lock.json @hashgraph/release-engineering-managers +jest.config.mjs @hashgraph/release-engineering-managers + +# Codacy Tool Configurations +/config/ @hashgraph/release-engineering-managers +.remarkrc @hashgraph/release-engineering-managers + +# Semantic Release Configuration +.releaserc @hashgraph/release-engineering-managers + +# Self-protection for root CODEOWNERS files (this file should not exist and should definitely require approval) +/CODEOWNERS @hashgraph/release-engineering-managers + +# Protect the repository root files +/README.md @hashgraph/release-engineering @hashgraph/release-engineering-managers +**/LICENSE @hashgraph/release-engineering @hashgraph/release-engineering-managers + +# CodeCov configuration +**/codecov.yml @hashgraph/release-engineering @hashgraph/release-engineering-managers + +# Git Ignore definitions +**/.gitignore @hashgraph/release-engineering @hashgraph/release-engineering-managers +**/.gitignore.* @hashgraph/release-engineering @hashgraph/release-engineering-managers diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0a241998c..907768bb1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,5 +3,10 @@ updates: - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "weekly" + interval: "daily" open-pull-requests-limit: 5 + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + open-pull-requests-limit: 15 diff --git a/.github/workflows/flow-build-application.yaml b/.github/workflows/flow-build-application.yaml new file mode 100644 index 000000000..837bd621d --- /dev/null +++ b/.github/workflows/flow-build-application.yaml @@ -0,0 +1,65 @@ +## +# Copyright (C) 2022-2023 Hedera Hashgraph, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## + +name: "Build Application" +on: + workflow_dispatch: + inputs: + enable-unit-tests: + description: "Unit Testing Enabled" + type: boolean + required: false + default: true + enable-e2e-tests: + description: "E2E Testing Enabled" + type: boolean + required: false + default: false + enable-snyk-scan: + description: "Snyk Scan Enabled" + type: boolean + required: false + default: false + push: + branches: + - main + - 'release/*' + +defaults: + run: + shell: bash + +jobs: + code: + name: Code + uses: ./.github/workflows/zxc-compile-code.yaml + with: + enable-unit-tests: ${{ github.event_name == 'push' || github.event.inputs.enable-unit-tests == 'true' }} + enable-e2e-tests: ${{ github.event_name == 'push' || github.event.inputs.enable-e2e-tests == 'true' }} + + analyze: + name: Analyze + uses: ./.github/workflows/zxc-code-analysis.yaml + needs: + - code + if: ${{ github.event_name == 'push' || github.event.inputs.enable-unit-tests == 'true' || github.event.inputs.enable-e2e-tests == 'true' }} + with: + custom-job-label: Source Code + enable-snyk-scan: ${{ github.event_name == 'push' || github.event.inputs.enable-snyk-scan == 'true' }} + enable-codecov-analysis: ${{ github.event_name == 'push' || github.event.inputs.enable-unit-tests == 'true' || github.event.inputs.enable-e2e-tests == 'true' }} + secrets: + snyk-token: ${{ secrets.SNYK_TOKEN }} + codecov-token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/flow-pull-request-checks.yaml b/.github/workflows/flow-pull-request-checks.yaml new file mode 100644 index 000000000..1d2ae0fc7 --- /dev/null +++ b/.github/workflows/flow-pull-request-checks.yaml @@ -0,0 +1,82 @@ +## +# Copyright (C) 2023-2024 Hedera Hashgraph, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## + +name: "PR Checks" +on: + workflow_dispatch: + pull_request: + types: + - opened + - reopened + - synchronize + +defaults: + run: + shell: bash + +concurrency: + group: pr-checks-${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + build: + name: Code + uses: ./.github/workflows/zxc-compile-code.yaml + + unit-tests: + name: Unit Tests + uses: ./.github/workflows/zxc-compile-code.yaml + needs: + - build + with: + custom-job-label: Standard + enable-unit-tests: true + + e2e-tests: + name: E2E Tests + uses: ./.github/workflows/zxc-compile-code.yaml + needs: + - build + if: false + with: + custom-job-label: Standard + enable-e2e-tests: true + + codecov: + name: CodeCov + uses: ./.github/workflows/zxc-code-analysis.yaml + needs: + - unit-tests + #- e2e-tests + if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name && github.actor != 'dependabot[bot]' }} + with: + custom-job-label: Standard + enable-codecov-analysis: true + secrets: + codecov-token: ${{ secrets.CODECOV_TOKEN }} + +# snyk: +# name: Snyk Scan +# uses: ./.github/workflows/zxc-code-analysis.yaml +# needs: +# - unit-tests +# - e2e-tests +# if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name && github.actor != 'dependabot[bot]' }} +# with: +# custom-job-label: Standard +# enable-snyk-scan: true +# secrets: +# snyk-token: ${{ secrets.SNYK_TOKEN }} diff --git a/.github/workflows/flow-pull-request-formatting.yaml b/.github/workflows/flow-pull-request-formatting.yaml new file mode 100644 index 000000000..5caebba92 --- /dev/null +++ b/.github/workflows/flow-pull-request-formatting.yaml @@ -0,0 +1,65 @@ +## +# Copyright (C) 2023 Hedera Hashgraph, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## + +name: "PR Formatting" +on: + workflow_dispatch: + pull_request_target: + types: + - opened + - reopened + - edited + - synchronize + +defaults: + run: + shell: bash + +permissions: + statuses: write + +concurrency: + group: pr-formatting-${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + title-check: + name: Title Check + runs-on: [self-hosted, Linux, medium, ephemeral] + steps: + - name: Check PR Title + uses: aslafy-z/conventional-pr-title-action@a0b851005a0f82ac983a56ead5a8111c0d8e044a # v3.2.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + code-formatting: + name: Code Formatting + runs-on: [self-hosted, Linux, medium, ephemeral] + steps: + - name: Checkout Code + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Setup Node + uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 + with: + node-version: ${{ inputs.node-version }} + cache: npm + + - name: Install Dependencies + run: npm ci + + - name: Check Formatting + run: npm run check diff --git a/.github/workflows/zxc-code-analysis.yaml b/.github/workflows/zxc-code-analysis.yaml new file mode 100644 index 000000000..a744c32e1 --- /dev/null +++ b/.github/workflows/zxc-code-analysis.yaml @@ -0,0 +1,153 @@ +## +# Copyright (C) 2023-2024 Hedera Hashgraph, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## + +name: "ZXC: Code Analysis" +# The purpose of this reusable workflow is to perform static code analysis and code coverage reporting. +# This reusable component is called by the following workflows: +# - .github/workflows/flow-pull-request-checks.yaml +# - .github/workflows/flow-build-application.yaml +# +# This workflow is only run if the pull request is coming from the original repository and not a fork. + +on: + workflow_call: + inputs: + enable-codecov-analysis: + description: "CodeCov Analysis Enabled" + type: boolean + required: false + default: false + enable-snyk-scan: + description: "Snyk Scan Enabled" + type: boolean + required: false + default: false + node-version: + description: "NodeJS Version:" + type: string + required: false + default: "20" + custom-job-label: + description: "Custom Job Label:" + type: string + required: false + default: "Analyze" + secrets: + snyk-token: + description: "The Snyk access token is used by Snyk to analyze the code for vulnerabilities " + required: false + codecov-token: + description: "The CodeCov access token is used by CodeCov.io to analyze the code coverage " + required: false + +defaults: + run: + shell: bash + +permissions: + contents: read + actions: read + pull-requests: write + checks: write + statuses: write + +jobs: + analyze: + name: ${{ inputs.custom-job-label || 'Analyze' }} + runs-on: [self-hosted, Linux, medium, ephemeral] + steps: + - name: Checkout Code + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + ref: ${{ github.event.workflow_run.head_branch }} + fetch-depth: ${{ inputs.enable-sonar-analysis && '0' || '' }} + + - name: Setup Node + uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 + with: + node-version: ${{ inputs.node-version }} + + - name: Download Coverage Reports + uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1 + if: ${{ (inputs.enable-codecov-analysis || inputs.enable-sonar-analysis) && !cancelled() && !failure() }} + with: + name: Coverage Reports + + - name: Publish To Codecov + uses: codecov/codecov-action@e0b68c6749509c5f83f984dd99a76a1c1a231044 # v4.0.1 + if: ${{ inputs.enable-codecov-analysis && !cancelled() && !failure() }} + env: + CODECOV_TOKEN: ${{ secrets.codecov-token }} + + - name: Setup Snyk + env: + SNYK_TOKEN: ${{ secrets.snyk-token }} + if: ${{ inputs.enable-snyk-scan && !cancelled() && !failure() }} + run: npm install -g snyk snyk-to-html @wcj/html-to-markdown-cli + + - name: Snyk Scan + id: snyk + env: + SNYK_TOKEN: ${{ secrets.snyk-token }} + if: ${{ inputs.enable-snyk-scan && !cancelled() && !failure() }} + run: snyk test --org=release-engineering-N6EoZVZn3jw4qNuVkiG5Qs --all-projects --severity-threshold=high --json-file-output=snyk-test.json + + - name: Snyk Code + id: snyk-code + env: + SNYK_TOKEN: ${{ secrets.snyk-token }} + if: ${{ inputs.enable-snyk-scan && !cancelled() && !failure() }} + run: snyk code test --org=release-engineering-N6EoZVZn3jw4qNuVkiG5Qs --severity-threshold=high --json-file-output=snyk-code.json + + - name: Publish Snyk Results + if: ${{ inputs.enable-snyk-scan && !cancelled() && !failure() }} + run: | + if [[ -f "snyk-test.json" && -n "$(cat snyk-test.json | tr -d '[:space:]')" ]]; then + snyk-to-html -i snyk-test.json -o snyk-test.html --summary + html-to-markdown snyk-test.html -o snyk + cat snyk/snyk-test.html.md >> $GITHUB_STEP_SUMMARY + fi + + - name: Publish Snyk Code Results + if: ${{ inputs.enable-snyk-scan && !cancelled() && !failure() }} + run: | + if [[ -f "snyk-code.json" && -n "$(cat snyk-code.json | tr -d '[:space:]')" ]]; then + snyk-to-html -i snyk-code.json -o snyk-code.html --summary + html-to-markdown snyk-code.html -o snyk + cat snyk/snyk-code.html.md >> $GITHUB_STEP_SUMMARY + fi + + - name: Check Snyk Files + if: ${{ always() }} + run: | + echo "::group::Snyk File List" + ls -lah snyk* || true + echo "::endgroup::" + echo "::group::Snyk Test Contents" + cat snyk-test.json || true + echo "::endgroup::" + echo "::group::Snyk Code Contents" + cat snyk-code.json || true + echo "::endgroup::" + + - name: Publish Snyk Reports + uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 + if: ${{ inputs.enable-snyk-scan && !cancelled() && !failure() }} + with: + name: Snyk Reports + path: | + snyk-*.html + snyk-*.json diff --git a/.github/workflows/zxc-compile-code.yaml b/.github/workflows/zxc-compile-code.yaml new file mode 100644 index 000000000..6f4397819 --- /dev/null +++ b/.github/workflows/zxc-compile-code.yaml @@ -0,0 +1,140 @@ +## +# Copyright (C) 2023-2024 Hedera Hashgraph, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## + +name: "ZXC: Compile Code" +# The purpose of this reusable workflow is to compile the code and run the unit tests on every PR and commit. +# This reusable component is called by the following workflows: +# - .github/workflows/flow-pull-request-checks.yaml +# - .github/workflows/flow-build-application.yaml + +on: + workflow_call: + inputs: + enable-unit-tests: + description: "Unit Testing Enabled" + type: boolean + required: false + default: false + enable-e2e-tests: + description: "E2E Testing Enabled" + type: boolean + required: false + default: false + node-version: + description: "NodeJS Version:" + type: string + required: false + default: "20" + custom-job-label: + description: "Custom Job Label:" + type: string + required: false + default: "Compiles" + +defaults: + run: + shell: bash + +permissions: + id-token: write + contents: read + actions: read + pull-requests: write + checks: write + statuses: write + + +jobs: + compile: + name: ${{ inputs.custom-job-label || 'Compiles' }} + runs-on: [self-hosted, Linux, medium, ephemeral] + steps: + - name: Checkout Code + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Setup Node + uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 + with: + node-version: ${{ inputs.node-version }} + cache: npm + + - name: Setup Kind + uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0 + if: ${{ inputs.enable-e2e-tests && !cancelled() && !failure() }} + with: + install_only: true + node_image: kindest/node:v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72 + version: v0.21.0 + kubectl_version: v1.28.6 + verbosity: 3 + wait: 120s + + - name: Setup Helm + uses: azure/setup-helm@29960d0f5f19214b88e1d9ba750a9914ab0f1a2f # v4.0.0 + if: ${{ (inputs.enable-unit-tests || inputs.enable-e2e-tests) && !cancelled() && !failure() }} + with: + version: "v3.12.3" # helm version + + - name: Install Dependencies + id: npm-deps + run: npm ci + + - name: Run Unit Tests + if: ${{ inputs.enable-unit-tests && !cancelled() && !failure() }} + run: npm test + + - name: Publish Unit Test Report + uses: EnricoMi/publish-unit-test-result-action@8885e273a4343cd7b48eaa72428dea0c3067ea98 # v2.14.0 + if: ${{ inputs.enable-unit-tests && steps.npm-deps.conclusion == 'success' && !cancelled() }} + with: + check_name: 'Unit Test Results' + files: "junit.xml" + + - name: Pull Kind Docker Image + if: ${{ inputs.enable-e2e-tests && !cancelled() && !failure() }} + run: docker image pull kindest/node:v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72 + + - name: Setup E2E Tests + if: ${{ inputs.enable-e2e-tests && !cancelled() && !failure() }} + run: | + npm link + ./test/e2e/setup-e2e.sh + + - name: Run E2E Tests + if: ${{ inputs.enable-e2e-tests && !cancelled() && !failure() }} + run: | + npm run test-e2e + + - name: Publish E2E Test Report + uses: EnricoMi/publish-unit-test-result-action@8885e273a4343cd7b48eaa72428dea0c3067ea98 # v2.14.0 + if: ${{ inputs.enable-e2e-tests && steps.npm-deps.conclusion == 'success' && !cancelled() }} + with: + check_name: 'E2E Test Results' + files: "junit-e2e.xml" + + - name: Publish Coverage Report + uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 + if: ${{ (inputs.enable-unit-tests || inputs.enable-e2e-tests) && !cancelled() }} + with: + name: Coverage Reports + path: 'coverage' + + - name: Publish Test Reports + uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 + if: ${{ inputs.enable-unit-tests && steps.npm-deps.conclusion == 'success' && !cancelled() }} + with: + name: Test Reports + path: "junit*.xml" diff --git a/.gitignore b/.gitignore index 7e4c7f6c4..bdba911a4 100644 --- a/.gitignore +++ b/.gitignore @@ -510,9 +510,6 @@ secring.* **/src/main/resources/software/** .env *.run -dev/local-node/config.txt -dev/temp/.env -charts/deleteme.yaml +junit*.xml node_modules/ coverage/ -dev/resources/nmt/version.properties diff --git a/.releaserc b/.releaserc new file mode 100644 index 000000000..13a08401c --- /dev/null +++ b/.releaserc @@ -0,0 +1,62 @@ +{ + "plugins": [ + "@semantic-release/commit-analyzer", + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits" + } + ], + "@semantic-release/npm", + "@semantic-release/git", + "@semantic-release/github" + ], + "verifyRelease": [ + [ + "@semantic-release/exec", + { "cmd": "echo ${nextRelease.version} > VERSION" } + ] + ], + "prepare": [ + "@semantic-release/npm", + [ + "@semantic-release/git", + { + "assets": [ + "package.json", + "package-lock.json" + ] + } + ] + ], + "branches":[ + { + "name": "main" + }, + { + "name": "release/([0-9]+).([0-9]+)", + "channel": "${name.replace(/release\\//g, '').split('.')[0]}.${name.replace(/release\\//g, '').split('.')[1]}.x", + "range": "${name.replace(/release\\//g, '').split('.')[0]}.${name.replace(/release\\//g, '').split('.')[1]}.x" + }, + { + "name": "alpha/*", + "prerelease": "alpha", + "channel": "alpha" + }, + { + "name": "ci/*", + "prerelease": "alpha", + "channel": "alpha" + }, + { + "name": "beta/*", + "prerelease": "beta", + "channel": "beta" + }, + { + "name": "rc/*", + "prerelease": "rc", + "channel": "rc" + } + ] +} diff --git a/jest.config.mjs b/jest.config.mjs index ab20d9c9c..8048ff20e 100644 --- a/jest.config.mjs +++ b/jest.config.mjs @@ -17,7 +17,8 @@ const config = { testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(mjs?)$', moduleFileExtensions: ['js', 'mjs'], - verbose: true + verbose: true, + reporters: [ "default", "jest-junit" ] } export default config diff --git a/package-lock.json b/package-lock.json index c702f1268..782728f52 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,6 +44,7 @@ "eslint-plugin-n": "^16.3.1", "eslint-plugin-promise": "^6.1.1", "jest": "^29.7.0", + "jest-junit": "^16.0.0", "remark-cli": "^12.0.0", "remark-lint-list-item-indent": "^3.1.2", "remark-preset-lint-consistent": "^5.1.2", @@ -6562,6 +6563,30 @@ "fsevents": "^2.3.2" } }, + "node_modules/jest-junit": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/jest-junit/-/jest-junit-16.0.0.tgz", + "integrity": "sha512-A94mmw6NfJab4Fg/BlvVOUXzXgF0XIH6EmTgJ5NDPp4xoKq0Kr7sErb+4Xs9nZvu58pJojz5RFGpqnZYJTrRfQ==", + "dev": true, + "dependencies": { + "mkdirp": "^1.0.4", + "strip-ansi": "^6.0.1", + "uuid": "^8.3.2", + "xml": "^1.0.1" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/jest-junit/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/jest-leak-detector": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", @@ -13813,6 +13838,12 @@ } } }, + "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/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index 5a2061aba..cc5ebddd5 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "access": "public" }, "scripts": { - "test": "NODE_OPTIONS=--experimental-vm-modules jest --runInBand --detectOpenHandles --forceExit --testPathIgnorePatterns=\".*/e2e/.*\"", - "test-e2e": "NODE_OPTIONS=--experimental-vm-modules jest --runInBand --detectOpenHandles --forceExit --testPathIgnorePatterns=\\\".*/unit/.*\\\"", + "test": "NODE_OPTIONS=--experimental-vm-modules JEST_SUITE_NAME='Unit Tests' jest --runInBand --detectOpenHandles --forceExit --coverage --coverageDirectory='coverage/unit' --testPathIgnorePatterns=\".*/e2e/.*\"", + "test-e2e": "NODE_OPTIONS=--experimental-vm-modules JEST_SUITE_NAME='Jest E2E Tests' JEST_JUNIT_OUTPUT_NAME='junit-e2e.xml' jest --runInBand --detectOpenHandles --forceExit --coverage --coverageDirectory='coverage/e2e' --testPathIgnorePatterns=\\\".*/unit/.*\\\"", "solo": "NODE_OPTIONS=--experimental-vm-modules node solo.mjs", "check": "remark . --quiet --frail && eslint .", "format": "remark . --quiet --frail --output && eslint --fix ." @@ -53,6 +53,7 @@ "eslint-plugin-n": "^16.3.1", "eslint-plugin-promise": "^6.1.1", "jest": "^29.7.0", + "jest-junit": "^16.0.0", "remark-cli": "^12.0.0", "remark-lint-list-item-indent": "^3.1.2", "remark-preset-lint-consistent": "^5.1.2", diff --git a/test/data/s-private-node0.pem b/test/data/s-private-node0.pem new file mode 100644 index 000000000..2521f85c7 --- /dev/null +++ b/test/data/s-private-node0.pem @@ -0,0 +1,40 @@ +-----BEGIN PRIVATE KEY----- +MIIG/AIBADANBgkqhkiG9w0BAQEFAASCBuYwggbiAgEAAoIBgQCaFyWCsQAszvOy +UzSHXiSMTFeHw6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AUuY+w1P4eutso+gsWcx3H4r0y5ikKKcoGebXHXZjUvXzW39gcxo3 +qY4MRESXS8shJrvsHBpOwqPENOSL4RiR4vNodnJdnxuf5k95EQkk6PmtemYxUbvS +tK/+5zGLWKflPWAxQdodRZYbY9XU1rlz8k5148s0AzLMsCbT2MFBRJ3F4/2fC7rj +qF46awRdlR5URKcdbZQ7dQ== +-----END PRIVATE KEY----- diff --git a/test/data/s-public-node0.pem b/test/data/s-public-node0.pem new file mode 100644 index 000000000..264dd84a5 --- /dev/null +++ b/test/data/s-public-node0.pem @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIID1TCCAj2gAwIBAgIUIg/elSbgRpf1rdASIgXZrcFfsCYwDQYJKoZIhvcNAQEM +BQAwEjEQMA4GA1UEAwwHcy1ub2RlMDAgFw0yNDAxMzExMTU5MDNaGA8yMTI0MDEz +MTExNTkwM1owEjEQMA4GA1UEAwwHcy1ub2RlMDCCAaIwDQYJKoZIhvcNAQEBBQAD +ggGPADCCAYoCggGBAJoXJYKxACzO87JTNIdeJIxMV4fDpmS43X16WbBU16sKnUXS +gouOX9adnVkG6WJsZ4Jc9CKjFrCl76Y7q7h3HVPQLHYhwjfkQ2+XBgBb2MBXlPR6 +1uR6psJXgCXz7H45sPUlGSibCOEpXGgRdq5YGaVmFalQOWcnZsjU6XXdXjFFUZOO +8Cr6WR802LeWlGGr/8mjWfmNu29DbR6NVB1Dvb5AYg3rCU9QhyDeCchWqLOevTvR +q616IkrGLXcvbQOhtpqtckzRBHwfWZvgJbae4BYdDtzM1QI4cPHq+nN/OfXdhPDi +ihZ8mk6vq+BiPO6/sJYK/DNd+TD8bFF3Xmy6L22QJ3FE4T/TasVK9TcuJ4PP/o0t +HnNal3me89xakVst8KL09nzTrf7RcT8z1NPc4OSK14YBU3o4JLlJwkNt73iNGUiT +vSNV8WkuueYsrZULSiT7TCmhLhT7mnHGo28DMGfZ3yW3cXy4qGJwNjDQX+S8NSgt +JEpHCqHANoB7E3f5OQIDAQABoyEwHzAdBgNVHQ4EFgQUHLOUJ0xEvq/APhxN2adO +xvGx0oYwDQYJKoZIhvcNAQEMBQADggGBAEqFpZ9bTIYyUAaKlbgJTaPWmMenmOwx +R777HmPndxjcPa9bJM03DWNly/m4V0KPzExD+1EvZizjLggEOEhhveh3yzUd1x34 +SQIIrg6hNpIT8Gy7HkbliUptTfOAUnVp5jfpbkSJIzRH12OUhqsRIiZVf5mURayD +yJLSMRCLRddy3y79dyyjM2O/McLASmGboW7mgWN+eNll4YAZs8jNzMwCzsstAhrk +2T6fiQ17Prtft/yjPYgYN6vsXsi218KZ25aYjjrfm576DX+tAhEoSLl5zHJ3VvuO +etMOUg7t71ln5kHES2+mQ+cLjXtJA5wxG6HrCOeswCslInVqLfO0/jlNcj1SVF0z +ZFaxSlfeHIhutHBMOV0/IWEz5hTQSMdmecqT71x/xV29Otd58hVViYb7V8C1u6r6 +HtHXiw7QsErjRYkRkkxZhmZUOtaSc9gFxExEfQ+EVn+fltCSycGrk0WZjMj4bLIL +MHwrhrn4Mkm+bHkjPNAvnugfTT9kNAle8w== +-----END CERTIFICATE----- diff --git a/test/e2e/setup-e2e.sh b/test/e2e/setup-e2e.sh index 71a42fb1e..3cb9ec662 100755 --- a/test/e2e/setup-e2e.sh +++ b/test/e2e/setup-e2e.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash SOLO_CLUSTER_NAME=solo-e2e SOLO_NAMESPACE=solo-e2e SOLO_CLUSTER_SETUP_NAMESPACE=solo-e2e-cluster