|
1 | 1 | package integration |
2 | 2 |
|
3 | 3 | import ( |
| 4 | + "path/filepath" |
4 | 5 | "strings" |
5 | 6 | "testing" |
6 | 7 |
|
@@ -131,6 +132,130 @@ func (suite *InstallIntegrationTestSuite) TestInstall_Resolved() { |
131 | 132 | cp.ExpectExitCode(0) |
132 | 133 | } |
133 | 134 |
|
| 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 | + cp := ts.Spawn("config", "set", constants.AsyncRuntimeConfig, "true") |
| 179 | + cp.ExpectExitCode(0) |
| 180 | + |
| 181 | + for _, tt := range tests { |
| 182 | + suite.Run(tt.Name, func() { |
| 183 | + ts := e2e.New(suite.T(), false) |
| 184 | + defer ts.Close() |
| 185 | + |
| 186 | + cp = ts.Spawn("checkout", tt.Namespace, tt.Name) |
| 187 | + cp.ExpectExitCode(0) |
| 188 | + |
| 189 | + cp = ts.SpawnWithOpts( |
| 190 | + e2e.OptArgs("install", tt.Package), |
| 191 | + e2e.OptWD(filepath.Join(ts.Dirs.Work, tt.Name)), |
| 192 | + ) |
| 193 | + if !tt.ExpectedFail { |
| 194 | + cp.ExpectExitCode(0, e2e.RuntimeSolvingTimeoutOpt) |
| 195 | + } else { |
| 196 | + cp.ExpectNotExitCode(0, e2e.RuntimeSolvingTimeoutOpt) |
| 197 | + } |
| 198 | + }) |
| 199 | + } |
| 200 | + |
| 201 | +} |
| 202 | + |
| 203 | +func (suite *InstallIntegrationTestSuite) TestInstall_SolverV3() { |
| 204 | + suite.OnlyRunForTags(tagsuite.Install, tagsuite.SolverV3) |
| 205 | + ts := e2e.New(suite.T(), false) |
| 206 | + defer ts.Close() |
| 207 | + |
| 208 | + tests := []struct { |
| 209 | + Name string |
| 210 | + Namespace string |
| 211 | + Package string |
| 212 | + ExpectedFail bool |
| 213 | + }{ |
| 214 | + { |
| 215 | + "Python", |
| 216 | + "ActiveState-CLI/Python3-Alternative-V3#c2b3f176-4788-479c-aad3-8359d28ba3ce", |
| 217 | + "requests", |
| 218 | + false, |
| 219 | + }, |
| 220 | + { |
| 221 | + "Perl", |
| 222 | + "ActiveState-CLI/Perl-Alternative-V3#ccc57e0b-fccf-41c1-8e1c-24f4de2e55fa", |
| 223 | + "JSON", |
| 224 | + false, |
| 225 | + }, |
| 226 | + { |
| 227 | + "Ruby", |
| 228 | + "ActiveState-CLI/ruby-V3#b6540776-7f2c-461b-8924-77fe46669209", |
| 229 | + "base64", |
| 230 | + true, |
| 231 | + }, |
| 232 | + } |
| 233 | + |
| 234 | + for _, tt := range tests { |
| 235 | + suite.Run(tt.Name, func() { |
| 236 | + ts := e2e.New(suite.T(), false) |
| 237 | + defer ts.Close() |
| 238 | + |
| 239 | + cp := ts.Spawn("config", "set", constants.AsyncRuntimeConfig, "true") |
| 240 | + cp.ExpectExitCode(0) |
| 241 | + |
| 242 | + cp = ts.Spawn("checkout", tt.Namespace, tt.Name) |
| 243 | + cp.ExpectExitCode(0) |
| 244 | + |
| 245 | + cp = ts.SpawnWithOpts( |
| 246 | + e2e.OptArgs("install", tt.Package), |
| 247 | + e2e.OptWD(filepath.Join(ts.Dirs.Work, tt.Name)), |
| 248 | + ) |
| 249 | + if !tt.ExpectedFail { |
| 250 | + cp.ExpectExitCode(0, e2e.RuntimeSolvingTimeoutOpt) |
| 251 | + } else { |
| 252 | + cp.ExpectNotExitCode(0, e2e.RuntimeSolvingTimeoutOpt) |
| 253 | + } |
| 254 | + }) |
| 255 | + } |
| 256 | + |
| 257 | +} |
| 258 | + |
134 | 259 | func TestInstallIntegrationTestSuite(t *testing.T) { |
135 | 260 | suite.Run(t, new(InstallIntegrationTestSuite)) |
136 | 261 | } |
0 commit comments