Skip to content

Commit

Permalink
feat: Install the build from the cache (#2568)
Browse files Browse the repository at this point in the history
# Description
The e2e tests take quite long to run.  Viewed positively, `dfx cache install` is the most heavily tested part of dfx, as a large part of the e2e testing time is dedicated to installing dfx at the start of each test, after building (9 minutes).

Arguably, while laudable, installing dfx does not need to be tested so heavily.  The data in `.cache/dfinity/versions/$VERSION_BEING_TESTED` is immutable so it should suffice to run `dfx cache install` once and then reuse that data in all tests.  The one exception is the handful (literally 5) tests that assume that they start in a clean environment; for them the cache would have to be cleared before starting.

Note: All the test files run in parallel, however we do hit concurrency limits with 64 tests on a limit of 50 Mac runners, especially if more than one PR is merging, so jobs do run somewhat sequentially.  Also, dfx is installed for every test in every file.  For the 4-test sns file, running locally dropped from 2m30s to 1m (installing once instead of 4 times).  For files with more tests the time saving with be correspondingly faster.

# How Has This Been Tested?
* See CI
* I have run bash tests locally.  The speedup in local development is nice.

# Checklist:

- [x] The title of this PR complies with [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
- [x] I have edited the CHANGELOG accordingly.
  - Noop as this is a process change 
- [x] I have made corresponding changes to the documentation.
  - Noop as this is a process change
  • Loading branch information
bitdivine authored Sep 20, 2022
1 parent 256fdaf commit be94446
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion e2e/utils/_.bash
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ standard_setup() {
x=$(mktemp -d -t dfx-e2e-XXXXXXXX)
export E2E_TEMP_DIR="$x"

cache_root="${E2E_CACHE_ROOT:-$x/cache-root}"
cache_root="${E2E_CACHE_ROOT:-"$HOME/.e2e-cache-root"}"

mkdir "$x/working-dir"
mkdir -p "$cache_root"
Expand Down

0 comments on commit be94446

Please sign in to comment.