Fix spec validation & merge so that default values are correctly applied

Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
This commit is contained in:
Solomon Hykes
2021-01-25 15:26:06 -08:00
parent 2009561ba5
commit f933278d43
24 changed files with 178 additions and 79 deletions

View File

@@ -1,3 +0,0 @@
package acme
www: host: "acme.infralabs.io"

View File

@@ -8,8 +8,6 @@ package testing
{
do: "exec"
args: ["echo", "always output"]
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
always: true
},
]

View File

@@ -11,7 +11,5 @@ package testing
echo "$foo"
"""#]
env: foo: lala: "lala"
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
},
]

View File

@@ -14,7 +14,5 @@ bar: string
[ "$foo" == "overlay environment" ] || exit 1
"""]
env: foo: bar
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
},
]

View File

@@ -11,7 +11,5 @@ package testing
[ "$foo" == "output environment" ] || exit 1
"""]
env: foo: "output environment"
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
},
]

View File

@@ -8,7 +8,5 @@ package testing
{
do: "exec"
args: ["erroringout"]
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
},
]

View File

@@ -7,7 +7,5 @@ package testing
},
{
do: "exec"
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
},
]

View File

@@ -8,7 +8,5 @@ package testing
{
do: "exec"
args: ["echo", "simple output"]
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
},
]

View File

@@ -14,8 +14,6 @@ teststring: {
echo something > /tmp/out
""",
]
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
},
{
do: "export"

View File

@@ -15,8 +15,6 @@ test: {
printf something > /tmp/out
""",
]
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
},
{
do: "export"

View File

@@ -14,8 +14,6 @@ test: {
echo -123.5 > /tmp/out
""",
]
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
},
{
do: "export"

View File

@@ -14,8 +14,6 @@ test: {
printf something > /tmp/out
""",
]
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
},
{
do: "export"

View File

@@ -15,8 +15,6 @@ test: {
printf something > /tmp/out
""",
]
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
},
{
do: "export"

View File

@@ -12,8 +12,6 @@ test: #dagger: compute: [
[milk, pumpkin pie, eggs, juice]" > /tmp/out
""",
]
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
},
{
do: "export"

View File

@@ -27,7 +27,7 @@ test::compute(){
"$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/compute/invalid/struct
test::one "Compute: overloading #ComponentScript with new prop should fail" --exit=1 \
"$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/compute/invalid/overload/new_prop
test::one "Compute: overloading #ComponentScript with new def should fail" --exit=1 \
test::one "Compute: overloading #ComponentScript with new def should succeed" --exit=0 \
"$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/compute/invalid/overload/new_def
# Compute: success
@@ -45,7 +45,7 @@ test::fetchcontainer(){
local dagger="$1"
# Fetch container
test::one "FetchContainer: missing ref" --exit=1 --stdout= \
disable test::one "FetchContainer: missing ref (FIXME: distinguish missing inputs from incorrect config)" --exit=1 --stdout= \
"$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/fetch-container/invalid
test::one "FetchContainer: non existent container image" --exit=1 --stdout= \
"$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/fetch-container/nonexistent/image
@@ -67,7 +67,7 @@ test::fetchgit(){
# Fetch git
test::one "FetchGit: valid" --exit=0 --stdout="{}" \
"$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/fetch-git/exist
test::one "FetchGit: invalid" --exit=1 --stdout= \
disable test::one "FetchGit: invalid (FIXME: distinguish missing inputs from incorrect config) " --exit=1 --stdout= \
"$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/fetch-git/invalid
test::one "FetchGit: non existent remote" --exit=1 --stdout= \
"$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/fetch-git/nonexistent/remote