Skip to content

Commit 40263d6

Browse files
committed
ci(satp-hermes): run other satp tests
including bridge and crash recovery tests Signed-off-by: Rafael Belchior <[email protected]>
1 parent 2f13148 commit 40263d6

File tree

4 files changed

+247
-2
lines changed

4 files changed

+247
-2
lines changed

.github/workflows/satp-hermes-test.yaml

Lines changed: 243 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,3 +564,246 @@ jobs:
564564
name: coverage-reports-satp-hermes-${{ github.job }}
565565
path: |
566566
packages/cactus-plugin-satp-hermes/code-coverage-ts/**/
567+
568+
run-satp-tests-on-chain:
569+
if: inputs.skip_tests != true
570+
runs-on: ubuntu-latest-16-cores
571+
continue-on-error: true
572+
env:
573+
FULL_BUILD_DISABLED: true
574+
JEST_TEST_RUNNER_DISABLED: false
575+
RUN_CODE_COVERAGE: "true"
576+
# SATP specific configuration
577+
SATP_ENABLE_CRASH_RECOVERY: false
578+
SATP_LOG_LEVEL: DEBUG
579+
SATP_ENABLE_LOCAL_REPOSITORY: true
580+
SATP_ENABLE_REMOTE_REPOSITORY: false
581+
582+
steps:
583+
- uses: actions/[email protected]
584+
- name: Use Node.js
585+
uses: actions/[email protected]
586+
with:
587+
node-version: v22.18.0
588+
589+
# Download build artifacts using reusable action
590+
- name: Download SATP build artifacts
591+
uses: ./.github/actions/satp-download-build-artifacts
592+
593+
# Download generated artifacts
594+
- name: Download generated artifacts
595+
uses: ./.github/actions/satp-download-generated-artifacts
596+
597+
- name: Install dependencies
598+
run: yarn install
599+
600+
- name: CI environment clean-up
601+
run: ./tools/ci-env-clean-up.sh
602+
603+
- name: Configure and build all packages
604+
run: yarn configure
605+
606+
- name: Install Foundry
607+
uses: foundry-rs/foundry-toolchain@v1
608+
with:
609+
version: stable
610+
611+
- name: Run Foundry tests
612+
run: |
613+
set -euo pipefail
614+
cd packages/cactus-plugin-satp-hermes
615+
echo "Running Foundry on-chain tests"
616+
yarn forge:all
617+
618+
- name: Upload SATP foundry test reports
619+
if: always()
620+
uses: actions/upload-artifact@v4
621+
with:
622+
name: satp-foundry-report-${{ github.job }}
623+
path: |
624+
packages/cactus-plugin-satp-hermes/src/test/solidity/generated/**/*
625+
packages/cactus-plugin-satp-hermes/src/main/solidity/generated/**/*
626+
627+
run-satp-tests-recovery:
628+
if: inputs.skip_tests != true
629+
runs-on: ubuntu-latest-16-cores
630+
continue-on-error: true
631+
env:
632+
FULL_BUILD_DISABLED: true
633+
JEST_TEST_RUNNER_DISABLED: false
634+
RUN_CODE_COVERAGE: "true"
635+
# SATP specific configuration
636+
SATP_ENABLE_CRASH_RECOVERY: true
637+
SATP_LOG_LEVEL: DEBUG
638+
SATP_ENABLE_LOCAL_REPOSITORY: true
639+
SATP_ENABLE_REMOTE_REPOSITORY: false
640+
641+
steps:
642+
- uses: actions/[email protected]
643+
- name: Use Node.js
644+
uses: actions/[email protected]
645+
with:
646+
node-version: v22.18.0
647+
648+
# Download build artifacts using reusable action
649+
- name: Download SATP build artifacts
650+
uses: ./.github/actions/satp-download-build-artifacts
651+
652+
# Download generated artifacts
653+
- name: Download generated artifacts
654+
uses: ./.github/actions/satp-download-generated-artifacts
655+
656+
- name: Install dependencies
657+
run: yarn install
658+
659+
- name: CI environment clean-up
660+
run: ./tools/ci-env-clean-up.sh
661+
662+
- name: Configure and build all packages
663+
run: yarn configure
664+
665+
- name: Run SATP recovery tests (with optional coverage)
666+
run: |
667+
set -euo pipefail
668+
if [ "${{ env.RUN_CODE_COVERAGE }}" = "true" ]; then
669+
echo "Running recovery tests with coverage"
670+
yarn workspace @hyperledger/cactus-plugin-satp-hermes test:integration:recovery --coverage --coverageDirectory=./code-coverage-ts/satp-hermes-recovery
671+
else
672+
echo "Running recovery tests without coverage"
673+
yarn workspace @hyperledger/cactus-plugin-satp-hermes test:integration:recovery
674+
fi
675+
676+
- name: Upload SATP recovery test report
677+
if: always()
678+
uses: actions/upload-artifact@v4
679+
with:
680+
name: satp-recovery-junit-report-${{ github.job }}
681+
path: packages/cactus-plugin-satp-hermes/reports/junit/satp-hermes-tests-recovery.xml
682+
683+
- name: Check for SATP recovery junit report
684+
id: check_recovery_junit
685+
run: |
686+
if [ -f packages/cactus-plugin-satp-hermes/reports/junit/satp-hermes-tests-recovery.xml ]; then
687+
echo "found=true" >> "$GITHUB_OUTPUT"
688+
else
689+
echo "found=false" >> "$GITHUB_OUTPUT"
690+
fi
691+
692+
- name: Report SATP recovery test results (annotate)
693+
if: always() && steps.check_recovery_junit.outputs.found == 'true'
694+
uses: dorny/[email protected]
695+
with:
696+
name: "SATP Recovery Tests"
697+
path: packages/cactus-plugin-satp-hermes/reports/junit/satp-hermes-tests-recovery.xml
698+
reporter: jest-junit
699+
list-tests: failed
700+
fail-on-error: false
701+
702+
- name: Check for SATP recovery coverage artifacts
703+
id: check_recovery_coverage
704+
run: |
705+
if [ -d packages/cactus-plugin-satp-hermes/code-coverage-ts ] || [ -f packages/cactus-plugin-satp-hermes/coverage/coverage-final.json ]; then
706+
echo "found=true" >> "$GITHUB_OUTPUT"
707+
else
708+
echo "found=false" >> "$GITHUB_OUTPUT"
709+
fi
710+
711+
- name: Upload SATP recovery coverage (if present)
712+
if: always() && steps.check_recovery_coverage.outputs.found == 'true'
713+
uses: actions/upload-artifact@v4
714+
with:
715+
name: coverage-reports-satp-hermes-${{ github.job }}
716+
path: |
717+
packages/cactus-plugin-satp-hermes/code-coverage-ts/**/
718+
719+
run-satp-tests-rollback:
720+
if: inputs.skip_tests != true
721+
runs-on: ubuntu-latest-16-cores
722+
continue-on-error: true
723+
env:
724+
FULL_BUILD_DISABLED: true
725+
JEST_TEST_RUNNER_DISABLED: false
726+
RUN_CODE_COVERAGE: "true"
727+
# SATP specific configuration
728+
SATP_ENABLE_CRASH_RECOVERY: true
729+
SATP_LOG_LEVEL: DEBUG
730+
SATP_ENABLE_LOCAL_REPOSITORY: true
731+
SATP_ENABLE_REMOTE_REPOSITORY: false
732+
733+
steps:
734+
- uses: actions/[email protected]
735+
- name: Use Node.js
736+
uses: actions/[email protected]
737+
with:
738+
node-version: v22.18.0
739+
740+
# Download build artifacts using reusable action
741+
- name: Download SATP build artifacts
742+
uses: ./.github/actions/satp-download-build-artifacts
743+
744+
# Download generated artifacts
745+
- name: Download generated artifacts
746+
uses: ./.github/actions/satp-download-generated-artifacts
747+
748+
- name: Install dependencies
749+
run: yarn install
750+
751+
- name: CI environment clean-up
752+
run: ./tools/ci-env-clean-up.sh
753+
754+
- name: Configure and build all packages
755+
run: yarn configure
756+
757+
- name: Run SATP rollback tests (with optional coverage)
758+
run: |
759+
set -euo pipefail
760+
if [ "${{ env.RUN_CODE_COVERAGE }}" = "true" ]; then
761+
echo "Running rollback tests with coverage"
762+
yarn workspace @hyperledger/cactus-plugin-satp-hermes test:integration:rollback --coverage --coverageDirectory=./code-coverage-ts/satp-hermes-rollback
763+
else
764+
echo "Running rollback tests without coverage"
765+
yarn workspace @hyperledger/cactus-plugin-satp-hermes test:integration:rollback
766+
fi
767+
768+
- name: Upload SATP rollback test report
769+
if: always()
770+
uses: actions/upload-artifact@v4
771+
with:
772+
name: satp-rollback-junit-report-${{ github.job }}
773+
path: packages/cactus-plugin-satp-hermes/reports/junit/satp-hermes-tests-rollback.xml
774+
775+
- name: Check for SATP rollback junit report
776+
id: check_rollback_junit
777+
run: |
778+
if [ -f packages/cactus-plugin-satp-hermes/reports/junit/satp-hermes-tests-rollback.xml ]; then
779+
echo "found=true" >> "$GITHUB_OUTPUT"
780+
else
781+
echo "found=false" >> "$GITHUB_OUTPUT"
782+
fi
783+
784+
- name: Report SATP rollback test results (annotate)
785+
if: always() && steps.check_rollback_junit.outputs.found == 'true'
786+
uses: dorny/[email protected]
787+
with:
788+
name: "SATP Rollback Tests"
789+
path: packages/cactus-plugin-satp-hermes/reports/junit/satp-hermes-tests-rollback.xml
790+
reporter: jest-junit
791+
list-tests: failed
792+
fail-on-error: false
793+
794+
- name: Check for SATP rollback coverage artifacts
795+
id: check_rollback_coverage
796+
run: |
797+
if [ -d packages/cactus-plugin-satp-hermes/code-coverage-ts ] || [ -f packages/cactus-plugin-satp-hermes/coverage/coverage-final.json ]; then
798+
echo "found=true" >> "$GITHUB_OUTPUT"
799+
else
800+
echo "found=false" >> "$GITHUB_OUTPUT"
801+
fi
802+
803+
- name: Upload SATP rollback coverage (if present)
804+
if: always() && steps.check_rollback_coverage.outputs.found == 'true'
805+
uses: actions/upload-artifact@v4
806+
with:
807+
name: coverage-reports-satp-hermes-${{ github.job }}
808+
path: |
809+
packages/cactus-plugin-satp-hermes/code-coverage-ts/**/

