mirror of
https://github.com/mudler/luet.git
synced 2025-08-09 11:17:56 +00:00
Adapt tests
This commit is contained in:
parent
3920f9a5ac
commit
639d4438e1
@ -16,15 +16,16 @@
|
|||||||
package compiler_test
|
package compiler_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
. "github.com/mudler/luet/pkg/compiler"
|
. "github.com/mudler/luet/pkg/compiler"
|
||||||
helpers "github.com/mudler/luet/pkg/helpers"
|
helpers "github.com/mudler/luet/pkg/helpers"
|
||||||
pkg "github.com/mudler/luet/pkg/package"
|
pkg "github.com/mudler/luet/pkg/package"
|
||||||
"github.com/mudler/luet/pkg/tree"
|
"github.com/mudler/luet/pkg/tree"
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
|
||||||
"path/filepath"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("Spec", func() {
|
var _ = Describe("Spec", func() {
|
||||||
@ -45,9 +46,9 @@ var _ = Describe("Spec", func() {
|
|||||||
lspec, ok := spec.(*LuetCompilationSpec)
|
lspec, ok := spec.(*LuetCompilationSpec)
|
||||||
Expect(ok).To(BeTrue())
|
Expect(ok).To(BeTrue())
|
||||||
|
|
||||||
Expect(lspec.Steps).To(Equal([]string{"echo foo", "bar"}))
|
Expect(lspec.Steps).To(Equal([]string{"echo foo > /test", "echo bar > /test2"}))
|
||||||
Expect(lspec.Image).To(Equal("luet/base"))
|
Expect(lspec.Image).To(Equal("luet/base"))
|
||||||
Expect(lspec.Seed).To(Equal("luet/baseimage"))
|
Expect(lspec.Seed).To(Equal("alpine"))
|
||||||
tmpdir, err := ioutil.TempDir("", "tree")
|
tmpdir, err := ioutil.TempDir("", "tree")
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
defer os.RemoveAll(tmpdir) // clean up
|
defer os.RemoveAll(tmpdir) // clean up
|
||||||
@ -57,7 +58,7 @@ var _ = Describe("Spec", func() {
|
|||||||
dockerfile, err := helpers.Read(filepath.Join(tmpdir, "Dockerfile"))
|
dockerfile, err := helpers.Read(filepath.Join(tmpdir, "Dockerfile"))
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(dockerfile).To(Equal(`
|
Expect(dockerfile).To(Equal(`
|
||||||
FROM luet/baseimage
|
FROM alpine
|
||||||
COPY . /luetbuild
|
COPY . /luetbuild
|
||||||
WORKDIR /luetbuild
|
WORKDIR /luetbuild
|
||||||
`))
|
`))
|
||||||
@ -68,8 +69,8 @@ WORKDIR /luetbuild
|
|||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(dockerfile).To(Equal(`
|
Expect(dockerfile).To(Equal(`
|
||||||
FROM luet/base
|
FROM luet/base
|
||||||
RUN echo foo
|
RUN echo foo > /test
|
||||||
RUN bar`))
|
RUN echo bar > /test2`))
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -129,7 +129,6 @@ func (p *DefaultPackage) GetPath() string {
|
|||||||
|
|
||||||
func (p *DefaultPackage) Rel(s string) string {
|
func (p *DefaultPackage) Rel(s string) string {
|
||||||
return filepath.Join(p.GetPath(), s)
|
return filepath.Join(p.GetPath(), s)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *DefaultPackage) SetPath(s string) {
|
func (p *DefaultPackage) SetPath(s string) {
|
||||||
|
@ -40,7 +40,7 @@ var _ = Describe("GentooBuilder", func() {
|
|||||||
p, err := tree.GetPackageSet().GetPackage(pid)
|
p, err := tree.GetPackageSet().GetPackage(pid)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(p.GetName()).To(ContainSubstring("pinentry"))
|
Expect(p.GetName()).To(ContainSubstring("pinentry"))
|
||||||
// Expect(p.GetVersion()).To(ContainSubstring("1."))
|
Expect(p.GetVersion()).To(ContainSubstring("1."))
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
image: "luet/base"
|
image: "luet/base"
|
||||||
seed: "luet/baseimage"
|
seed: "alpine"
|
||||||
steps:
|
steps:
|
||||||
- echo foo
|
- echo foo > /test
|
||||||
- bar
|
- echo bar > /test2
|
Loading…
Reference in New Issue
Block a user