From 88eca7a268950d45f1170bbe59e0267701184cc1 Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Thu, 18 Jul 2024 13:15:31 +1000 Subject: [PATCH] Remove ability to set version outside of env --- test/octopus_container_test_framework.go | 6 +----- test/octopus_container_test_framework_test.go | 11 ----------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/test/octopus_container_test_framework.go b/test/octopus_container_test_framework.go index 460df8b..7eadc46 100644 --- a/test/octopus_container_test_framework.go +++ b/test/octopus_container_test_framework.go @@ -60,7 +60,6 @@ func (g *TestLogConsumer) Accept(l testcontainers.Log) { var globalMutex = sync.Mutex{} type OctopusContainerTest struct { - OctopusVersion string CustomEnvironment map[string]string } @@ -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 @@ -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") diff --git a/test/octopus_container_test_framework_test.go b/test/octopus_container_test_framework_test.go index 68962a6..5bae98d 100644 --- a/test/octopus_container_test_framework_test.go +++ b/test/octopus_container_test_framework_test.go @@ -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) - } -}