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

Optimize CI #1553

Merged
merged 10 commits into from
Jan 21, 2025
Merged

Optimize CI #1553

merged 10 commits into from
Jan 21, 2025

Conversation

franciszekjob
Copy link
Collaborator

@franciszekjob franciszekjob commented Jan 13, 2025

Closes #

Introduced changes

  • Use -n auto flag when running tests with pytest, which will spawn a number of workers processes equal to the number of available CPUs, and distribute the tests randomly across them, docs reference
  • test_call_contract and test_get_storage_at previously used a contract shared across other tests. This PR adjusts them, so they use a separate contract, i.e. they are not influenced by other tests

Comparison (Linux)
Before: ~13/14 minutes
Now: ~7/8 minutes

  • This PR contains breaking changes

Copy link
Collaborator Author

@franciszekjob franciszekjob Jan 13, 2025

Choose a reason for hiding this comment

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

note: The initial value of balance is 1777 when the contract is deployed. Previously, we assumed it was 1897, as other tests modified the balance value. This made the tests interdependent, relying on changes made by other tests. Now they use separate contract, ultimately enabling parallel execution.

Copy link
Collaborator Author

@franciszekjob franciszekjob Jan 14, 2025

Choose a reason for hiding this comment

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

I don't really think this test was meant to check storage after increasing balance - if so, we can easily add a test for invoke + check storage. However, then this is more a test for contract itself, not for our API.

@franciszekjob franciszekjob changed the title Optimize running tests Optimize CI Jan 13, 2025
@franciszekjob franciszekjob marked this pull request as ready for review January 14, 2025 13:23
@franciszekjob franciszekjob merged commit 39af414 into development Jan 21, 2025
10 checks passed
@franciszekjob franciszekjob deleted the franciszekjob/optimize-running-tests branch January 21, 2025 15:40
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