diff --git a/plan/plan.go b/plan/plan.go index ab749426..ad7b58ad 100644 --- a/plan/plan.go +++ b/plan/plan.go @@ -59,7 +59,7 @@ func (p *Plan) Source() *compiler.Value { // registerLocalDirectories scans the context for local imports. // BuildKit requires to known the list of directories ahead of time. func (p *Plan) registerLocalDirs() error { - imports, err := p.source.Lookup("input.directories").Fields() + imports, err := p.source.Lookup("inputs.directories").Fields() if err != nil { return err } diff --git a/stdlib/europa/dagger/engine/plan.cue b/stdlib/europa/dagger/engine/plan.cue index 941d1b46..d813666f 100644 --- a/stdlib/europa/dagger/engine/plan.cue +++ b/stdlib/europa/dagger/engine/plan.cue @@ -3,7 +3,7 @@ package engine // A deployment plan executed by `dagger up` #Plan: { // Receive inputs from the client - input: { + inputs: { // Receive directories directories: [string]: _#inputDirectory // Securely receive secrets diff --git a/stdlib/europa/dagger/engine/spec/engine/plan.cue b/stdlib/europa/dagger/engine/spec/engine/plan.cue index ab4ecc57..423c31b8 100644 --- a/stdlib/europa/dagger/engine/spec/engine/plan.cue +++ b/stdlib/europa/dagger/engine/spec/engine/plan.cue @@ -7,7 +7,7 @@ package engine // A special kind of program which `dagger` can execute. #DAG: { // Receive inputs from the client - input: { + inputs: { // Receive directories directories: [name=string]: _#inputDirectory // Securely receive secrets @@ -17,7 +17,7 @@ package engine } // Send outputs to the client - output: { + outputs: { directories: [name=string]: _#outputDirectory } diff --git a/tests/plan.bats b/tests/plan.bats index 222dc085..b2e29e32 100644 --- a/tests/plan.bats +++ b/tests/plan.bats @@ -42,4 +42,11 @@ setup() { @test "plan/inputs/directories exists" { cd "$TESTDIR" "$DAGGER" --europa up ./plan/inputs/directories/exists.cue +} + +@test "plan/inputs/directories conflicting values" { + cd "$TESTDIR" + run "$DAGGER" --europa up ./plan/inputs/directories/conflicting_values.cue + assert_failure + assert_output --partial 'failed to up environment: actions.verify.contents: conflicting values "local directory" and "local dfsadf"' } \ No newline at end of file diff --git a/tests/plan/inputs/directories/conflicting_values.cue b/tests/plan/inputs/directories/conflicting_values.cue new file mode 100644 index 00000000..69f3694f --- /dev/null +++ b/tests/plan/inputs/directories/conflicting_values.cue @@ -0,0 +1,15 @@ +package main + +import ( + "alpha.dagger.io/europa/dagger/engine" +) + +engine.#Plan & { + inputs: directories: test: path: "./plan/inputs/directories" + actions: verify: engine.#ReadFile & { + input: inputs.directories.test.contents + path: "test.txt" + } & { + contents: "local dfsadf" // should fail with conflicting values + } +} diff --git a/tests/plan/inputs/directories/exists.cue b/tests/plan/inputs/directories/exists.cue index d709f2ff..76201c34 100644 --- a/tests/plan/inputs/directories/exists.cue +++ b/tests/plan/inputs/directories/exists.cue @@ -1,16 +1,15 @@ package main import ( - "alpha.dagger.io/europa/dagger" "alpha.dagger.io/europa/dagger/engine" ) -dagger.#Plan & { - input: directories: test: path: "./plan/inputs/directories" +engine.#Plan & { + inputs: directories: test: path: "./plan/inputs/directories" actions: verify: engine.#ReadFile & { - input: input.directories.test.contents + input: inputs.directories.test.contents path: "test.txt" } & { - contents: "local directory\n" + contents: "local directory" } }