Skip to content

Commit

Permalink
Merge pull request #66 from Chia-Network/test-ci-start
Browse files Browse the repository at this point in the history
test: integration tests in ci
  • Loading branch information
TheLastCicada authored Jan 9, 2024
2 parents 9b423ff + 51989bf commit d8d1410
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 5 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
9 changes: 5 additions & 4 deletions test/setup.test.js
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,23 +10,23 @@ 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);
});

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);
});

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);
Expand Down

0 comments on commit d8d1410

Please sign in to comment.