Skip to content

feat[tool]: export test suite to json #4638

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
wants to merge 53 commits into
base: master
Choose a base branch
from

Conversation

cyberthirst
Copy link
Collaborator

What I did

How I did it

How to verify it

Commit message

Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

Copy link

codecov bot commented May 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.00%. Comparing base (a343c1e) to head (5083766).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4638   +/-   ##
=======================================
  Coverage   92.99%   93.00%           
=======================================
  Files         131      131           
  Lines       19094    19094           
  Branches     3324     3324           
=======================================
+ Hits        17757    17758    +1     
  Misses        899      899           
+ Partials      438      437    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

tests/exports.py Outdated
key = (bucket, base)

if will_execute:
cnt = self._counts.get(key, 0) + 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

count

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed in: 3c98f37

@@ -221,8 +249,13 @@ def ir_compiler(ir, *args, **kwargs):
assembly = compile_ir.compile_to_assembly(ir, optimize=optimize)
bytecode, _ = compile_ir.assembly_to_evm(assembly)

export_metadata = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to bother exporting contracts compiled directly from IR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, because they are in the environment

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah exactly, it has side-effects. we could also drop the tests that use these functions from the exports but this is a more general approach and it's easy to filter at client side


# if cache is empty it means the fixture will execute
will_execute = fixturedef.cached_result is None
suc = exporter.set_item(fixturedef, will_execute)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does suc stand for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed in: 3c98f37

@cyberthirst cyberthirst marked this pull request as ready for review June 24, 2025 12:53
@@ -166,10 +274,61 @@ def message_call(
gas: int | None = None,
gas_price: int = 0,
is_modifying: bool = True,
) -> bytes:
blob_hashes: Optional[list[bytes]] = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we ever actually pass blob_hashes to message_call?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests/exports.py Outdated
out.parent.mkdir(parents=True, exist_ok=True)

by_name = {
ti.name: {"deps": ti.deps, "traces": ti.traces, "item_type": ti.item_type}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is ti an abbreviation for item?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's traced_item

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed in: 3c98f37

@cyberthirst
Copy link
Collaborator Author

since we merged #4707, it will probably be neccessary to store also the override inside the deployment trace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants