Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions internal/testhelpers/tagsuite/tagsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ const (
Service = "service"
Shell = "shell"
Show = "show"
SolverV2 = "solver-v2"
SolverV3 = "solver-v3"
Switch = "switch"
Uninstall = "uninstall"
Upgrade = "upgrade"
Expand Down
127 changes: 127 additions & 0 deletions test/integration/install_int_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package integration

import (
"path/filepath"
"strings"
"testing"

Expand Down Expand Up @@ -131,6 +132,132 @@ func (suite *InstallIntegrationTestSuite) TestInstall_Resolved() {
cp.ExpectExitCode(0)
}

func (suite *InstallIntegrationTestSuite) TestInstall_SolverV2() {
suite.OnlyRunForTags(tagsuite.Install, tagsuite.SolverV2)
ts := e2e.New(suite.T(), false)
defer ts.Close()

tests := []struct {
Name string
Namespace string
Package string
ExpectedFail bool
}{
{
"Python-Camel",
"ActiveState-CLI/Python3#971e48e4-7f9b-44e6-ad48-86cd03ffc12d",
"requests",
false,
},
{
"Python-Alternative",
"ActiveState-CLI/Python3-Alternative#c2b3f176-4788-479c-aad3-8359d28ba3ce",
"requests",
false,
},
{
"Perl-Camel",
"ActiveState-CLI/Perl#a0a1692e-d999-4763-b933-2d0d5758bf12",
"JSON",
false,
},
{
"Perl-Alternative",
"ActiveState-CLI/Perl-Alternative#ccc57e0b-fccf-41c1-8e1c-24f4de2e55fa",
"JSON",
false,
},
{
"Ruby-Alternative",
"ActiveState-CLI/ruby#b6540776-7f2c-461b-8924-77fe46669209",
"base64",
false,
},
}

for _, tt := range tests {
suite.Run(tt.Name, func() {
ts := e2e.New(suite.T(), false)
defer ts.Close()

cp := ts.Spawn("config", "set", constants.AsyncRuntimeConfig, "true")
cp.ExpectExitCode(0)

cp = ts.Spawn("checkout", tt.Namespace, tt.Name)
if !tt.ExpectedFail {
cp.ExpectExitCode(0)
} else {
cp.ExpectNotExitCode(0)
return
}

cp = ts.SpawnWithOpts(
e2e.OptArgs("install", tt.Package),
e2e.OptWD(filepath.Join(ts.Dirs.Work, tt.Name)),
)
cp.ExpectExitCode(0, e2e.RuntimeSolvingTimeoutOpt)
})
}

}

func (suite *InstallIntegrationTestSuite) TestInstall_SolverV3() {
suite.OnlyRunForTags(tagsuite.Install, tagsuite.SolverV3)
ts := e2e.New(suite.T(), false)
defer ts.Close()

tests := []struct {
Name string
Namespace string
Package string
ExpectedFail bool
}{
{
"Python",
"ActiveState-CLI/Python3-Alternative-V3#354efec1-eaa3-4f41-bc50-08fdbf076628",
"requests",
false,
},
{
"Perl",
"ActiveState-CLI/Perl-Alternative-V3#3d66ff94-72be-43ce-b3d8-897bb6758cf0",
"JSON",
false,
},
{
"Ruby",
"ActiveState-CLI/ruby-V3#6db5b307-d63a-45e2-9d3b-70a1a1f6c10a",
"base64",
true,
},
}

for _, tt := range tests {
suite.Run(tt.Name, func() {
ts := e2e.New(suite.T(), false)
defer ts.Close()

cp := ts.Spawn("config", "set", constants.AsyncRuntimeConfig, "true")
cp.ExpectExitCode(0)

cp = ts.Spawn("checkout", tt.Namespace, tt.Name)
if !tt.ExpectedFail {
cp.ExpectExitCode(0)
} else {
cp.ExpectNotExitCode(0)
return
}

cp = ts.SpawnWithOpts(
e2e.OptArgs("install", tt.Package),
e2e.OptWD(filepath.Join(ts.Dirs.Work, tt.Name)),
)
cp.ExpectExitCode(0, e2e.RuntimeSolvingTimeoutOpt)
})
}

}

func TestInstallIntegrationTestSuite(t *testing.T) {
suite.Run(t, new(InstallIntegrationTestSuite))
}
Loading