Speed up building and running of tests #383
Merged
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.
What was wrong?
Tests take a long time to run.
How was it fixed?
Mostly by telling cargo to build solc with optimizations for dev builds. I also moved the integration tests into a single module (and thus a single binary), to cut down on the time spent linking the test binaries, removed some dependencies and updated the rest.
In practice, this will slow down the build of solc in favor of much faster test execution. I'm not exactly sure by how much, because I'm sick of timing builds :). If solc is built using sccache (which will now happen automatically, if sccache is installed), then every build after the first will be much faster than it was prior to this pr.
Times on my laptop, before:
(with rust artifacts cached via sccache, but not solc because it wasn't possible/easy prior to g-r-a-n-t/solc-rust#2)
cargo clean && cargo test --workspace --all-features
: 687scargo test --workspace --all-features
: 85safter:
(with rust and solc cached via sccache)
cargo clean && cargo test --workspace --all-features
176scargo test --workspace --all-features
18s