Skip to content

Commit

Permalink
remove freeport
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Abro <[email protected]>
  • Loading branch information
AustinAbro321 committed Aug 12, 2024
1 parent a464660 commit f3739dc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ require (
github.com/mholt/archiver/v3 v3.5.1
github.com/moby/moby v24.0.9+incompatible
github.com/opencontainers/image-spec v1.1.0
github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.18.0
github.com/pterm/pterm v0.12.79
Expand Down
9 changes: 2 additions & 7 deletions src/test/e2e/50_oci_publish_deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (

"github.com/defenseunicorns/pkg/oci"
_ "github.com/distribution/distribution/v3/registry/storage/driver/inmemory" // used for docker test registry
"github.com/phayes/freeport"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/zarf-dev/zarf/src/pkg/zoci"
Expand All @@ -38,9 +37,7 @@ var badDeployRef = registry.Reference{
func (suite *PublishDeploySuiteTestSuite) SetupSuite() {
suite.Assertions = require.New(suite.T())
suite.PackagesDir = "build"
port, err := freeport.GetFreePort()
suite.NoError(err)
suite.Reference.Registry = testutil.SetupInMemoryRegistry(testutil.TestContext(suite.T()), suite.T(), port)
suite.Reference.Registry = testutil.SetupInMemoryRegistry(testutil.TestContext(suite.T()), suite.T(), 31889)
}

func (suite *PublishDeploySuiteTestSuite) TearDownSuite() {
Expand Down Expand Up @@ -123,9 +120,7 @@ func (suite *PublishDeploySuiteTestSuite) Test_2_Pull_And_Deploy() {
func (suite *PublishDeploySuiteTestSuite) Test_3_Copy() {
t := suite.T()
ref := suite.Reference.String()
port, err := freeport.GetFreePort()
suite.NoError(err)
dstRegistry := testutil.SetupInMemoryRegistry(testutil.TestContext(t), t, port)
dstRegistry := testutil.SetupInMemoryRegistry(testutil.TestContext(t), t, 31890)
dstRef := strings.Replace(ref, suite.Reference.Registry, dstRegistry, 1)

src, err := zoci.NewRemote(ref, oci.PlatformForArch(e2e.Arch), oci.WithPlainHTTP(true))
Expand Down
1 change: 1 addition & 0 deletions src/test/e2e/51_oci_compose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ var (
func (suite *SkeletonSuite) SetupSuite() {
suite.Assertions = require.New(suite.T())

// This port must match the registry URL in 51-import-everything/zarf.yaml
suite.Reference.Registry = testutil.SetupInMemoryRegistry(testutil.TestContext(suite.T()), suite.T(), 31888)
// Setup the package paths after e2e has been initialized
importEverythingPath = filepath.Join("build", fmt.Sprintf("zarf-package-import-everything-%s-0.0.1.tar.zst", e2e.Arch))
Expand Down

0 comments on commit f3739dc

Please sign in to comment.