-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a86d14d
commit fa3b0b2
Showing
22 changed files
with
1,685 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
|
@@ -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) { | ||
|
Binary file not shown.
Binary file added
BIN
+316 Bytes
...gration/testdata/checkout-from-archive/darwin/4cfa45d0-ec48-524f-9f46-90c60bfb51ac.tar.gz
Binary file not shown.
Binary file added
BIN
+316 Bytes
...gration/testdata/checkout-from-archive/darwin/bd3cdcd1-7b6c-5e5e-b144-6fa17dc28120.tar.gz
Binary file not shown.
36 changes: 36 additions & 0 deletions
36
test/integration/testdata/checkout-from-archive/darwin/buildexpression.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.