-
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
d57144d
commit 1cabf0e
Showing
21 changed files
with
1,847 additions
and
8 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
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
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,21 +367,28 @@ 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.OptAppendEnv("HTTPS_PROXY=none://"), // simulate lack of network connection | ||
e2e.OptArgs("checkout", tgz), | ||
e2e.OptAppendEnv( | ||
"HTTPS_PROXY=none://", // simulate lack of network connection | ||
constants.InstallInternalDependenciesEnvVarName+"=true", | ||
), | ||
) | ||
cp.Expect("Checking out project: ActiveState-CLI/AlmostEmpty") | ||
cp.Expect("Setting up the following dependencies:") | ||
cp.Expect("└─ [email protected]") | ||
cp.Expect("Sourcing Runtime") | ||
cp.Expect("Unpacking") | ||
cp.Expect("Installing") | ||
|
Binary file added
BIN
+316 Bytes
...gration/testdata/checkout-from-archive/darwin/4cfa45d0-ec48-524f-9f46-90c60bfb51ac.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": "zlib", | ||
"namespace": "shared" | ||
} | ||
], | ||
"solver_version": null | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.