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

ci: a new workflow step to perform e2e test of relay node with smart contract smoke test #481

Merged
merged 101 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
f873af5
save
JeffreyDallas May 10, 2024
b274e9f
Merge commit '30e414813596d594f0c7ffa43de30cfe0d40b0cd' into 00244-D-…
JeffreyDallas May 10, 2024
237ae1b
save
JeffreyDallas May 10, 2024
94abdcb
update
JeffreyDallas May 13, 2024
5fa3d67
Merge commit '5dbc60bdde4dcf32381808731ffabad5fc8c14fd' into 00244-D-…
JeffreyDallas May 13, 2024
98c9bb5
save
JeffreyDallas May 14, 2024
7fd70b8
save
JeffreyDallas May 15, 2024
dd31847
save
JeffreyDallas May 15, 2024
9173ad8
save
JeffreyDallas May 16, 2024
6111ee2
save
JeffreyDallas May 16, 2024
f521e0c
Merge commit '22553743934b50b626423aed6b0d4af6912fe913' into 00244-D-…
JeffreyDallas May 20, 2024
841fe07
revert
JeffreyDallas May 20, 2024
cb54755
code check fix
JeffreyDallas May 20, 2024
44e89d6
fix
JeffreyDallas May 20, 2024
386b49c
adding shared function getNodeAccountMap
JeffreyDallas May 23, 2024
fdf32c7
save
JeffreyDallas May 23, 2024
659bcf6
Merge commit '9bdfeb303f093b72c95306aa062a4bcb81d02f74' into 00244-D-…
JeffreyDallas May 23, 2024
6842e0e
merge
JeffreyDallas Jun 5, 2024
179243a
save
JeffreyDallas Jun 5, 2024
69db07e
save
JeffreyDallas Jun 5, 2024
89d347f
save
JeffreyDallas Jun 5, 2024
9d91b1c
minor
JeffreyDallas Jun 5, 2024
67d5ab7
save
JeffreyDallas Jun 5, 2024
c707974
add test sleep
JeffreyDallas Jun 6, 2024
2aa71c6
save
JeffreyDallas Jun 6, 2024
94e32ad
save
JeffreyDallas Jun 6, 2024
585743e
save
JeffreyDallas Jun 6, 2024
0bca137
save
JeffreyDallas Jun 6, 2024
d889531
save
JeffreyDallas Jun 6, 2024
5ba3592
save
JeffreyDallas Jun 6, 2024
4127fbb
save
JeffreyDallas Jun 6, 2024
a2a69cb
fix: config for post mod services and insert-fee-data script
Ivo-Yankov Jun 27, 2024
c63fbf3
feat: adds seed db data step in mirror-node deploy
Ivo-Yankov Jun 28, 2024
64da565
Merge remote-tracking branch 'origin/main' into 353-testing-make-sure…
Ivo-Yankov Jul 5, 2024
6240d84
Merge remote-tracking branch 'origin/main' into 353-testing-make-sure…
Ivo-Yankov Jul 8, 2024
043cb47
chore: remove redundant local override
Ivo-Yankov Jul 9, 2024
0c62342
Merge branch 'main' into rpc-relay-smoke-test
JeffreyDallas Jul 10, 2024
118ae1f
save
JeffreyDallas Jul 10, 2024
6330916
chore: override mirror node sidecar value
Ivo-Yankov Jul 11, 2024
871d9be
save
JeffreyDallas Jul 11, 2024
48057b8
Merge branch 'refs/heads/main' into 353-testing-make-sure-solo-is-cov…
Ivo-Yankov Jul 26, 2024
91d08d5
chore: remove hardcoded value
Ivo-Yankov Jul 26, 2024
31446f4
Merge branch 'rpc-relay-smoke-test' into 00244-D-auto-relay-test
JeffreyDallas Jul 30, 2024
25deb34
Merge branch '353-testing-make-sure-solo-is-covering-all-local-node-f…
JeffreyDallas Jul 30, 2024
773f7a7
Merge branch 'refs/heads/main' into 353-testing-make-sure-solo-is-cov…
Ivo-Yankov Jul 31, 2024
51497d2
nit: resolve codacy issue
Ivo-Yankov Jul 31, 2024
94d03c2
nit: resolve codacy issue
Ivo-Yankov Jul 31, 2024
3a71687
Merge branch '353-testing-make-sure-solo-is-covering-all-local-node-f…
JeffreyDallas Aug 2, 2024
75bdc84
update version
JeffreyDallas Aug 2, 2024
7df3c54
test latest version
JeffreyDallas Aug 2, 2024
9d3bd39
save
JeffreyDallas Aug 2, 2024
3deefa3
chore: refactor seed db step
Ivo-Yankov Aug 6, 2024
854cdef
spotless check
JeffreyDallas Aug 6, 2024
f960832
for test
JeffreyDallas Aug 6, 2024
dfc7148
save
JeffreyDallas Aug 6, 2024
2d033de
chore: remove hardcoded pod name
Ivo-Yankov Aug 7, 2024
ac21ba1
chore: eslint fix
Ivo-Yankov Aug 7, 2024
0ec8094
save
JeffreyDallas Aug 7, 2024
3455f05
change
JeffreyDallas Aug 7, 2024
2d8fbbd
save
JeffreyDallas Aug 7, 2024
434ba83
save
JeffreyDallas Aug 8, 2024
9fc3a79
Merge commit 'e012bcd26d27f6c2c72034e8f3401c22c1c79e7d' into 353-test…
JeffreyDallas Aug 8, 2024
67a247c
Merge branch '353-testing-make-sure-solo-is-covering-all-local-node-f…
JeffreyDallas Aug 8, 2024
a8bc64b
save
JeffreyDallas Aug 8, 2024
4a37677
save
JeffreyDallas Aug 8, 2024
28e9b16
save
JeffreyDallas Aug 8, 2024
f584527
save
JeffreyDallas Aug 8, 2024
f1e8c01
save
JeffreyDallas Aug 8, 2024
874bf18
save
JeffreyDallas Aug 8, 2024
9e9b916
save
JeffreyDallas Aug 8, 2024
bb82270
save
JeffreyDallas Aug 8, 2024
fff00c0
save
JeffreyDallas Aug 9, 2024
d7e8acb
save
JeffreyDallas Aug 9, 2024
9a2b029
save
JeffreyDallas Aug 9, 2024
f4fc2e4
save
JeffreyDallas Aug 9, 2024
ea0156c
save
JeffreyDallas Aug 9, 2024
0ec0237
save
JeffreyDallas Aug 9, 2024
168275a
save
JeffreyDallas Aug 9, 2024
69d95f2
revert
JeffreyDallas Aug 9, 2024
20fcbfa
save
JeffreyDallas Aug 9, 2024
600e1c3
save
JeffreyDallas Aug 12, 2024
2ae83f5
Merge commit '77a3dd9b64bd889ce8cb5f522a1f70d7dfbcdf14' into 00244-D-…
JeffreyDallas Aug 12, 2024
66b972e
Merge commit 'c99d88115310d0e19406eac52f2bbd0bc9a9c57f' into 00244-D-…
JeffreyDallas Aug 13, 2024
16aefc9
save
JeffreyDallas Aug 13, 2024
640df9b
save
JeffreyDallas Aug 13, 2024
c917e7e
Merge commit 'ef0199f17f1c5e0687b3b619a028ce4e47d0c29b' into 00244-D-…
JeffreyDallas Aug 13, 2024
531c47d
save
JeffreyDallas Aug 13, 2024
d42913e
save
JeffreyDallas Aug 14, 2024
0cad52d
Merge commit '11395ba650a73c3b585b28e16c255d8dc61c34fb' into 00244-D-…
JeffreyDallas Aug 14, 2024
de1432f
add deploy
JeffreyDallas Aug 14, 2024
c23d3b5
save
JeffreyDallas Aug 14, 2024
d9b748e
save
JeffreyDallas Aug 14, 2024
95f689d
save
JeffreyDallas Aug 14, 2024
941d3b1
save
JeffreyDallas Aug 14, 2024
f27ddb7
save
JeffreyDallas Aug 14, 2024
305a6c5
save
JeffreyDallas Aug 14, 2024
fbc8911
save
JeffreyDallas Aug 14, 2024
d0bd79a
revert app verion
JeffreyDallas Aug 14, 2024
f7e6bce
skip test
JeffreyDallas Aug 15, 2024
543c421
save
JeffreyDallas Aug 15, 2024
3c08346
Merge branch 'main' into 00244-D-auto-relay-test
JeffreyDallas Aug 15, 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
1 change: 0 additions & 1 deletion .github/workflows/flow-build-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ jobs:
needs:
- env-vars
- code-style
- e2e-mirror-node-tests
with:
custom-job-label: Relay
npm-test-script: test-${{ needs.env-vars.outputs.e2e-relay-test-subdir }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/flow-pull-request-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ jobs:
needs:
- env-vars
- code-style
- e2e-mirror-node-tests
with:
custom-job-label: Relay
npm-test-script: test-${{ needs.env-vars.outputs.e2e-relay-test-subdir }}
Expand Down
82 changes: 82 additions & 0 deletions .github/workflows/script/relay_smoke_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/bin/bash
set -eo pipefail

JeffreyDallas marked this conversation as resolved.
Show resolved Hide resolved
echo "Starting test network with a single node"

./test/e2e/setup-e2e.sh
JeffreyDallas marked this conversation as resolved.
Show resolved Hide resolved
solo network deploy
solo node keys --gossip-keys --tls-keys --key-format pfx -i node0
solo node setup -i node0
solo node start -i node0
solo mirror-node deploy
solo relay deploy -i node0
kubectl port-forward svc/relay-node0-hedera-json-rpc-relay -n solo-e2e 7546:7546 &
kubectl port-forward svc/haproxy-node0-svc -n solo-e2e 50211:50211 &
kubectl port-forward svc/fullstack-deployment-hedera-explorer -n solo-e2e 8080:80 &

echo "Clone hedera local node"

cd ..

if [ -d "hedera-local-node" ]; then
echo "Directory hedera-local-node exists."
else
echo "Directory hedera-local-node does not exist."
git clone https://github.com/hashgraph/hedera-local-node --branch release-2.29.0
fi

cd hedera-local-node
npm install

echo "Generate ECDSA keys, extract from output and save to key.txt"
npm run generate-accounts 3 > key.log
sed -n 's/.* - \(0x[0-9a-f]*\) - \(0x[0-9a-f]*\) - .*/\1 \2/p' key.log > key.txt

echo "Only keep the private key, the second column of each line of file key.txt"
awk '{print "\"" $2 "\","}' key.txt > private_key_with_quote.txt
awk '{print "" $2 ","}' key.txt > private_key_without_quote.txt

echo "Remove the comma of the last line before add to json file"
sed '$ s/.$//' private_key_with_quote.txt > private_key_with_quote_final.txt
sed '$ s/.$//' private_key_without_quote.txt > private_key_without_quote_final.txt

LOCAL_NODE_KEYS=$(cat private_key_with_quote_final.txt)
CONTRACT_TEST_KEYS=$(cat private_key_without_quote_final.txt)

echo "Add new keys to hardhat.config.js"
git checkout test/smoke/hardhat.config.js
awk '/accounts: \[/ {print; getline; getline; next} 1' test/smoke/hardhat.config.js > test/smoke/hardhat.config.js.tmp
awk -v new_keys="$LOCAL_NODE_KEYS" '/\],/ {print new_keys; print; next} 1' test/smoke/hardhat.config.js.tmp > test/smoke/hardhat.config.js || true
cat test/smoke/hardhat.config.js

#echo "Run smoke test"
#cd test/smoke
#npm install
#npx hardhat test

cd ..

if [ -d "hedera-smart-contracts" ]; then
echo "Directory hedera-smart-contracts exists."
else
echo "Directory hedera-smart-contracts does not exist."
git clone https://github.com/hashgraph/hedera-smart-contracts --branch only-erc20-tests
jeromy-cannon marked this conversation as resolved.
Show resolved Hide resolved
fi
cd hedera-smart-contracts

npm install
npx hardhat compile

echo "Build .env file"

echo "PRIVATE_KEYS=\"$CONTRACT_TEST_KEYS\"" > .env
echo "RETRY_DELAY=5000 # ms" >> .env
echo "MAX_RETRY=5" >> .env
cat .env

echo "Start background transaction"
cd ../hedera-local-node; watch npm run generate-accounts 3 > background.log & cd -

npm list
echo "Run contract test"
npm run hh:test
6 changes: 6 additions & 0 deletions .github/workflows/zxc-e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ jobs:
run: |
${{ env.CG_EXEC }} npm run ${{ inputs.npm-test-script }}

- name: RPC relay smoke test
if: ${{ runner.os == 'linux' && inputs.npm-test-script == 'test-e2e-relay' && !cancelled() && !failure() }}
run: |
echo "Skipped smoke test for relay"
#.github/workflows/script/relay_smoke_test.sh
jeromy-cannon marked this conversation as resolved.
Show resolved Hide resolved

- name: Upload E2E Logs to GitHub
if: ${{ !cancelled() }}
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
Expand Down
4 changes: 2 additions & 2 deletions resources/templates/application.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
hedera.config.version=0
ledger.id=0x01
netty.mode=TEST
contracts.chainId=298
hedera.recordStream.logPeriod=1
balances.exportPeriodSecs=400
Expand All @@ -7,9 +9,7 @@ hedera.recordStream.compressFilesOnCreation=true
balances.compressOnCreation=true
contracts.maxNumWithHapiSigsAccess=0
autoRenew.targetTypes=
hedera.config.version=0
nodes.gossipFqdnRestricted=false
netty.mode=TEST
hedera.profiles.active=TEST
# TODO: this is a workaround until prepareUpgrade freeze will recalculate the weight prior to writing the config.txt
staking.periodMins=1
2 changes: 1 addition & 1 deletion src/commands/flags.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export const relayReleaseTag = {
name: 'relay-release',
definition: {
describe: 'Relay release tag to be used (e.g. v0.48.0)',
defaultValue: 'v0.48.1',
defaultValue: 'v0.53.0',
type: 'string'
}
}
Expand Down
Loading