From 1d0f8ae79fff16c785a7f69245f4edbaf0e562dd Mon Sep 17 00:00:00 2001 From: Zachary Brown Date: Tue, 9 Jan 2024 14:33:57 -0800 Subject: [PATCH 1/2] test: integration tests in ci --- .github/workflows/test.yml | 46 ++++++++++++++++++++++++++++++++++++++ test/setup.test.js | 9 ++++---- 2 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..50387a8 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,46 @@ +name: Integration Tests + +on: + workflow_dispatch: +# push: +# tags: +# - '**' +# pull_request: +# branches: +# - '**' + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }} + cancel-in-progress: true + +jobs: + build: + name: Integration Tests + runs-on: ubuntu-latest + + steps: + - name: Clean workspace + uses: Chia-Network/actions/clean-workspace@main + + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Setup Node 18.16 + uses: actions/setup-node@v3 + with: + node-version: '18.16' + + - name: npm install + run: | + node --version + npm install + + - name: npm run tests + env: + CADT_HOST: 'https://integration-testing.chiamanaged.com/coreregistrycadt01' + EXPLORER_HOST: 'https://integration-testing.chiamanaged.com/coreregistryexplorer01' + TOKENIZATION_ENGINE_HOST: 'https://integration-testing.chiamanaged.com/coreregistryengine01' + run: | + npm run test + + diff --git a/test/setup.test.js b/test/setup.test.js index 889a1d8..760bb50 100644 --- a/test/setup.test.js +++ b/test/setup.test.js @@ -1,6 +1,7 @@ const superagent = require("superagent"); -// Hosts should have the full path including port and any subdirectories +// Hosts should have the full path including scheme (http or https), port, and any subdirectories. +// No trailing slash. const { CADT_HOST } = process.env const { EXPLORER_HOST } = process.env const { TOKENIZATION_ENGINE_HOST } = process.env @@ -9,7 +10,7 @@ const { TOKENIZATION_ENGINE_HOST } = process.env describe("Uptime Tests", () => { it("CADT should pass", async () => { const response = await superagent.get( - `http://${CADT_HOST}/health` + `${CADT_HOST}/health` ); expect(response.status).toBe(200); @@ -17,7 +18,7 @@ describe("Uptime Tests", () => { it("Climate Explorer should pass", async () => { const response = await superagent.get( - `http://${EXPLORER_HOST}/v1/activities` + `${EXPLORER_HOST}/v1/activities` ); expect(response.status).toBe(200); @@ -25,7 +26,7 @@ describe("Uptime Tests", () => { it("Climate Tokeninazation Engine should pass", async () => { const response = await superagent.get( - `http://${TOKENIZATION_ENGINE_HOST}/healthz` + `${TOKENIZATION_ENGINE_HOST}/healthz` ); expect(response.status).toBe(200); From 51989bf27da8c33e368b52a5311ce01599f86010 Mon Sep 17 00:00:00 2001 From: Zachary Brown Date: Tue, 9 Jan 2024 14:54:49 -0800 Subject: [PATCH 2/2] chore: version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e50d1e5..625f7b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "core-registry-api", - "version": "1.0.26", + "version": "1.0.27", "description": "Combined Carbon Core Registry API Application", "main": "index.js", "type": "commonjs",