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

update docs + improve tests speed #196

Merged
merged 1 commit into from
Mar 18, 2025
Merged

Conversation

BlazeWasHere
Copy link
Contributor

improved tests speed

old:

Finished in 7.0 seconds (0.00s async, 7.0s sync)

new:

Finished in 4.9 seconds (2.2s async, 2.7s sync)

updated docs because if you run mix test you get:

== Compilation error in file test/support/contracts.ex ==
** (File.Error) could not read file "tmp/revert_abi.json": no such file or directory
    (elixir 1.18.1) lib/file.ex:385: File.read!/1
    lib/ethers/contract_helpers.ex:406: Ethers.ContractHelpers.do_read_abi/3
    expanding macro: Ethers.Contract.__before_compile__/1
    test/support/contracts.ex:4: Ethers.Contract.Test.RevertContract (module)

elixir_ethers/mix.exs

Lines 124 to 128 in ae8e9ac

def aliases do
[
test_prepare: ["run test/test_prepare.exs"],
test: ["test_prepare", "test"]
]

i think its because you cannot alias a builtin mix task (test)

@alisinabh
Copy link
Member

Hey @BlazeWasHere,
Thanks for the PR. It is amazing to speed up the tests.

i think its because you cannot alias a builtin mix task (test)

You can definitely alias built-in mix tasks. The issue you see here is a chicken an egg problem. Our test/support directory which in part of our elixirc_path in tests relies on the ABI generated by prepare_test task. This is problematic since running mix tasks also requires the project to be compiled.

That said, I agree with your solution here.

❤️ 💜 ❤️ 💜

@alisinabh alisinabh merged commit c44edb2 into ExWeb3:main Mar 18, 2025
5 checks passed
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