Skip to content

Commit b365061

Browse files
Run differential tests for PolkaVM and REVM (#10205)
# Description This is a PR that builds on PR #10071 making the differential testing framework run the tests for both REVM and PolkaVM. --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 98e9351 commit b365061

File tree

3 files changed

+44
-7
lines changed

3 files changed

+44
-7
lines changed

.github/scripts/process-differential-tests-report.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ class CaseStatusIgnored(typing.TypedDict):
6767
CaseIdxString = str
6868
"""The index of a case as a string. For example '0'"""
6969

70+
PlatformString = typing.Union[
71+
typing.Literal["revive-dev-node-revm-solc"],
72+
typing.Literal["revive-dev-node-polkavm-resolc"],
73+
]
74+
"""A string of the platform on which the test was run"""
75+
7076

7177
def path_relative_to_resolc_compiler_test_directory(path: str) -> str:
7278
"""
@@ -84,9 +90,19 @@ def main() -> None:
8490
with open(sys.argv[1], "r") as file:
8591
report: Report = json.load(file)
8692

93+
# Getting the platform string and resolving it into a simpler version of
94+
# itself.
95+
platform_identifier: PlatformString = typing.cast(PlatformString, sys.argv[2])
96+
if platform_identifier == "revive-dev-node-polkavm-resolc":
97+
platform: str = "PolkaVM"
98+
elif platform_identifier == "revive-dev-node-revm-solc":
99+
platform: str = "REVM"
100+
else:
101+
platform: str = platform_identifier
102+
87103
# Starting the markdown document and adding information to it as we go.
88104
markdown_document: io.TextIOWrapper = open("report.md", "w")
89-
print("# Differential Tests Results", file=markdown_document)
105+
print(f"# Differential Tests Results ({platform})", file=markdown_document)
90106

91107
# Getting all of the test specifiers from the report and making them relative to the tests dir.
92108
test_specifiers: list[str] = list(

.github/workflows/tests-evm.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,30 @@ jobs:
2727
image: ${{ needs.preflight.outputs.IMAGE }}
2828
permissions:
2929
pull-requests: write
30+
strategy:
31+
matrix:
32+
platform:
33+
["revive-dev-node-revm-solc", "revive-dev-node-polkavm-resolc"]
3034
steps:
3135
- name: Checkout the Polkadot SDK
3236
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3337
- name: Update the Installed Python
3438
run: apt-get update && apt-get install -y python3-pip python3
39+
- name: Installing the Latest Resolc
40+
run: |
41+
VERSION="0.5.0"
42+
ASSET_URL="https://github.com/paritytech/revive/releases/download/v$VERSION/resolc-x86_64-unknown-linux-musl"
43+
echo "Downloading resolc v$VERSION from $ASSET_URL"
44+
curl -Lsf --show-error -o resolc "$ASSET_URL"
45+
chmod +x resolc
46+
./resolc --version
3547
- name: Building the dependencies from the Polkadot SDK
3648
run: forklift cargo build --locked --profile release -p pallet-revive-eth-rpc -p revive-dev-node
3749
- name: Checkout the Differential Tests Repository
3850
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3951
with:
4052
repository: paritytech/revive-differential-tests
41-
ref: 75159229dff6e3cc0b1837c95fb053f7bb2a7cb5
53+
ref: e433d93cbf52396dc3fcfc1e69a7b5f4282ebda0
4254
path: revive-differential-tests
4355
submodules: recursive
4456
- name: Installing Retester
@@ -48,30 +60,31 @@ jobs:
4860
- name: Downloading & Initializing the compilation caches
4961
run: |
5062
curl -fL --retry 3 --retry-all-errors --connect-timeout 10 -o cache.tar.gz "https://github.com/paritytech/revive-differential-tests/releases/download/compilation-caches-v1.0/cache.tar.gz"
51-
tar -zxf cache.tar.gz -C ./workdir
63+
tar -zxf cache.tar.gz -C ./workdir > /dev/null 2>&1
5264
- name: Running the Differential Tests
5365
run: |
5466
retester test \
5567
--test ./revive-differential-tests/resolc-compiler-tests/fixtures/solidity/simple \
5668
--test ./revive-differential-tests/resolc-compiler-tests/fixtures/solidity/complex \
5769
--test ./revive-differential-tests/resolc-compiler-tests/fixtures/solidity/translated_semantic_tests \
58-
--platform revive-dev-node-revm-solc \
70+
--platform ${{ matrix.platform }} \
5971
--concurrency.number-of-nodes 10 \
6072
--concurrency.number-of-threads 10 \
6173
--concurrency.number-of-concurrent-tasks 50 \
6274
--working-directory ./workdir \
6375
--revive-dev-node.consensus manual-seal-200 \
6476
--revive-dev-node.path ./target/release/revive-dev-node \
65-
--eth-rpc.path ./target/release/eth-rpc
77+
--eth-rpc.path ./target/release/eth-rpc \
78+
--resolc.path ./resolc
6679
- name: Creating a markdown report of the test execution
6780
run: |
6881
mv ./workdir/*.json report.json
69-
python3 ./.github/scripts/process-differential-tests-report.py report.json
82+
python3 ./.github/scripts/process-differential-tests-report.py report.json ${{ matrix.platform }}
7083
- name: Posting the report as a comment on the PR
7184
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405
7285
if: ${{ contains(github.event.pull_request.labels.*.name, 'T7-smart_contracts') }}
7386
with:
74-
header: diff-tests-report
87+
header: diff-tests-report-${{ matrix.platform }}
7588
path: report.md
7689

7790
evm-test-suite:

prdoc/pr_10205.prdoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
title: Run differential tests for PolkaVM and REVM
2+
doc:
3+
- audience: Runtime Dev
4+
description: |-
5+
# Description
6+
7+
This is a PR that builds on PR #10071 making the differential testing framework run the tests for both REVM and PolkaVM.
8+
crates: []

0 commit comments

Comments
 (0)