From 41459a77c87e969f6014b71293ea9ab0f0a2b236 Mon Sep 17 00:00:00 2001 From: Lucca Martins Date: Mon, 24 Feb 2025 17:19:20 -0300 Subject: [PATCH 1/6] rpc tests on ci --- .github/workflows/ci.yml | 7 ++++++- integration-tests/rpc_test.sh | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 integration-tests/rpc_test.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e969f5261..475c371a25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -202,7 +202,7 @@ jobs: uses: actions/checkout@v4 with: repository: maticnetwork/matic-cli - ref: master + ref: lmartins/ci-rpc-tests # temporary for validation path: matic-cli - name: Install dependencies on Linux @@ -250,6 +250,11 @@ jobs: cd - timeout 60m bash bor/integration-tests/smoke_test.sh + - name: Run RPC Tests + run: | + echo "Starting RPC Tests..." + timeout 5m bash bor/integration-tests/rpc_test.sh + - name: Upload logs if: always() uses: actions/upload-artifact@v4.4.0 diff --git a/integration-tests/rpc_test.sh b/integration-tests/rpc_test.sh new file mode 100644 index 0000000000..9cfce3af7a --- /dev/null +++ b/integration-tests/rpc_test.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -e + +signersDump=$(jq . $signersFile) +privKey=$(echo "$signersDump" | jq -r ".[0].priv_key") +rpc_url="http://localhost:8545" + + +go run matic-cli/tests/rpc-tests/main.go --priv-key $privKey --rpc-url $rpc_url \ No newline at end of file From dd6689a6c72bbdee0d18946b78450d30707bc77f Mon Sep 17 00:00:00 2001 From: Lucca Martins Date: Mon, 24 Feb 2025 18:00:16 -0300 Subject: [PATCH 2/6] download dependencies to run script --- integration-tests/rpc_test.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/integration-tests/rpc_test.sh b/integration-tests/rpc_test.sh index 9cfce3af7a..119567f9dc 100644 --- a/integration-tests/rpc_test.sh +++ b/integration-tests/rpc_test.sh @@ -5,5 +5,9 @@ signersDump=$(jq . $signersFile) privKey=$(echo "$signersDump" | jq -r ".[0].priv_key") rpc_url="http://localhost:8545" +cd matic-cli/tests/rpc-tests -go run matic-cli/tests/rpc-tests/main.go --priv-key $privKey --rpc-url $rpc_url \ No newline at end of file +go mod tidy +go main.go --priv-key $privKey --rpc-url $rpc_url + +cd - \ No newline at end of file From 9f6279c67a13c3ae22a8cc65e13d860769bf9865 Mon Sep 17 00:00:00 2001 From: Lucca Martins Date: Mon, 24 Feb 2025 18:21:43 -0300 Subject: [PATCH 3/6] small fix on ci rpc tests --- integration-tests/rpc_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/rpc_test.sh b/integration-tests/rpc_test.sh index 119567f9dc..05bc9f708f 100644 --- a/integration-tests/rpc_test.sh +++ b/integration-tests/rpc_test.sh @@ -8,6 +8,6 @@ rpc_url="http://localhost:8545" cd matic-cli/tests/rpc-tests go mod tidy -go main.go --priv-key $privKey --rpc-url $rpc_url +go run main.go --priv-key $privKey --rpc-url $rpc_url cd - \ No newline at end of file From 318047f9516918f961636ecb99c1fb47b0ba07ca Mon Sep 17 00:00:00 2001 From: Lucca Martins Date: Mon, 24 Feb 2025 19:14:23 -0300 Subject: [PATCH 4/6] rpc script fix --- integration-tests/rpc_test.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/integration-tests/rpc_test.sh b/integration-tests/rpc_test.sh index 05bc9f708f..c55e4133c7 100644 --- a/integration-tests/rpc_test.sh +++ b/integration-tests/rpc_test.sh @@ -1,13 +1,14 @@ #!/bin/bash set -e -signersDump=$(jq . $signersFile) +signersFile="matic-cli/devnet/devnet/signer-dump.json" +signersDump=$(jq . "$signersFile") privKey=$(echo "$signersDump" | jq -r ".[0].priv_key") rpc_url="http://localhost:8545" cd matic-cli/tests/rpc-tests go mod tidy -go run main.go --priv-key $privKey --rpc-url $rpc_url +go run . --priv-key "$privKey" --rpc-url "$rpc_url" cd - \ No newline at end of file From c94033070a58a2b3ec77f2851013f469fa06c2a4 Mon Sep 17 00:00:00 2001 From: Lucca Martins Date: Mon, 24 Feb 2025 22:52:20 -0300 Subject: [PATCH 5/6] enable log req res --- integration-tests/rpc_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/rpc_test.sh b/integration-tests/rpc_test.sh index c55e4133c7..00b4758f03 100644 --- a/integration-tests/rpc_test.sh +++ b/integration-tests/rpc_test.sh @@ -9,6 +9,6 @@ rpc_url="http://localhost:8545" cd matic-cli/tests/rpc-tests go mod tidy -go run . --priv-key "$privKey" --rpc-url "$rpc_url" +go run . --priv-key "$privKey" --rpc-url "$rpc_url" --log-req-res true cd - \ No newline at end of file From 5b350dccff021dc6dedb3fa0996d941595cc9caf Mon Sep 17 00:00:00 2001 From: Lucca Martins Date: Tue, 25 Feb 2025 00:32:33 -0300 Subject: [PATCH 6/6] going back to master branch matic-cli --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 475c371a25..dc7f55cc10 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -202,7 +202,7 @@ jobs: uses: actions/checkout@v4 with: repository: maticnetwork/matic-cli - ref: lmartins/ci-rpc-tests # temporary for validation + ref: master path: matic-cli - name: Install dependencies on Linux