Ensure we can Marshall #Scratch as CUE

Signed-off-by: Joel Longtine <joel@dagger.io>
This commit is contained in:
Joel Longtine
2022-01-07 16:21:06 -07:00
parent 6a7b5f3337
commit a3db716c0a
5 changed files with 70 additions and 9 deletions

View File

@@ -92,6 +92,8 @@ setup() {
@test "task: #Scratch" {
cd "$TESTDIR"/tasks/scratch
"$DAGGER" --europa up ./scratch.cue -l debug
"$DAGGER" --europa up ./scratch_build_scratch.cue -l debug
"$DAGGER" --europa up ./scratch_writefile.cue -l debug
}
@test "task: #Subdir" {

View File

@@ -0,0 +1,25 @@
package main
import (
"alpha.dagger.io/europa/dagger/engine"
)
engine.#Plan & {
actions: {
write: engine.#WriteFile & {
input: engine.#Scratch
path: "/.dockerignore"
contents: "Dockerfile"
permissions: 700
}
build: engine.#Build & {
source: write.output
dockerfile: contents: """
FROM scratch
"""
// Assert that output is engine.#Scratch
output: engine.#Scratch
}
}
}

View File

@@ -0,0 +1,23 @@
package main
import (
"alpha.dagger.io/europa/dagger/engine"
)
engine.#Plan & {
actions: {
write: engine.#WriteFile & {
input: engine.#Scratch
path: "/testing"
contents: "1,2,3"
permissions: 700
}
readfile: engine.#ReadFile & {
input: write.output
path: "/testing"
} & {
// assert result
contents: "1,2,3"
}
}
}