Skip to content

Commit 180e3bf

Browse files
authored
fix: setup local registry before trying to run tests (#284)
Issue #, if available: *Description of changes:* - Setup local registry before running tests *Testing done:* - Local testing - [x] I've reviewed the guidance in CONTRIBUTING.md #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Signed-off-by: Justin Alvarez <[email protected]>
1 parent baf528f commit 180e3bf

File tree

3 files changed

+54
-54
lines changed

3 files changed

+54
-54
lines changed

e2e/e2e_test.go

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -40,67 +40,67 @@ func TestE2e(t *testing.T) {
4040
subject := "limactl"
4141
vmConfigFile := filepath.Join(wd, "./../_output/lima-template/fedora.yaml")
4242
vmName := "fedora"
43-
o, err := option.New([]string{subject})
43+
limaOpt, err := option.New([]string{subject})
44+
nerdctlOpt, err := option.New([]string{subject, "shell", "fedora", "sudo", "-E", "nerdctl"})
45+
if err != nil {
46+
t.Fatalf("failed to initialize a testing option: %v", err)
47+
}
4448

4549
ginkgo.SynchronizedBeforeSuite(func() []byte {
46-
command.New(o, "start", vmConfigFile).WithTimeoutInSeconds(600).Run()
50+
command.New(limaOpt, "start", vmConfigFile).WithTimeoutInSeconds(600).Run()
51+
tests.SetupLocalRegistry(nerdctlOpt)
4752
return nil
4853
}, func(bytes []byte) {})
4954

5055
ginkgo.SynchronizedAfterSuite(func() {
51-
command.New(o, "stop", vmName).WithTimeoutInSeconds(90).Run()
52-
command.New(o, "remove", vmName).WithTimeoutInSeconds(60).Run()
56+
command.New(limaOpt, "stop", vmName).WithTimeoutInSeconds(90).Run()
57+
command.New(limaOpt, "remove", vmName).WithTimeoutInSeconds(60).Run()
5358
}, func() {})
5459

55-
opt, err := option.New([]string{subject, "shell", "fedora", "sudo", "-E", "nerdctl"})
56-
if err != nil {
57-
t.Fatalf("failed to initialize a testing option: %v", err)
58-
}
59-
6060
ginkgo.Describe(description, func() {
6161
// TODO: add more e2e tests and make them work.
62-
tests.Save(opt)
63-
tests.Load(opt)
64-
tests.Pull(opt)
65-
tests.Rm(opt)
66-
tests.Rmi(opt)
67-
tests.Start(opt)
68-
tests.Stop(opt)
69-
tests.Cp(opt)
70-
tests.Tag(opt)
71-
tests.Build(opt)
72-
tests.Push(opt)
73-
tests.Images(opt)
74-
tests.ComposeBuild(opt)
75-
tests.ComposeDown(opt)
76-
tests.ComposeKill(opt)
77-
tests.ComposePs(opt)
78-
tests.ComposePull(opt)
79-
tests.ComposeLogs(opt)
80-
tests.Create(opt)
81-
tests.Port(opt)
82-
tests.Kill(opt)
83-
tests.Stats(opt)
84-
tests.BuilderPrune(opt)
85-
tests.Exec(opt)
86-
tests.Logs(opt)
87-
tests.Login(opt)
88-
tests.Logout(opt)
89-
tests.VolumeCreate(opt)
90-
tests.VolumeInspect(opt)
91-
tests.VolumeLs(opt)
92-
tests.VolumeRm(opt)
93-
tests.VolumePrune(opt)
94-
tests.ImageHistory(opt)
95-
tests.ImageInspect(opt)
96-
tests.ImagePrune(opt)
97-
tests.Info(opt)
98-
tests.Events(opt)
99-
tests.Inspect(opt)
100-
tests.NetworkCreate(opt)
101-
tests.NetworkInspect(opt)
102-
tests.NetworkLs(opt)
103-
tests.NetworkRm(opt)
62+
tests.Save(nerdctlOpt)
63+
tests.Load(nerdctlOpt)
64+
tests.Pull(nerdctlOpt)
65+
tests.Rm(nerdctlOpt)
66+
tests.Rmi(nerdctlOpt)
67+
tests.Start(nerdctlOpt)
68+
tests.Stop(nerdctlOpt)
69+
tests.Cp(nerdctlOpt)
70+
tests.Tag(nerdctlOpt)
71+
tests.Build(nerdctlOpt)
72+
tests.Push(nerdctlOpt)
73+
tests.Images(nerdctlOpt)
74+
tests.ComposeBuild(nerdctlOpt)
75+
tests.ComposeDown(nerdctlOpt)
76+
tests.ComposeKill(nerdctlOpt)
77+
tests.ComposePs(nerdctlOpt)
78+
tests.ComposePull(nerdctlOpt)
79+
tests.ComposeLogs(nerdctlOpt)
80+
tests.Create(nerdctlOpt)
81+
tests.Port(nerdctlOpt)
82+
tests.Kill(nerdctlOpt)
83+
tests.Stats(nerdctlOpt)
84+
tests.BuilderPrune(nerdctlOpt)
85+
tests.Exec(nerdctlOpt)
86+
tests.Logs(nerdctlOpt)
87+
tests.Login(nerdctlOpt)
88+
tests.Logout(nerdctlOpt)
89+
tests.VolumeCreate(nerdctlOpt)
90+
tests.VolumeInspect(nerdctlOpt)
91+
tests.VolumeLs(nerdctlOpt)
92+
tests.VolumeRm(nerdctlOpt)
93+
tests.VolumePrune(nerdctlOpt)
94+
tests.ImageHistory(nerdctlOpt)
95+
tests.ImageInspect(nerdctlOpt)
96+
tests.ImagePrune(nerdctlOpt)
97+
tests.Info(nerdctlOpt)
98+
tests.Events(nerdctlOpt)
99+
tests.Inspect(nerdctlOpt)
100+
tests.NetworkCreate(nerdctlOpt)
101+
tests.NetworkInspect(nerdctlOpt)
102+
tests.NetworkLs(nerdctlOpt)
103+
tests.NetworkRm(nerdctlOpt)
104104
})
105105

106106
gomega.RegisterFailHandler(ginkgo.Fail)

e2e/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.22.0
55
require (
66
github.com/onsi/ginkgo/v2 v2.17.1
77
github.com/onsi/gomega v1.32.0
8-
github.com/runfinch/common-tests v0.7.15
8+
github.com/runfinch/common-tests v0.7.20
99
)
1010

1111
require (

e2e/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk=
1919
github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg=
2020
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
2121
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
22-
github.com/runfinch/common-tests v0.7.15 h1:gLYjCyYen0n0mImAefQaPxG+ARaLujQVIX7LiF9RycI=
23-
github.com/runfinch/common-tests v0.7.15/go.mod h1:4JVWZRyjSQ5+X9DRP4tg/Uvxi80AK8pOoe0qrBDi4y4=
22+
github.com/runfinch/common-tests v0.7.20 h1:GPb42S81eTWYffCSQl8puwurCGrDJqcgCJ9moivujS0=
23+
github.com/runfinch/common-tests v0.7.20/go.mod h1:Gp3zzIUg1B0gM8TpiAlPxZpbyZneKyRFyBJ6PLODrOQ=
2424
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
2525
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
2626
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=

0 commit comments

Comments
 (0)