Skip to content

Commit 65777bc

Browse files
committed
Added tests for projects that utilize solver V2 and solver V3.
1 parent e554f37 commit 65777bc

File tree

2 files changed

+129
-0
lines changed

2 files changed

+129
-0
lines changed

internal/testhelpers/tagsuite/tagsuite.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ const (
7979
Service = "service"
8080
Shell = "shell"
8181
Show = "show"
82+
SolverV2 = "solver-v2"
83+
SolverV3 = "solver-v3"
8284
Switch = "switch"
8385
Uninstall = "uninstall"
8486
Upgrade = "upgrade"

test/integration/install_int_test.go

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package integration
22

33
import (
4+
"path/filepath"
45
"strings"
56
"testing"
67

@@ -131,6 +132,132 @@ func (suite *InstallIntegrationTestSuite) TestInstall_Resolved() {
131132
cp.ExpectExitCode(0)
132133
}
133134

135+
func (suite *InstallIntegrationTestSuite) TestInstall_SolverV2() {
136+
suite.OnlyRunForTags(tagsuite.Install, tagsuite.SolverV2)
137+
ts := e2e.New(suite.T(), false)
138+
defer ts.Close()
139+
140+
tests := []struct {
141+
Name string
142+
Namespace string
143+
Package string
144+
ExpectedFail bool
145+
}{
146+
{
147+
"Python-Camel",
148+
"ActiveState-CLI/Python3#971e48e4-7f9b-44e6-ad48-86cd03ffc12d",
149+
"requests",
150+
false,
151+
},
152+
{
153+
"Python-Alternative",
154+
"ActiveState-CLI/Python3-Alternative#c2b3f176-4788-479c-aad3-8359d28ba3ce",
155+
"requests",
156+
false,
157+
},
158+
{
159+
"Perl-Camel",
160+
"ActiveState-CLI/Perl#a0a1692e-d999-4763-b933-2d0d5758bf12",
161+
"JSON",
162+
false,
163+
},
164+
{
165+
"Perl-Alternative",
166+
"ActiveState-CLI/Perl-Alternative#ccc57e0b-fccf-41c1-8e1c-24f4de2e55fa",
167+
"JSON",
168+
false,
169+
},
170+
{
171+
"Ruby-Alternative",
172+
"ActiveState-CLI/ruby#b6540776-7f2c-461b-8924-77fe46669209",
173+
"base64",
174+
false,
175+
},
176+
}
177+
178+
for _, tt := range tests {
179+
suite.Run(tt.Name, func() {
180+
ts := e2e.New(suite.T(), false)
181+
defer ts.Close()
182+
183+
cp := ts.Spawn("config", "set", constants.AsyncRuntimeConfig, "true")
184+
cp.ExpectExitCode(0)
185+
186+
cp = ts.Spawn("checkout", tt.Namespace, tt.Name)
187+
if !tt.ExpectedFail {
188+
cp.ExpectExitCode(0)
189+
} else {
190+
cp.ExpectNotExitCode(0)
191+
return
192+
}
193+
194+
cp = ts.SpawnWithOpts(
195+
e2e.OptArgs("install", tt.Package),
196+
e2e.OptWD(filepath.Join(ts.Dirs.Work, tt.Name)),
197+
)
198+
cp.ExpectExitCode(0, e2e.RuntimeSolvingTimeoutOpt)
199+
})
200+
}
201+
202+
}
203+
204+
func (suite *InstallIntegrationTestSuite) TestInstall_SolverV3() {
205+
suite.OnlyRunForTags(tagsuite.Install, tagsuite.SolverV3)
206+
ts := e2e.New(suite.T(), false)
207+
defer ts.Close()
208+
209+
tests := []struct {
210+
Name string
211+
Namespace string
212+
Package string
213+
ExpectedFail bool
214+
}{
215+
{
216+
"Python",
217+
"ActiveState-CLI/Python3-Alternative-V3#354efec1-eaa3-4f41-bc50-08fdbf076628",
218+
"requests",
219+
false,
220+
},
221+
{
222+
"Perl",
223+
"ActiveState-CLI/Perl-Alternative-V3#3d66ff94-72be-43ce-b3d8-897bb6758cf0",
224+
"JSON",
225+
false,
226+
},
227+
{
228+
"Ruby",
229+
"ActiveState-CLI/ruby-V3#6db5b307-d63a-45e2-9d3b-70a1a1f6c10a",
230+
"base64",
231+
true,
232+
},
233+
}
234+
235+
for _, tt := range tests {
236+
suite.Run(tt.Name, func() {
237+
ts := e2e.New(suite.T(), false)
238+
defer ts.Close()
239+
240+
cp := ts.Spawn("config", "set", constants.AsyncRuntimeConfig, "true")
241+
cp.ExpectExitCode(0)
242+
243+
cp = ts.Spawn("checkout", tt.Namespace, tt.Name)
244+
if !tt.ExpectedFail {
245+
cp.ExpectExitCode(0)
246+
} else {
247+
cp.ExpectNotExitCode(0)
248+
return
249+
}
250+
251+
cp = ts.SpawnWithOpts(
252+
e2e.OptArgs("install", tt.Package),
253+
e2e.OptWD(filepath.Join(ts.Dirs.Work, tt.Name)),
254+
)
255+
cp.ExpectExitCode(0, e2e.RuntimeSolvingTimeoutOpt)
256+
})
257+
}
258+
259+
}
260+
134261
func TestInstallIntegrationTestSuite(t *testing.T) {
135262
suite.Run(t, new(InstallIntegrationTestSuite))
136263
}

0 commit comments

Comments
 (0)