From a871d0c035fbf96bcf7af760e7228452c62b4ffc Mon Sep 17 00:00:00 2001 From: Nabarun Gogoi Date: Fri, 5 Jul 2024 18:38:46 +0530 Subject: [PATCH] Update CI for using testnet-onboarding laconic2d (#8) * Update CI for using testnet-onboarding laconic2d * Run onboarding test in CI --- .github/workflows/test.yml | 14 ++++++++++++-- package.json | 1 + src/onboarding.test.ts | 15 ++++++++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2b77c8e..234c36c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,9 +15,10 @@ jobs: uses: actions/checkout@v3 with: path: "./laconicd/" - repository: cerc-io/laconicd + repository: deep-stack/laconic2d + token: ${{ secrets.GH_PAT }} # PAT for accessing private laconic2d fetch-depth: 0 - ref: main + ref: testnet-onboarding - name: Environment run: ls -tlh && env @@ -51,3 +52,12 @@ jobs: - name: Run nameservice expiry tests working-directory: laconicd/tests/sdk_tests run: ./run-tests.sh test:nameservice-expiry + + - name: Start containers (onboarding enabled) + working-directory: laconicd/tests/sdk_tests + env: + ONBOARDING_ENABLED: true + run: docker compose up -d + - name: Run nameservice expiry tests + working-directory: laconicd/tests/sdk_tests + run: ./run-tests.sh test:onboarding diff --git a/package.json b/package.json index 17d7150..199abd6 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ "test": "jest --runInBand --verbose --testPathPattern=src", "test:auctions": "TEST_AUCTIONS_ENABLED=1 jest --runInBand --verbose src/auction.test.ts", "test:nameservice-expiry": "TEST_NAMESERVICE_EXPIRY=1 jest --runInBand --verbose src/nameservice-expiry.test.ts", + "test:onboarding": "ONBOARDING_ENABLED=1 jest --runInBand --verbose src/onboarding.test.ts", "build": "tsc", "lint": "eslint .", "prepare": "husky" diff --git a/src/onboarding.test.ts b/src/onboarding.test.ts index 4876112..a6c86e6 100644 --- a/src/onboarding.test.ts +++ b/src/onboarding.test.ts @@ -53,4 +53,17 @@ const onboardingTests = () => { }); }; -describe('Onboarding', onboardingTests); +if (!process.env.ONBOARDING_ENABLED) { + // Required as jest complains if file has no tests. + test('skipping onboarding tests', () => {}); +} else { + /** + In laconic2d repo run: + TEST_REGISTRY_EXPIRY=true ./init.sh + + Run tests: + yarn test:onboarding + */ + + describe('Onboarding', onboardingTests); +}