Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: ci migration testing #733

Merged
merged 38 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ffd545e
chore: test migration
natanasow May 8, 2024
36ca22f
chore: test
natanasow May 8, 2024
cbb586c
chore: test
natanasow May 8, 2024
78c050d
chore: test
natanasow May 8, 2024
2f36415
chore: test
natanasow May 8, 2024
e0faf3a
chore: test
natanasow May 8, 2024
c69e12d
chore: test
natanasow May 8, 2024
2ac315e
chore: test
natanasow May 8, 2024
ae9fd81
chore: test
natanasow May 8, 2024
e37efda
chore: test
natanasow May 8, 2024
459e2c4
chore: test
natanasow May 8, 2024
7260352
chore: test
natanasow May 8, 2024
8581a29
chore: test
natanasow May 9, 2024
5b3ae33
Merge branch 'state-contract-tests' into ci-migration-testing
natanasow May 13, 2024
889b0f7
chore: test
natanasow May 13, 2024
8e9e046
chore: test
natanasow May 13, 2024
0127e6d
chore: add debug
natanasow May 13, 2024
f51454d
chore: test
natanasow May 13, 2024
19f4401
Update migration-testing.yml
isavov May 14, 2024
3672ba9
chore: fix pipeline
isavov May 14, 2024
b821b23
chore: increase freeze wait
isavov May 14, 2024
6a8c1f8
chore: cleanup
isavov May 14, 2024
c397314
chore: increase freeze wait
isavov May 14, 2024
7560300
chore: tune freeze wait time
isavov May 14, 2024
773a747
chore: tuning
isavov May 14, 2024
1566088
fix: rework detached execution
isavov May 14, 2024
778e2b5
chore: test
natanasow May 15, 2024
244a233
chore: reset test-workflow.yml
natanasow May 15, 2024
b8a8931
chore: test
natanasow May 15, 2024
5678e2b
chore: cleanup
isavov May 15, 2024
eec21be
fix: typo
isavov May 15, 2024
0858e09
chore: test tilde expansion
isavov May 15, 2024
600de1a
chore: bump hedera local version
natanasow May 15, 2024
6dd0fab
chore: revert package.json
natanasow May 16, 2024
7d3fe74
chore: test
natanasow May 16, 2024
07173e0
chore: trigger ci
natanasow May 16, 2024
7e8b054
chore: test
natanasow May 16, 2024
1b85ba9
chore: test
natanasow May 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 2.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
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@
"hh:test": "hardhat test",
"hedera:start": "npx @hashgraph/hedera-local start --limits=false --dev=true --balance=10000000",
"hedera:stop": "npx @hashgraph/hedera-local stop",
"prepare": "husky install",
"freeze-network-node": "hardhat run scripts/freeze-network-node.js"
"prepare": "husky install"
},
"devDependencies": {
"@hashgraph/hedera-local": "^2.19.1",
"@hashgraph/sdk": "^2.44.0",
"@hashgraph/sdk": "^2.41.0",
"@nomicfoundation/hardhat-chai-matchers": "^2.0.3",
"@nomicfoundation/hardhat-foundry": "^1.1.1",
"@openzeppelin/contracts": "^5.0.2",
Expand All @@ -52,4 +51,4 @@
"dotenv": "^16.3.1",
"elliptic": "^6.5.4"
}
}
}
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
Loading