-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Check for failures in DT CI #10544
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
Open
0xOmarA
wants to merge
5
commits into
master
Choose a base branch
from
0xOmarA/dt-ci-error-on-failure
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+99
−1
Open
Check for failures in DT CI #10544
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9cfebb3
Check for failures in DT Ci
0xOmarA c096a75
Update from github-actions[bot] running command 'prdoc --audience run…
github-actions[bot] 2c48ad2
Remove un-needed comment
0xOmarA 9a9e1ac
Update doc comment
0xOmarA f864865
Update the commit hash of the DT framework
0xOmarA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
87 changes: 87 additions & 0 deletions
87
.github/scripts/differential-tests-error-out-on-failures.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| """ | ||
| This script is used to turn the JSON report produced by the revive differential tests, detecting | ||
| failures and exiting with the appropriate code if a failure is encountered. | ||
| """ | ||
|
|
||
| import json, typing, sys | ||
|
|
||
|
|
||
| class Report(typing.TypedDict): | ||
| context: "Context" | ||
| execution_information: dict["MetadataFilePathString", "MetadataFileReport"] | ||
|
|
||
|
|
||
| class MetadataFileReport(typing.TypedDict): | ||
| case_reports: dict["CaseIdxString", "CaseReport"] | ||
|
|
||
|
|
||
| class CaseReport(typing.TypedDict): | ||
| mode_execution_reports: dict["ModeString", "ExecutionReport"] | ||
|
|
||
|
|
||
| class ExecutionReport(typing.TypedDict): | ||
| status: "TestCaseStatus" | ||
|
|
||
|
|
||
| class Context(typing.TypedDict): | ||
| Test: "TestContext" | ||
|
|
||
|
|
||
| class TestContext(typing.TypedDict): | ||
| corpus_configuration: "CorpusConfiguration" | ||
|
|
||
|
|
||
| class CorpusConfiguration(typing.TypedDict): | ||
| test_specifiers: list["TestSpecifier"] | ||
|
|
||
|
|
||
| class CaseStatusSuccess(typing.TypedDict): | ||
| status: typing.Literal["Succeeded"] | ||
| steps_executed: int | ||
|
|
||
|
|
||
| class CaseStatusFailure(typing.TypedDict): | ||
| status: typing.Literal["Failed"] | ||
| reason: str | ||
|
|
||
|
|
||
| class CaseStatusIgnored(typing.TypedDict): | ||
| status: typing.Literal["Ignored"] | ||
| reason: str | ||
|
|
||
|
|
||
| TestCaseStatus = typing.Union[CaseStatusSuccess, CaseStatusFailure, CaseStatusIgnored] | ||
| """A union type of all of the possible statuses that could be reported for a case.""" | ||
|
|
||
| TestSpecifier = str | ||
| """A test specifier string. For example resolc-compiler-tests/fixtures/solidity/test.json::0::Y+""" | ||
|
|
||
| ModeString = str | ||
| """The mode string. For example Y+ >=0.8.13""" | ||
|
|
||
| MetadataFilePathString = str | ||
| """The path to a metadata file. For example resolc-compiler-tests/fixtures/solidity/test.json""" | ||
|
|
||
| CaseIdxString = str | ||
| """The index of a case as a string. For example '0'""" | ||
|
|
||
|
|
||
| def main() -> None: | ||
| with open(sys.argv[1], "r") as file: | ||
| report: Report = json.load(file) | ||
|
|
||
| for _, mode_to_case_mapping in report["execution_information"].items(): | ||
| for _, case_idx_to_report_mapping in mode_to_case_mapping[ | ||
| "case_reports" | ||
| ].items(): | ||
| for _, execution_report in case_idx_to_report_mapping[ | ||
| "mode_execution_reports" | ||
| ].items(): | ||
| if execution_report["status"]["status"] == "Failed": | ||
| exit(1) | ||
|
|
||
| exit(0) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| title: Check for failures in DT CI | ||
| doc: | ||
| - audience: Runtime Dev | ||
| description: |- | ||
| # Description | ||
|
|
||
| This is a small PR that makes the CI of the differential testing framework fail if any failure is encountered. We only do this with the `revive-dev-node-revm-solc` target since this is the only target at the moment that has no failures. | ||
| crates: [] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be better to us
jqinstead of a python scriptThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that the Python script is a bit longer than JQ, but I think that it's more readable than it when it comes to what we're trying to do here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't that end up in a pretty unreadable CLI?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't try it but I think it should be a simple oneliner.
Better have the test-suite return status e.g. number of tests failed -> 0 means success. IF that is easy to make
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really care
but this do seems to be a bit of an overkill if we can just do