packages/cactus-plugin-satp-hermes/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@
117117
"test:integration:docker": "NODE_OPTIONS=--max-old-space-size=4096 npx jest ./src/test/typescript/integration/docker --runInBand --forceExit --config=jest.config-integration-docker.ts",
118118
"test:integration:gateway": "NODE_OPTIONS=--max-old-space-size=4096 npx jest ./src/test/typescript/integration/gateway --runInBand --forceExit --config=jest.config-integration-gateway.ts",
119119
"test:integration:oracle": "NODE_OPTIONS=--max-old-space-size=4096 npx jest ./src/test/typescript/integration/oracle --runInBand --forceExit --config=jest.config-integration-oracle.ts",
120+
"test:integration:recovery": "NODE_OPTIONS=--max-old-space-size=4096 npx jest ./src/test/typescript/integration/recovery --runInBand --forceExit --config=jest.config-unit.ts",
121+
"test:integration:rollback": "NODE_OPTIONS=--max-old-space-size=4096 npx jest ./src/test/typescript/integration/rollback --runInBand --forceExit --config=jest.config-unit.ts",
120122
"test:unit": "NODE_OPTIONS=--max-old-space-size=4096 npx jest ./src/test/typescript/unit --runInBand --forceExit --config=jest.config-unit.ts",
121123
"pretsc": "npm run generate-sdk",
122124
"tsc": "tsc --project ./tsconfig.json",

packages/cactus-plugin-satp-hermes/src/test/typescript/integration/recovery/recovery-stage-1.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ afterAll(async () => {
320320
}
321321
});
322322

323-
describe.skip("Stage 1 Recovery Test", () => {
323+
describe("Stage 1 Recovery Test", () => {
324324
it("should recover Stage 1 hashes, timestamps, signatures, and update session state to RECOVERED", async () => {
325325
crashManager1 = gateway1["crashManager"] as CrashManager;
326326
expect(crashManager1).toBeInstanceOf(CrashManager);

packages/cactus-plugin-satp-hermes/src/test/typescript/integration/rollback/rollback-stage-1.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ afterAll(async () => {
202202
});
203203
});
204204

205-
describe.skip("Rollback Test stage 1", () => {
205+
describe("Rollback Test stage 1", () => {
206206
it("should initiate stage-0 rollback strategy", async () => {
207207
const factoryOptions: IPluginFactoryOptions = {
208208
pluginImportType: PluginImportType.Local,

0 commit comments

Comments
 (0)