-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
test: cache global template build at initialization #6299
Conversation
// We are the first to acquire the lock: | ||
// - initialize a new empty temp project; | ||
// - run `forge init`; | ||
// - run `forge build`; | ||
// - copy it over to the global template; | ||
// Ideally we would be able to initialize a temp project directly in the global template, | ||
// but `TempProject` does not currently allow this: https://github.com/foundry-rs/compilers/issues/22 | ||
|
||
// Release the read lock and acquire a write lock, initializing the lock file. |
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.
ah yeah we should have thought about this much earlier lol
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.
The problem is that the static Lazy didn't work due to nextest running each test in a separate process
d334b11
to
e10248b
Compare
Solidity version used:
Now down to:
|
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.
this is sick. the note about the global lock makes a ton of sense
Motivation
Faster tests
Solution
Build only once at global template initialization rather than per each test.
This requires that we also use a single Solc version for all tests, at least by default. Do that.