diff --git a/pkg/universe.dagger.io/alpine/test/alpine.bats b/pkg/universe.dagger.io/alpine/test/alpine.bats deleted file mode 100644 index 05854ffa..00000000 --- a/pkg/universe.dagger.io/alpine/test/alpine.bats +++ /dev/null @@ -1,10 +0,0 @@ -setup() { - load '../../bats_helpers' - - common_setup -} - -@test "alpine.#Build" { - dagger up ./image-version.cue - dagger up ./package-install.cue -} \ No newline at end of file diff --git a/pkg/universe.dagger.io/alpine/test/image-version.cue b/pkg/universe.dagger.io/alpine/test/image-version.cue deleted file mode 100644 index 2a912ff6..00000000 --- a/pkg/universe.dagger.io/alpine/test/image-version.cue +++ /dev/null @@ -1,22 +0,0 @@ -package test - -import ( - "dagger.io/dagger" - "dagger.io/dagger/engine" - "universe.dagger.io/alpine" -) - -dagger.#Plan & { - actions: { - build: alpine.#Build & { - // install an old version on purpose - version: "3.10.9" - } - - check: engine.#Readfile & { - input: build.output.rootfs - path: "/etc/alpine-release" - contents: "3.10.9\n" - } - } -} diff --git a/pkg/universe.dagger.io/alpine/test/package-install.cue b/pkg/universe.dagger.io/alpine/test/package-install.cue deleted file mode 100644 index 7a5a4689..00000000 --- a/pkg/universe.dagger.io/alpine/test/package-install.cue +++ /dev/null @@ -1,34 +0,0 @@ -package test - -import ( - "dagger.io/dagger" - "universe.dagger.io/alpine" - "universe.dagger.io/docker" -) - -dagger.#Plan & { - actions: { - build: alpine.#Build & { - packages: { - jq: {} - curl: {} - } - } - - check: docker.#Run & { - image: build.output - command: { - name: "sh" - flags: "-c": """ - jq --version > /jq-version.txt - curl --version > /curl-version.txt - """ - } - - export: files: { - "/jq-version.txt": contents: =~"^jq" - "/curl-version.txt": contents: =~"^curl" - } - } - } -} diff --git a/pkg/universe.dagger.io/alpine/test/test.bats b/pkg/universe.dagger.io/alpine/test/test.bats new file mode 100644 index 00000000..4c4c4c7b --- /dev/null +++ b/pkg/universe.dagger.io/alpine/test/test.bats @@ -0,0 +1,8 @@ +setup() { + load '../../bats_helpers' + + common_setup +} +@test "alpine" { + dagger up +} diff --git a/pkg/universe.dagger.io/alpine/test/test.cue b/pkg/universe.dagger.io/alpine/test/test.cue new file mode 100644 index 00000000..d3691d8d --- /dev/null +++ b/pkg/universe.dagger.io/alpine/test/test.cue @@ -0,0 +1,53 @@ +package alpine + +import ( + "dagger.io/dagger" + "dagger.io/dagger/engine" + + "universe.dagger.io/alpine" + "universe.dagger.io/docker" +) + +dagger.#Plan & { + actions: tests: { + // Test: customize alpine version + alpineVersion: { + build: alpine.#Build & { + // install an old version on purpose + version: "3.10.9" + } + + verify: engine.#Readfile & { + input: build.output.rootfs + path: "/etc/alpine-release" + contents: "3.10.9\n" + } + } + + // Test: install packages + packageInstall: { + build: alpine.#Build & { + packages: { + jq: {} + curl: {} + } + } + + check: docker.#Run & { + image: build.output + command: { + name: "sh" + flags: "-c": """ + jq --version > /jq-version.txt + curl --version > /curl-version.txt + """ + } + + export: files: { + "/jq-version.txt": contents: =~"^jq" + "/curl-version.txt": contents: =~"^curl" + } + } + } + } +}