fix pipeline caching when using cache mounts
Force the Pipeline to resolve the canonical Cue value before computing. This ensures that `.Path()` gives a constant result even on references. Fixes #399 Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
@@ -24,7 +24,6 @@ setup() {
|
||||
|
||||
# cache
|
||||
run "$DAGGER" compute "$TESTDIR"/ops/mounts/valid/cache
|
||||
assert_line '{"TestMountCache":"NOT SURE WHAT TO TEST YET"}'
|
||||
assert_success
|
||||
|
||||
# component
|
||||
|
9
tests/ops/mounts/valid/cache/main.cue
vendored
9
tests/ops/mounts/valid/cache/main.cue
vendored
@@ -1,6 +1,8 @@
|
||||
package testing
|
||||
|
||||
import "dagger.io/dagger/op"
|
||||
import (
|
||||
"dagger.io/dagger/op"
|
||||
)
|
||||
|
||||
TestMountCache: {
|
||||
string
|
||||
@@ -11,7 +13,7 @@ TestMountCache: {
|
||||
},
|
||||
op.#Exec & {
|
||||
args: ["sh", "-c", """
|
||||
echo -n "NOT SURE WHAT TO TEST YET" > /out
|
||||
echo -n "$RANDOM" > /out
|
||||
"""]
|
||||
dir: "/"
|
||||
mount: something: "cache"
|
||||
@@ -22,3 +24,6 @@ TestMountCache: {
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
// Make sure references to pipelines with cache mounts never get re-executed. #399
|
||||
TestReference: TestMountCache
|
||||
|
Reference in New Issue
Block a user