Skip to content

Commit

Permalink
feat: Rework how tooling tests and dapp are starting local-node (#2617)
Browse files Browse the repository at this point in the history
* chore: test

Signed-off-by: nikolay <n.atanasow94@gmail.com>

* chore: edit package.jsons

Signed-off-by: nikolay <n.atanasow94@gmail.com>

* chore: edit package.jsons

Signed-off-by: nikolay <n.atanasow94@gmail.com>

---------

Signed-off-by: nikolay <n.atanasow94@gmail.com>
  • Loading branch information
natanasow authored Jun 27, 2024
1 parent 3197b37 commit 8997ae2
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 74 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/dapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,14 @@ jobs:
- name: Build Typescript
run: npx lerna run build

- name: Run RPC Server
run: npm run integration:prerequisite &
- name: Start the hedera local node
run: npx hedera start -d

- name: Check local node
run: npm run check:node
- name: Stop the local node's relay
run: docker stop json-rpc-relay

- name: Start the local relay
run: npm run start &

- name: Build, Bootstrap & Test the dapp in Docker
run: docker-compose up --exit-code-from synpress
Expand All @@ -70,7 +73,7 @@ jobs:
- name: Tar logs
if: ${{ always() && !cancelled() }}
run: tar cvzf ./logs.tgz ./logs

- name: Upload logs to GitHub
if: ${{ always() && !cancelled() }}
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/dev-tool-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,18 @@ jobs:
- name: Build Typescript
run: npx lerna run build

- name: Run RPC Server
run: npm run integration:prerequisite &
- name: Start the hedera local node
run: npx hedera start -d

- name: Stop the local node's relay
run: docker stop json-rpc-relay

- name: Start the local relay
run: npm run start &

- name: Install dependencies
run: cd ${{ inputs.directory }}/ && npm ci

- name: Check local node
run: npm run check:node
timeout-minutes: 8

- name: Run the tests
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
with:
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/postman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
concurrency:
group: pr-checks-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
setup-local-hedera:
name: Postman Endpoint Tests
Expand Down Expand Up @@ -46,13 +46,19 @@ jobs:
- name: Build Typescript
run: npx lerna run build

- name: Run RPC Server
run: npm run integration:prerequisite &
- name: Start the hedera local node
run: npx hedera start -d

- name: Stop the local node's relay
run: docker stop json-rpc-relay

- name: Start the local relay
run: npm run start &

- name: Install newman
run: npm install -g newman

- name: Run the newman script
- name: Run the newman script
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
with:
max_attempts: 10
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@
"start:docker": "docker run --name hedera-relay -d -p 7546:7546 ${npm_package_name}:latest",
"test": "npx lerna run test",
"openrpctest": "ts-mocha packages/relay/tests/lib/openrpc.spec.ts --exit",
"integration:prerequisite": "ts-node packages/server/tests/helpers/prerequisite.ts",
"check:node": "ts-node packages/server/tests/helpers/nodeCheck.ts",
"bump-version": "SEM_VER=${npm_config_semver} SNAPSHOT=${npm_config_snapshot} node scripts/.bump-version.js",
"prepare": "husky install"
},
Expand Down
3 changes: 1 addition & 2 deletions packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@
"compile": "tsc -b tsconfig.json",
"acceptancetest": "ts-mocha tests/acceptance/index.spec.ts",
"start": "node dist/index.js",
"test": "nyc ts-mocha --recursive ./tests/integration/*.spec.ts --exit",
"integration:prerequisite": "ts-node ./tests/helpers/prerequisite.ts"
"test": "nyc ts-mocha --recursive ./tests/integration/*.spec.ts --exit"
},
"nyc": {
"check-coverage": false,
Expand Down
26 changes: 0 additions & 26 deletions packages/server/tests/helpers/nodeCheck.ts

This file was deleted.

27 changes: 0 additions & 27 deletions packages/server/tests/helpers/prerequisite.ts

This file was deleted.

3 changes: 1 addition & 2 deletions packages/ws-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@
"compile": "tsc -b tsconfig.json",
"acceptancetest": "ts-mocha tests/acceptance/index.spec.ts",
"start": "node dist/index.js",
"test:unit": "nyc ts-mocha --recursive './tests/unit/**/*.spec.ts' --exit",
"integration:prerequisite": "ts-node ./tests/helpers/prerequisite.ts"
"test:unit": "nyc ts-mocha --recursive './tests/unit/**/*.spec.ts' --exit"
},
"nyc": {
"check-coverage": false,
Expand Down

0 comments on commit 8997ae2

Please sign in to comment.