Merge pull request #176 from dagger/lint-tests
test: lint cue test files
This commit is contained in:
commit
3ce985b594
1
Makefile
1
Makefile
@ -17,6 +17,7 @@ test:
|
|||||||
cuefmt:
|
cuefmt:
|
||||||
@(cue fmt -s ./stdlib/...)
|
@(cue fmt -s ./stdlib/...)
|
||||||
@(cue fmt -s ./examples/*)
|
@(cue fmt -s ./examples/*)
|
||||||
|
@(cue fmt -s ./tests/...)
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint: cuefmt check-buildkit-version
|
lint: cuefmt check-buildkit-version
|
||||||
|
@ -23,7 +23,7 @@ TestOpChaining: #compute: [
|
|||||||
},
|
},
|
||||||
dagger.#Exec & {
|
dagger.#Exec & {
|
||||||
args: ["sh", "-c", "test $(cat /output) = foobar"]
|
args: ["sh", "-c", "test $(cat /output) = foobar"]
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
TestBuildContext: #compute: [
|
TestBuildContext: #compute: [
|
||||||
@ -32,7 +32,7 @@ TestBuildContext: #compute: [
|
|||||||
},
|
},
|
||||||
dagger.#Exec & {
|
dagger.#Exec & {
|
||||||
args: ["sh", "-c", "test $(cat /dir/foo) = foobar"]
|
args: ["sh", "-c", "test $(cat /dir/foo) = foobar"]
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
TestBuildContextAndDockerfile: #compute: [
|
TestBuildContextAndDockerfile: #compute: [
|
||||||
@ -45,7 +45,7 @@ TestBuildContextAndDockerfile: #compute: [
|
|||||||
},
|
},
|
||||||
dagger.#Exec & {
|
dagger.#Exec & {
|
||||||
args: ["sh", "-c", "test $(cat /override) = foobar"]
|
args: ["sh", "-c", "test $(cat /override) = foobar"]
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
TestDockerfilePath: #compute: [
|
TestDockerfilePath: #compute: [
|
||||||
@ -55,7 +55,7 @@ TestDockerfilePath: #compute: [
|
|||||||
},
|
},
|
||||||
dagger.#Exec & {
|
dagger.#Exec & {
|
||||||
args: ["sh", "-c", "test $(cat /test) = dockerfilePath"]
|
args: ["sh", "-c", "test $(cat /test) = dockerfilePath"]
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
TestBuildArgs: #compute: [
|
TestBuildArgs: #compute: [
|
||||||
@ -66,7 +66,7 @@ TestBuildArgs: #compute: [
|
|||||||
RUN test "${TEST}" = "bar"
|
RUN test "${TEST}" = "bar"
|
||||||
"""
|
"""
|
||||||
buildArg: TEST: "bar"
|
buildArg: TEST: "bar"
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
// FIXME: this doesn't test anything beside not crashing
|
// FIXME: this doesn't test anything beside not crashing
|
||||||
@ -76,7 +76,7 @@ TestBuildLabels: #compute: [
|
|||||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||||
"""
|
"""
|
||||||
label: FOO: "bar"
|
label: FOO: "bar"
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
// FIXME: this doesn't test anything beside not crashing
|
// FIXME: this doesn't test anything beside not crashing
|
||||||
@ -86,5 +86,5 @@ TestBuildPlatform: #compute: [
|
|||||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||||
"""
|
"""
|
||||||
platforms: ["linux/amd64"]
|
platforms: ["linux/amd64"]
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
|
@ -13,8 +13,7 @@ test: {
|
|||||||
args: ["sh", "-c", """
|
args: ["sh", "-c", """
|
||||||
cat /mnt/test/lol > /out
|
cat /mnt/test/lol > /out
|
||||||
"""]
|
"""]
|
||||||
mount: "/mnt/test": from: {
|
mount: "/mnt/test": from: #compute: [
|
||||||
#compute: [
|
|
||||||
{
|
{
|
||||||
do: "fetch-container"
|
do: "fetch-container"
|
||||||
ref: "alpine"
|
ref: "alpine"
|
||||||
@ -24,9 +23,8 @@ test: {
|
|||||||
args: ["sh", "-c", """
|
args: ["sh", "-c", """
|
||||||
echo -n "hello world" > /lol
|
echo -n "hello world" > /lol
|
||||||
"""]
|
"""]
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
do: "export"
|
do: "export"
|
||||||
|
Reference in New Issue
Block a user