-
Notifications
You must be signed in to change notification settings - Fork 450
test: showcase impact of cache disabled #12308
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
Set up project and cache directory | ||
|
||
$ echo "(lang dune 3.20)" > dune-project | ||
|
||
$ cat > config <<EOF | ||
> (lang dune 3.20) | ||
> (cache enabled) | ||
> EOF | ||
|
||
$ cat > dune << EOF | ||
> (library | ||
> (name foo)) | ||
> EOF | ||
|
||
$ cat > foo.ml << EOF | ||
> let f x y = x + y | ||
> EOF | ||
|
||
$ export DUNE_CACHE_ROOT=$(pwd)/dune_test_cache | ||
$ mkdir $DUNE_CACHE_ROOT | ||
|
||
Initial build, populating cache | ||
|
||
$ dune build --config-file config | ||
$ wc -l _build/log | ||
31 _build/log | ||
$ ls $DUNE_CACHE_ROOT | ||
files | ||
meta | ||
temp | ||
values | ||
|
||
Second build, no-op as cache is warm | ||
|
||
$ dune clean --config-file config | ||
$ dune build --config-file config | ||
$ wc -l _build/log | ||
17 _build/log | ||
|
||
Build with --cache=disabled, which should be a no-op as _build is already populated. But unfortunately it is not. | ||
|
||
$ dune build --cache=disabled --config-file config | ||
$ wc -l _build/log | ||
22 _build/log | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. given that _build is still populated from the previous build, why do we have more stuff being built? |
||
|
||
Second build with --cache=disabled, should be the same. Here we see it is really a no-op | ||
|
||
$ dune build --cache=disabled --config-file config | ||
$ wc -l _build/log | ||
17 _build/log | ||
|
||
$ dune clean | ||
$ dune build --cache=disabled --config-file config | ||
$ wc -l _build/log | ||
22 _build/log | ||
$ dune build --cache=disabled --config-file config | ||
$ wc -l _build/log | ||
17 _build/log | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here is it the same as during the second build, as expected |
||
|
||
Run the tests with cache except user rules | ||
|
||
$ rm config | ||
$ rm -rf $DUNE_CACHE_ROOT | ||
$ mkdir $DUNE_CACHE_ROOT | ||
$ cat > config <<EOF | ||
> (lang dune 3.20) | ||
> (cache enabled-except-user-rules) | ||
> EOF | ||
|
||
Initial build, populating shared cache | ||
|
||
$ dune build --config-file config | ||
$ wc -l _build/log | ||
17 _build/log | ||
$ ls $DUNE_CACHE_ROOT | ||
files | ||
meta | ||
temp | ||
values | ||
|
||
Second build, no-op as cache is warm | ||
|
||
$ dune clean --config-file config | ||
$ dune build --config-file config | ||
$ wc -l _build/log | ||
22 _build/log | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shared cache is warm but more stuff is built? |
||
|
||
Build with --cache=disabled, which should be a no-op as _build is already populated | ||
|
||
$ dune build --cache=disabled --config-file config | ||
$ wc -l _build/log | ||
17 _build/log | ||
|
||
Second build with --cache=disabled, should be the same | ||
|
||
$ dune build --cache=disabled --config-file config | ||
$ wc -l _build/log | ||
17 _build/log | ||
|
||
$ dune clean | ||
$ dune build --cache=disabled --config-file config | ||
$ wc -l _build/log | ||
22 _build/log | ||
$ dune build --cache=disabled --config-file config | ||
$ wc -l _build/log | ||
17 _build/log | ||
|
||
Run the tests without cache | ||
|
||
$ rm config | ||
$ rm -rf $DUNE_CACHE_ROOT | ||
$ mkdir $DUNE_CACHE_ROOT | ||
$ cat > config <<EOF | ||
> (lang dune 3.20) | ||
> (cache enabled-except-user-rules) | ||
> EOF | ||
|
||
Initial build, populating local cache | ||
|
||
$ dune build --config-file config | ||
$ wc -l _build/log | ||
17 _build/log | ||
$ ls $DUNE_CACHE_ROOT | ||
files | ||
meta | ||
temp | ||
values | ||
|
||
Second build, no-op as cache is warm | ||
|
||
$ dune clean --config-file config | ||
$ dune build --config-file config | ||
$ wc -l _build/log | ||
22 _build/log | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. given that _build is still populated from the previous build, why do we have more stuff being built? |
||
|
||
Build with --cache=disabled, which should be a no-op as _build is already populated | ||
|
||
$ dune build --cache=disabled --config-file config | ||
$ wc -l _build/log | ||
17 _build/log | ||
|
||
Second build with --cache=disabled, should be the same | ||
|
||
$ dune build --cache=disabled --config-file config | ||
$ wc -l _build/log | ||
17 _build/log | ||
|
||
$ dune clean | ||
$ dune build --cache=disabled --config-file config | ||
$ wc -l _build/log | ||
22 _build/log | ||
$ dune build --cache=disabled --config-file config | ||
$ wc -l _build/log | ||
17 _build/log | ||
|
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.
I would have preferred to
cat _build/log
but some lines are starting with$
and it confuses the cram tests on subsequent runs.