Skip to content

Commit

Permalink
Remove ability to set version outside of env
Browse files Browse the repository at this point in the history
  • Loading branch information
rain-on committed Jul 18, 2024
1 parent eec0a1e commit 88eca7a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
6 changes: 1 addition & 5 deletions test/octopus_container_test_framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ func (g *TestLogConsumer) Accept(l testcontainers.Log) {
var globalMutex = sync.Mutex{}

type OctopusContainerTest struct {
OctopusVersion string
CustomEnvironment map[string]string
}

Expand Down Expand Up @@ -155,9 +154,6 @@ func (o *OctopusContainerTest) getOctopusImageUrl() string {
}

func (o *OctopusContainerTest) getOctopusVersion() string {
if o.OctopusVersion != "" {
return o.OctopusVersion
}
overrideOctoTag := os.Getenv("OCTOTESTVERSION")
if overrideOctoTag != "" {
return overrideOctoTag
Expand Down Expand Up @@ -209,7 +205,7 @@ func (o *OctopusContainerTest) setupOctopus(ctx context.Context, connString stri
network,
},
}

req.Env = o.AddCustomEnvironment(req.Env)

log.Println("Creating Octopus container")
Expand Down
11 changes: 0 additions & 11 deletions test/octopus_container_test_framework_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,3 @@ func TestContainerWithNoSpecifiedVersionWillUseLatest(t *testing.T) {
t.Errorf("The OctopusServer version is %v", version)
}
}

func TestContainerVersionCanBeOverridenAtConstruction(t *testing.T) {
sut := OctopusContainerTest{}
sut.OctopusVersion = "ArbitraryVersion"

version := sut.getOctopusVersion()

if version != "ArbitraryVersion" {
t.Errorf("The OctopusServer version is %v", version)
}
}

0 comments on commit 88eca7a

Please sign in to comment.