Skip to content

Commit

Permalink
feat: add node delete and update command (#500)
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Tang <jeffrey@swirldslabs.com>
Signed-off-by: JeffreyDallas <39912573+JeffreyDallas@users.noreply.github.com>
Signed-off-by: Jeromy Cannon <jeromy@swirldslabs.com>
Co-authored-by: Jeromy Cannon <jeromy@swirldslabs.com>
  • Loading branch information
JeffreyDallas and jeromy-cannon authored Sep 3, 2024
1 parent fa3a316 commit 9f8549a
Show file tree
Hide file tree
Showing 16 changed files with 1,578 additions and 27 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/flow-build-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,30 @@ jobs:
coverage-subdirectory: ${{ needs.env-vars.outputs.e2e-node-add-test-subdir }}
coverage-report-name: ${{ needs.env-vars.outputs.e2e-node-add-coverage-report }}

e2e-node-update-tests:
name: E2E Tests
uses: ./.github/workflows/zxc-e2e-test.yaml
needs:
- env-vars
- code-style
with:
custom-job-label: Node Update
npm-test-script: test-${{ needs.env-vars.outputs.e2e-node-update-test-subdir }}
coverage-subdirectory: ${{ needs.env-vars.outputs.e2e-node-update-test-subdir }}
coverage-report-name: ${{ needs.env-vars.outputs.e2e-node-update-coverage-report }}

e2e-node-delete-tests:
name: E2E Tests
uses: ./.github/workflows/zxc-e2e-test.yaml
needs:
- env-vars
- code-style
with:
custom-job-label: Node Delete
npm-test-script: test-${{ needs.env-vars.outputs.e2e-node-delete-test-subdir }}
coverage-subdirectory: ${{ needs.env-vars.outputs.e2e-node-delete-test-subdir }}
coverage-report-name: ${{ needs.env-vars.outputs.e2e-node-delete-coverage-report }}

e2e-relay-tests:
name: E2E Tests
if: ${{ github.event_name == 'push' || github.event.inputs.enable-e2e-tests == 'true' }}
Expand All @@ -166,6 +190,8 @@ jobs:
- e2e-node-pfx-kill-tests
- e2e-node-local-build-tests
- e2e-node-add-tests
- e2e-node-update-tests
- e2e-node-delete-tests
- e2e-relay-tests
if: ${{ (github.event_name == 'push' || github.event.inputs.enable-unit-tests == 'true' || github.event.inputs.enable-e2e-tests == 'true') && !failure() && !cancelled() }}
with:
Expand All @@ -180,13 +206,17 @@ jobs:
e2e-node-pfx-kill-test-subdir: ${{ needs.env-vars.outputs.e2e-node-pfx-kill-test-subdir }}
e2e-node-local-build-test-subdir: ${{ needs.env-vars.outputs.e2e-node-local-build-test-subdir }}
e2e-node-add-test-subdir: ${{ needs.env-vars.outputs.e2e-node-add-test-subdir }}
e2e-node-update-test-subdir: ${{ needs.env-vars.outputs.e2e-node-update-test-subdir }}
e2e-node-delete-test-subdir: ${{ needs.env-vars.outputs.e2e-node-delete-test-subdir }}
e2e-relay-test-subdir: ${{ needs.env-vars.outputs.e2e-relay-test-subdir }}
e2e-coverage-report: ${{ needs.env-vars.outputs.e2e-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 }}
e2e-node-pfx-kill-coverage-report: ${{ needs.env-vars.outputs.e2e-node-pfx-kill-coverage-report }}
e2e-node-local-build-coverage-report: ${{ needs.env-vars.outputs.e2e-node-local-build-coverage-report }}
e2e-node-add-coverage-report: ${{ needs.env-vars.outputs.e2e-node-add-coverage-report }}
e2e-node-update-coverage-report: ${{ needs.env-vars.outputs.e2e-node-update-coverage-report }}
e2e-node-delete-coverage-report: ${{ needs.env-vars.outputs.e2e-node-delete-coverage-report }}
e2e-relay-coverage-report: ${{ needs.env-vars.outputs.e2e-relay-coverage-report }}
secrets:
snyk-token: ${{ secrets.SNYK_TOKEN }}
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/flow-pull-request-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,30 @@ jobs:
coverage-subdirectory: ${{ needs.env-vars.outputs.e2e-node-add-test-subdir }}
coverage-report-name: ${{ needs.env-vars.outputs.e2e-node-add-coverage-report }}

e2e-node-update-tests:
name: E2E Tests
uses: ./.github/workflows/zxc-e2e-test.yaml
needs:
- env-vars
- code-style
with:
custom-job-label: Node Update
npm-test-script: test-${{ needs.env-vars.outputs.e2e-node-update-test-subdir }}
coverage-subdirectory: ${{ needs.env-vars.outputs.e2e-node-update-test-subdir }}
coverage-report-name: ${{ needs.env-vars.outputs.e2e-node-update-coverage-report }}

e2e-node-delete-tests:
name: E2E Tests
uses: ./.github/workflows/zxc-e2e-test.yaml
needs:
- env-vars
- code-style
with:
custom-job-label: Node Delete
npm-test-script: test-${{ needs.env-vars.outputs.e2e-node-delete-test-subdir }}
coverage-subdirectory: ${{ needs.env-vars.outputs.e2e-node-delete-test-subdir }}
coverage-report-name: ${{ needs.env-vars.outputs.e2e-node-delete-coverage-report }}

e2e-relay-tests:
name: E2E Tests
if: ${{ !cancelled() && always() }}
Expand All @@ -151,6 +175,8 @@ jobs:
- e2e-node-pfx-kill-tests
- e2e-node-local-build-tests
- e2e-node-add-tests
- e2e-node-update-tests
- e2e-node-delete-tests
- e2e-relay-tests
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
with:
Expand All @@ -163,13 +189,17 @@ jobs:
e2e-node-pfx-kill-test-subdir: ${{ needs.env-vars.outputs.e2e-node-pfx-kill-test-subdir }}
e2e-node-local-build-test-subdir: ${{ needs.env-vars.outputs.e2e-node-local-build-test-subdir }}
e2e-node-add-test-subdir: ${{ needs.env-vars.outputs.e2e-node-add-test-subdir }}
e2e-node-update-test-subdir: ${{ needs.env-vars.outputs.e2e-node-update-test-subdir }}
e2e-node-delete-test-subdir: ${{ needs.env-vars.outputs.e2e-node-delete-test-subdir }}
e2e-relay-test-subdir: ${{ needs.env-vars.outputs.e2e-relay-test-subdir }}
e2e-coverage-report: ${{ needs.env-vars.outputs.e2e-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 }}
e2e-node-pfx-kill-coverage-report: ${{ needs.env-vars.outputs.e2e-node-pfx-kill-coverage-report }}
e2e-node-local-build-coverage-report: ${{ needs.env-vars.outputs.e2e-node-local-build-coverage-report }}
e2e-node-add-coverage-report: ${{ needs.env-vars.outputs.e2e-node-add-coverage-report }}
e2e-node-update-coverage-report: ${{ needs.env-vars.outputs.e2e-node-update-coverage-report }}
e2e-node-delete-coverage-report: ${{ needs.env-vars.outputs.e2e-node-delete-coverage-report }}
e2e-relay-coverage-report: ${{ needs.env-vars.outputs.e2e-relay-coverage-report }}
secrets:
codecov-token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -186,6 +216,8 @@ jobs:
- e2e-node-pfx-kill-tests
- e2e-node-local-build-tests
- e2e-node-add-tests
- e2e-node-update-tests
- e2e-node-delete-tests
- e2e-relay-tests
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
with:
Expand All @@ -198,13 +230,17 @@ jobs:
e2e-node-pfx-kill-test-subdir: ${{ needs.env-vars.outputs.e2e-node-pfx-kill-test-subdir }}
e2e-node-local-build-test-subdir: ${{ needs.env-vars.outputs.e2e-node-local-build-test-subdir }}
e2e-node-add-test-subdir: ${{ needs.env-vars.outputs.e2e-node-add-test-subdir }}
e2e-node-update-test-subdir: ${{ needs.env-vars.outputs.e2e-node-update-test-subdir }}
e2e-node-delete-test-subdir: ${{ needs.env-vars.outputs.e2e-node-delete-test-subdir }}
e2e-relay-test-subdir: ${{ needs.env-vars.outputs.e2e-relay-test-subdir }}
e2e-coverage-report: ${{ needs.env-vars.outputs.e2e-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 }}
e2e-node-pfx-kill-coverage-report: ${{ needs.env-vars.outputs.e2e-node-pfx-kill-coverage-report }}
e2e-node-local-build-coverage-report: ${{ needs.env-vars.outputs.e2e-node-local-build-coverage-report }}
e2e-node-add-coverage-report: ${{ needs.env-vars.outputs.e2e-node-add-coverage-report }}
e2e-node-update-coverage-report: ${{ needs.env-vars.outputs.e2e-node-update-coverage-report }}
e2e-node-delete-coverage-report: ${{ needs.env-vars.outputs.e2e-node-delete-coverage-report }}
e2e-relay-coverage-report: ${{ needs.env-vars.outputs.e2e-relay-coverage-report }}
secrets:
codacy-project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
Expand All @@ -221,6 +257,8 @@ jobs:
# - e2e-node-pfx-kill-tests
# - e2e-node-local-build-tests
# - e2e-node-add-tests
# - e2e-node-update-tests
# - e2e-node-delete-tests
# - e2e-relay-tests
# if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name && github.actor != 'dependabot[bot]' }}
# with:
Expand All @@ -232,13 +270,17 @@ jobs:
# e2e-node-pfx-kill-test-subdir: ${{ needs.env-vars.outputs.e2e-node-pfx-kill-test-subdir }}
# e2e-node-local-build-test-subdir: ${{ needs.env-vars.outputs.e2e-node-local-build-test-subdir }}
# e2e-node-add-test-subdir: ${{ needs.env-vars.outputs.e2e-node-add-test-subdir }}
# e2e-node-update-test-subdir: ${{ needs.env-vars.outputs.e2e-node-update-test-subdir }}
# e2e-node-delete-test-subdir: ${{ needs.env-vars.outputs.e2e-node-delete-test-subdir }}
# e2e-relay-test-subdir: ${{ needs.env-vars.outputs.e2e-relay-test-subdir }}
# e2e-coverage-report: ${{ needs.env-vars.outputs.e2e-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 }}
# e2e-node-pfx-kill-coverage-report: ${{ needs.env-vars.outputs.e2e-node-pfx-kill-coverage-report }}
# e2e-node-local-build-coverage-report: ${{ needs.env-vars.outputs.e2e-node-local-build-coverage-report }}
# e2e-node-add-coverage-report: ${{ needs.env-vars.outputs.e2e-node-add-coverage-report }}
# e2e-node-update-coverage-report: ${{ needs.env-vars.outputs.e2e-node-update-coverage-report }}
# e2e-node-delete-coverage-report: ${{ needs.env-vars.outputs.e2e-node-delete-coverage-report }}
# e2e-relay-coverage-report: ${{ needs.env-vars.outputs.e2e-relay-coverage-report }}
# secrets:
# snyk-token: ${{ secrets.SNYK_TOKEN }}
34 changes: 34 additions & 0 deletions .github/workflows/zxc-code-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ on:
type: string
required: false
default: "e2e-node-add"
e2e-node-update-test-subdir:
description: "E2E Node Update Test Subdirectory:"
type: string
required: false
default: "e2e-node-update"
e2e-node-delete-test-subdir:
description: "E2E Node Delete Test Subdirectory:"
type: string
required: false
default: "e2e-node-delete"
e2e-relay-test-subdir:
description: "E2E Relay Test Subdirectory:"
type: string
Expand Down Expand Up @@ -120,6 +130,16 @@ on:
type: string
required: false
default: "E2E Node Add Tests Coverage Report"
e2e-node-update-coverage-report:
description: "E2E Node Update Coverage Report:"
type: string
required: false
default: "E2E Node Update Tests Coverage Report"
e2e-node-delete-coverage-report:
description: "E2E Node Delete Coverage Report:"
type: string
required: false
default: "E2E Node Delete Tests Coverage Report"
e2e-relay-coverage-report:
description: "E2E Relay Coverage Report:"
type: string
Expand Down Expand Up @@ -224,6 +244,20 @@ jobs:
name: ${{ inputs.e2e-node-add-coverage-report }}
path: 'coverage/${{ inputs.e2e-node-add-test-subdir }}'

- name: Download E2E Update 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-node-udpate-coverage-report }}
path: 'coverage/${{ inputs.e2e-udpate-add-test-subdir }}'

