mirror of
https://github.com/mudler/luet.git
synced 2025-08-15 05:53:41 +00:00
Pull images before executing diff tests
This commit is contained in:
parent
f676b50735
commit
95b125cb91
@ -23,15 +23,20 @@ import (
|
|||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("Docker backend", func() {
|
var _ = Describe("Docker image diffs", func() {
|
||||||
var b compiler.CompilerBackend
|
var b compiler.CompilerBackend
|
||||||
|
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
b = NewSimpleDockerBackend()
|
b = NewSimpleDockerBackend()
|
||||||
})
|
})
|
||||||
|
|
||||||
Context("Simple Docker backend satisfies main interface functionalities", func() {
|
Context("Generate diffs from docker images", func() {
|
||||||
It("Builds and generate tars", func() {
|
It("Detect no changes", func() {
|
||||||
|
err := b.DownloadImage(compiler.CompilerBackendOptions{
|
||||||
|
ImageName: "alpine:latest",
|
||||||
|
})
|
||||||
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
|
||||||
layers, err := GenerateChanges(b, "alpine:latest", "alpine:latest")
|
layers, err := GenerateChanges(b, "alpine:latest", "alpine:latest")
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(len(layers)).To(Equal(1))
|
Expect(len(layers)).To(Equal(1))
|
||||||
@ -40,7 +45,16 @@ var _ = Describe("Docker backend", func() {
|
|||||||
Expect(len(layers[0].Diffs.Deletions)).To(Equal(0))
|
Expect(len(layers[0].Diffs.Deletions)).To(Equal(0))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("Builds and generate tars", func() {
|
It("Detects additions and changed files", func() {
|
||||||
|
err := b.DownloadImage(compiler.CompilerBackendOptions{
|
||||||
|
ImageName: "quay.io/mocaccino/micro",
|
||||||
|
})
|
||||||
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
err = b.DownloadImage(compiler.CompilerBackendOptions{
|
||||||
|
ImageName: "quay.io/mocaccino/extra",
|
||||||
|
})
|
||||||
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
|
||||||
layers, err := GenerateChanges(b, "quay.io/mocaccino/micro", "quay.io/mocaccino/extra")
|
layers, err := GenerateChanges(b, "quay.io/mocaccino/micro", "quay.io/mocaccino/extra")
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(len(layers)).To(Equal(1))
|
Expect(len(layers)).To(Equal(1))
|
||||||
|
Loading…
Reference in New Issue
Block a user