Skip to content

Commit

Permalink
test: ci migration testing (#733)
Browse files Browse the repository at this point in the history
* chore: test migration

Signed-off-by: nikolay <[email protected]>

* chore: test

Signed-off-by: nikolay <[email protected]>

* chore: test

Signed-off-by: nikolay <[email protected]>

* chore: test

Signed-off-by: nikolay <[email protected]>

* chore: test

Signed-off-by: nikolay <[email protected]>

* chore: test

Signed-off-by: nikolay <[email protected]>

* chore: test

Signed-off-by: nikolay <[email protected]>

* chore: test

Signed-off-by: nikolay <[email protected]>

* chore: test

Signed-off-by: nikolay <[email protected]>

* chore: test

Signed-off-by: nikolay <[email protected]>

* chore: test

Signed-off-by: nikolay <[email protected]>

* chore: test

Signed-off-by: nikolay <[email protected]>

* chore: test

Signed-off-by: nikolay <[email protected]>

* chore: test

Signed-off-by: nikolay <[email protected]>

* chore: test

Signed-off-by: nikolay <[email protected]>

* chore: add debug

Signed-off-by: nikolay <[email protected]>

* chore: test

Signed-off-by: nikolay <[email protected]>

* Update migration-testing.yml

Signed-off-by: Iliya Savov <[email protected]>

* chore: fix pipeline

Signed-off-by: Iliya Savov <[email protected]>

* chore: increase freeze wait

Signed-off-by: Iliya Savov <[email protected]>

* chore: cleanup

Signed-off-by: Iliya Savov <[email protected]>

* chore: increase freeze wait

Signed-off-by: Iliya Savov <[email protected]>

* chore: tune freeze wait time

Signed-off-by: Iliya Savov <[email protected]>

* chore: tuning

Signed-off-by: Iliya Savov <[email protected]>

* fix: rework detached execution

Signed-off-by: Iliya Savov <[email protected]>

* chore: test

Signed-off-by: nikolay <[email protected]>

* chore: reset test-workflow.yml

Signed-off-by: nikolay <[email protected]>

* chore: test

Signed-off-by: nikolay <[email protected]>

* chore: cleanup

Signed-off-by: Iliya Savov <[email protected]>

* fix: typo

Signed-off-by: Iliya Savov <[email protected]>

* chore: test tilde expansion

Signed-off-by: Iliya Savov <[email protected]>

* chore: bump hedera local version

Signed-off-by: nikolay <[email protected]>

* chore: revert package.json

Signed-off-by: nikolay <[email protected]>

* chore: test

Signed-off-by: nikolay <[email protected]>

* chore: trigger ci

Signed-off-by: nikolay <[email protected]>

* chore: test

Signed-off-by: nikolay <[email protected]>

* chore: test

Signed-off-by: nikolay <[email protected]>

---------

Signed-off-by: nikolay <[email protected]>
Signed-off-by: Iliya Savov <[email protected]>
Signed-off-by: Iliya Savov <[email protected]>
Co-authored-by: Iliya Savov <[email protected]>
Co-authored-by: Iliya Savov <[email protected]>
Co-Authored-By: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-Authored-By: Logan Nguyen <[email protected]>
Co-Authored-By: Iliya Savov <[email protected]>
Co-Authored-By: Iliya Savov <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
  • Loading branch information
5 people committed May 20, 2024
1 parent 18bd68f commit 9b3f5f7
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
69 changes: 69 additions & 0 deletions .github/workflows/migration-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Migration Testing

on:
workflow_dispatch:
pull_request:
branches: [main]

jobs:
check:
strategy:
fail-fast: true

name: Migration Testing
runs-on: [self-hosted, Linux, large, ephemeral]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Use Node.js [18.15]
uses: actions/setup-node@v3
with:
node-version: 18.15
cache: npm

- name: Create .env file
run: cp local.env .env

- name: Install dependencies
run: npm install

- name: Upgrade @hashgraph/hedera-local to v2.25.0
run: npm install @hashgraph/[email protected] --save

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Start the local node with 0.48.1
run: npx hedera start -d --full --network-tag=0.48.1
timeout-minutes: 5

- name: Run @pre-migration tests
run: npx hardhat test --grep @pre-migration
timeout-minutes: 5

- name: Freeze the network
run: |
npx hardhat run scripts/freeze-network-node.js
sleep 30
timeout-minutes: 5

- name: Stop docker containers (network node)
run: docker stop network-node
timeout-minutes: 5

- name: Run the local node with 0.49.7
env:
NETWORK_NODE_IMAGE_TAG: 0.49.7
NETWORK_NODE_LOGS_ROOT_PATH: ~/.local/share/hedera-local/network-logs/node
run: |
docker compose -f docker-compose-state-migration.yml up -d
working-directory: node_modules/@hashgraph/hedera-local/
timeout-minutes: 5

- name: Run @post-migration tests
run: npx hardhat test --grep @post-migration
timeout-minutes: 5
2 changes: 1 addition & 1 deletion scripts/freeze-network-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async function main() {
'127.0.0.1:50211': '0.0.3',
}).setOperator(OPERATOR_ID_A, OPERATOR_KEY_A);

const validStart = new Timestamp(Math.round(Date.now() / 1000), 0); // timestamp now
const validStart = new Timestamp(Math.round((Date.now() + 5000) / 1000), 0); // timestamp now + 5 sec
const tx = new FreezeTransaction()
.setStartTimestamp(validStart)
.setFreezeType(new FreezeType(1)) // FreezeOnly
Expand Down

0 comments on commit 9b3f5f7

Please sign in to comment.