- name: Download E2E Delete 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-node-delete-coverage-report }}
path: 'coverage/${{ inputs.e2e-node-delete-test-subdir }}'

- name: Publish To Codecov
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
if: ${{ inputs.enable-codecov-analysis && !cancelled() && !failure() }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zxc-e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ jobs:
if: ${{ runner.os == 'linux' && (inputs.npm-test-script == 'test-e2e-node-local-build' || inputs.npm-test-script == 'test-e2e-node-add') && !cancelled() && !failure() }}
run: |
cd ..
git clone https://github.com/hashgraph/hedera-services.git
git clone https://github.com/hashgraph/hedera-services.git --branch v0.53.2
cd hedera-services
ls -ltr
${{ env.CG_EXEC }} ./gradlew assemble --stacktrace --info
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/zxc-env-vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ on:
e2e-node-add-test-subdir:
description: "E2E Node Add Test Subdirectory"
value: ${{ jobs.env-vars.outputs.e2e_node_add_test_subdir }}
e2e-node-update-test-subdir:
description: "E2E Node Update Test Subdirectory"
value: ${{ jobs.env-vars.outputs.e2e_node_update_test_subdir }}
e2e-node-delete-test-subdir:
description: "E2E Node Delete Test Subdirectory"
value: ${{ jobs.env-vars.outputs.e2e_node_delete_test_subdir }}
e2e-relay-test-subdir:
description: "E2E Relay Test Subdirectory"
value: ${{ jobs.env-vars.outputs.e2e_relay_test_subdir }}
Expand All @@ -65,6 +71,12 @@ on:
e2e-node-add-coverage-report:
description: "E2E Node Add Tests Coverage Report"
value: ${{ jobs.env-vars.outputs.e2e_node_add_coverage_report }}
e2e-node-update-coverage-report:
description: "E2E Node Update Tests Coverage Report"
value: ${{ jobs.env-vars.outputs.e2e_node_update_coverage_report }}
e2e-node-delete-coverage-report:
description: "E2E Node Delete Tests Coverage Report"
value: ${{ jobs.env-vars.outputs.e2e_node_delete_coverage_report }}
e2e-relay-coverage-report:
description: "E2E Relay Tests Coverage Report"
value: ${{ jobs.env-vars.outputs.e2e_relay_coverage_report }}
Expand All @@ -84,13 +96,17 @@ jobs:
e2e_node_pfx_kill_test_subdir: e2e-node-pfx-kill
e2e_node_local_build_test_subdir: e2e-node-local-build
e2e_node_add_test_subdir: e2e-node-add
e2e_node_update_test_subdir: e2e-node-update
e2e_node_delete_test_subdir: e2e-node-delete
e2e_relay_test_subdir: e2e-relay
e2e_coverage_report: "E2E 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"
e2e_node_pfx_kill_coverage_report: "E2E Node PFX Kill Tests Coverage Report"
e2e_node_local_build_coverage_report: "E2E Node Local Build Tests Coverage Report"
e2e_node_add_coverage_report: "E2E Node Add Tests Coverage Report"
e2e_node_update_coverage_report: "E2E Node Update Tests Coverage Report"
e2e_node_delete_coverage_report: "E2E Node Delete Tests Coverage Report"
e2e_relay_coverage_report: "E2E Relay Tests Coverage Report"
steps:
- run: echo "Exposing environment variables to reusable workflows"
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"test-e2e-node-pem-stop": "NODE_OPTIONS=--experimental-vm-modules JEST_SUITE_NAME='Jest E2E Node PEM Stop Tests' JEST_JUNIT_OUTPUT_NAME='junit-e2e-node-pem-stop.xml' jest --runInBand --detectOpenHandles --forceExit --coverage --coverageDirectory='coverage/e2e-node-pem-stop' --testRegex=\".*\\/e2e\\/commands\\/node_pem_stop\\.test\\.mjs\"",
"test-e2e-node-pfx-kill": "NODE_OPTIONS=--experimental-vm-modules JEST_SUITE_NAME='Jest E2E Node PFX Kill Tests' JEST_JUNIT_OUTPUT_NAME='junit-e2e-node-pfx-kill.xml' jest --runInBand --detectOpenHandles --forceExit --coverage --coverageDirectory='coverage/e2e-node-pfx-kill' --testRegex=\".*\\/e2e\\/commands\\/node_pfx_kill\\.test\\.mjs\"",
"test-e2e-node-local-build": "NODE_OPTIONS=--experimental-vm-modules JEST_SUITE_NAME='Jest E2E Node Local Custom Build' JEST_JUNIT_OUTPUT_NAME='junit-e2e-node-local-build.xml' jest --runInBand --detectOpenHandles --forceExit --coverage --coverageDirectory='coverage/e2e-node-local-build' --testRegex=\".*\\/e2e\\/commands\\/node-local.*\\.test\\.mjs\"",
"test-e2e-node-add": "NODE_OPTIONS=--experimental-vm-modules JEST_SUITE_NAME='Jest E2E Node Add Custom Build' JEST_JUNIT_OUTPUT_NAME='junit-e2e-node-add.xml' jest --runInBand --detectOpenHandles --forceExit --coverage --coverageDirectory='coverage/e2e-node-add' --testRegex=\".*\\/e2e\\/commands\\/node-add.*\\.test\\.mjs\"",
"test-e2e-node-add": "NODE_OPTIONS=--experimental-vm-modules JEST_SUITE_NAME='Jest E2E Node Add' JEST_JUNIT_OUTPUT_NAME='junit-e2e-node-add.xml' jest --runInBand --detectOpenHandles --forceExit --coverage --coverageDirectory='coverage/e2e-node-add' --testRegex=\".*\\/e2e\\/commands\\/node-add.*\\.test\\.mjs\"",
"test-e2e-node-update": "NODE_OPTIONS=--experimental-vm-modules JEST_SUITE_NAME='Jest E2E Node Update' JEST_JUNIT_OUTPUT_NAME='junit-e2e-node-update.xml' jest --runInBand --detectOpenHandles --forceExit --coverage --coverageDirectory='coverage/e2e-node-update' --testRegex=\".*\\/e2e\\/commands\\/node-update.*\\.test\\.mjs\"",
"test-e2e-node-delete": "NODE_OPTIONS=--experimental-vm-modules JEST_SUITE_NAME='Jest E2E Node Delete' JEST_JUNIT_OUTPUT_NAME='junit-e2e-node-delete.xml' jest --runInBand --detectOpenHandles --forceExit --coverage --coverageDirectory='coverage/e2e-node-delete' --testRegex=\".*\\/e2e\\/commands\\/node-delete.*\\.test\\.mjs\"",
"test-e2e-relay": "NODE_OPTIONS=--experimental-vm-modules JEST_SUITE_NAME='Jest E2E Relay Tests' JEST_JUNIT_OUTPUT_NAME='junit-e2e-relay.xml' jest --runInBand --detectOpenHandles --forceExit --coverage --coverageDirectory='coverage/e2e-relay' --testRegex=\".*\\/e2e\\/commands\\/relay\\.test\\.mjs\"",
"merge-clean": "rm -rf .nyc_output && mkdir .nyc_output && rm -rf coverage/lcov-report && rm -rf coverage/solo && rm coverage/*.*",
"merge-e2e": "nyc merge ./coverage/e2e/ .nyc_output/coverage.json",
Expand Down
2 changes: 2 additions & 0 deletions resources/templates/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ nodes.gossipFqdnRestricted=false
hedera.profiles.active=TEST
# TODO: this is a workaround until prepareUpgrade freeze will recalculate the weight prior to writing the config.txt
staking.periodMins=1
nodes.updateAccountIdAllowed=true

Loading

0 comments on commit 9f8549a

Please sign in to comment.