Skip to content

Commit

Permalink
Merge pull request #3555 from ActiveState/mitchell/dx-3057-2
Browse files Browse the repository at this point in the history
Re-enable CheckoutFromArchive test.
  • Loading branch information
mitchell-as authored Oct 25, 2024
2 parents a86d14d + fa3b0b2 commit 8158813
Show file tree
Hide file tree
Showing 22 changed files with 1,685 additions and 11 deletions.
22 changes: 11 additions & 11 deletions test/integration/checkout_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"strings"
"testing"

"github.com/mholt/archiver/v3"

"github.com/ActiveState/cli/internal/constants"
"github.com/ActiveState/cli/internal/environment"
"github.com/ActiveState/cli/internal/fileutils"
Expand Down Expand Up @@ -365,34 +367,32 @@ func (suite *CheckoutIntegrationTestSuite) TestCveReport() {
}

func (suite *CheckoutIntegrationTestSuite) TestCheckoutFromArchive() {
suite.T().Skip("Skipping until https://activestatef.atlassian.net/browse/DX-3057 is fixed")
suite.OnlyRunForTags(tagsuite.Checkout)
ts := e2e.New(suite.T(), false)
defer ts.Close()

root := environment.GetRootPathUnsafe()
archive := filepath.Join(root, "test", "integration", "testdata", "checkout-from-archive", runtime.GOOS+".tar.gz")
dir := filepath.Join(root, "test", "integration", "testdata", "checkout-from-archive", runtime.GOOS)
tgz := fileutils.TempFilePath("", runtime.GOOS+".tar.gz")
files, err := fileutils.ListDirSimple(dir, false)
suite.Require().NoError(err)
gz := archiver.TarGz{Tar: &archiver.Tar{StripComponents: 1000}} // use a big number to strip all leading dirs
suite.Require().NoError(gz.Archive(files, tgz))
defer os.Remove(tgz)

cp := ts.SpawnWithOpts(
e2e.OptArgs("checkout", archive),
e2e.OptArgs("checkout", tgz),
e2e.OptAppendEnv("HTTPS_PROXY=none://"), // simulate lack of network connection
)
cp.Expect("Checking out project: ActiveState-CLI/AlmostEmpty")
cp.Expect("Setting up the following dependencies:")
cp.Expect("└─ [email protected].1")
cp.Expect("└─ [email protected].1")
cp.Expect("Sourcing Runtime")
cp.Expect("Unpacking")
cp.Expect("Installing")
cp.Expect("All dependencies have been installed and verified")
cp.Expect("Checked out project ActiveState-CLI/AlmostEmpty")
cp.ExpectExitCode(0)

// Verify the zlib runtime files exist.
proj, err := project.FromPath(filepath.Join(ts.Dirs.Work, "AlmostEmpty"))
suite.Require().NoError(err)
cachePath := filepath.Join(ts.Dirs.Cache, runtime_helpers.DirNameFromProjectDir(proj.Dir()))
zlibH := filepath.Join(cachePath, "usr", "include", "zlib.h")
suite.Assert().FileExists(zlibH, "zlib.h does not exist")
}

func TestCheckoutIntegrationTestSuite(t *testing.T) {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"let": {
"in": "$runtime",
"runtime": {
"state_tool_artifacts_v1": {
"build_flags": [],
"src": "$sources"
}
},
"sources": {
"solve": {
"at_time": "$at_time",
"platforms": [
"46a5b48f-226a-4696-9746-ba4d50d661c2",
"78977bc8-0f32-519d-80f3-9043f059398c",
"7c998ec2-7491-4e75-be4d-8885800ef5f2"
],
"requirements": [
{
"name": "alternative-build-selector",
"namespace": "internal"
},
{
"name": "mingw-build-selector",
"namespace": "internal"
},
{
"name": "provides_hello",
"namespace": "private/ActiveState-CLI"
}
],
"solver_version": null
}
}
}
}
Loading

0 comments on commit 8158813

Please sign in to comment.