Skip to content

Commit dbdf3bb

Browse files
committed
Try alternate approach for skipping ARM integration tests
1 parent 58a6855 commit dbdf3bb

File tree

3 files changed

+22
-21
lines changed

3 files changed

+22
-21
lines changed

internal/testhelpers/tagsuite/tagsuite.go

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,30 @@ type Suite struct {
9696
suite.Suite
9797
}
9898

99+
// ARM-supported tags for integration tests
100+
var armSupportedTags = []string{
101+
Install,
102+
Installer,
103+
InstallScripts,
104+
Update,
105+
}
106+
99107
// OnlyRunForTags skips a test unless one of the given tags is asked for.
100108
func (suite *Suite) OnlyRunForTags(tags ...string) {
109+
// Skip tests on ARM64 if they don't have an ARM-supported tag
110+
if runtime.GOOS == "linux" && runtime.GOARCH == "arm64" {
111+
hasArmSupportedTag := false
112+
for _, tag := range tags {
113+
if funk.Contains(armSupportedTags, tag) {
114+
hasArmSupportedTag = true
115+
break
116+
}
117+
}
118+
if !hasArmSupportedTag {
119+
suite.T().Skipf("Skipping test on Linux/arm64 - only tags %s are supported", strings.Join(armSupportedTags, ", "))
120+
}
121+
}
122+
101123
setTagsString, _ := os.LookupEnv("TEST_SUITE_TAGS")
102124

103125
setTags := strings.Split(strings.ToLower(setTagsString), ":")
@@ -114,10 +136,3 @@ func (suite *Suite) OnlyRunForTags(tags ...string) {
114136

115137
suite.T().Skipf("Run only if any of the following tags are set: %s", strings.Join(tags, ", "))
116138
}
117-
118-
// SkipUnsupportedArchitectures will skip tests for unsupported system architectures
119-
func (suite *Suite) SkipUnsupportedArchitectures() {
120-
if runtime.GOOS == "linux" && runtime.GOARCH == "arm64" {
121-
suite.T().Skip("Skipping test on Linux/arm64 - platform not configured")
122-
}
123-
}

test/integration/deploy_int_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ func (suite *DeployIntegrationTestSuite) deploy(ts *e2e.Session, prj string, tar
6767

6868
func (suite *DeployIntegrationTestSuite) TestDeployPerl() {
6969
suite.OnlyRunForTags(tagsuite.Perl, tagsuite.Deploy)
70-
suite.SkipUnsupportedArchitectures()
7170
if !e2e.RunningOnCI() {
7271
suite.T().Skipf("Skipping DeployIntegrationTestSuite when not running on CI, as it modifies bashrc/registry")
7372
}
@@ -144,7 +143,6 @@ func (suite *DeployIntegrationTestSuite) checkSymlink(name string, binDir, targe
144143

145144
func (suite *DeployIntegrationTestSuite) TestDeployPython() {
146145
suite.OnlyRunForTags(tagsuite.Deploy, tagsuite.Python, tagsuite.Critical)
147-
suite.SkipUnsupportedArchitectures()
148146
if !e2e.RunningOnCI() {
149147
suite.T().Skipf("Skipping DeployIntegrationTestSuite when not running on CI, as it modifies bashrc/registry")
150148
}
@@ -213,7 +211,6 @@ func (suite *DeployIntegrationTestSuite) TestDeployPython() {
213211

214212
func (suite *DeployIntegrationTestSuite) TestDeployInstall() {
215213
suite.OnlyRunForTags(tagsuite.Deploy)
216-
suite.SkipUnsupportedArchitectures()
217214
if !e2e.RunningOnCI() {
218215
suite.T().Skipf("Skipping DeployIntegrationTestSuite when not running on CI, as it modifies bashrc/registry")
219216
}
@@ -247,7 +244,6 @@ func (suite *DeployIntegrationTestSuite) InstallAndAssert(ts *e2e.Session, targe
247244

248245
func (suite *DeployIntegrationTestSuite) TestDeployConfigure() {
249246
suite.OnlyRunForTags(tagsuite.Deploy)
250-
suite.SkipUnsupportedArchitectures()
251247
if !e2e.RunningOnCI() {
252248
suite.T().Skipf("Skipping TestDeployConfigure when not running on CI, as it modifies bashrc/registry")
253249
}
@@ -316,7 +312,6 @@ func (suite *DeployIntegrationTestSuite) AssertConfig(ts *e2e.Session, targetID
316312

317313
func (suite *DeployIntegrationTestSuite) TestDeploySymlink() {
318314
suite.OnlyRunForTags(tagsuite.Deploy)
319-
suite.SkipUnsupportedArchitectures()
320315
if runtime.GOOS != "windows" && !e2e.RunningOnCI() {
321316
suite.T().Skipf("Skipping TestDeploySymlink when not running on CI, as it modifies PATH")
322317
}
@@ -354,7 +349,6 @@ func (suite *DeployIntegrationTestSuite) TestDeploySymlink() {
354349

355350
func (suite *DeployIntegrationTestSuite) TestDeployReport() {
356351
suite.OnlyRunForTags(tagsuite.Deploy)
357-
suite.SkipUnsupportedArchitectures()
358352
ts := e2e.New(suite.T(), false)
359353
defer ts.Close()
360354

@@ -383,7 +377,6 @@ func (suite *DeployIntegrationTestSuite) TestDeployReport() {
383377

384378
func (suite *DeployIntegrationTestSuite) TestDeployTwice() {
385379
suite.OnlyRunForTags(tagsuite.Deploy)
386-
suite.SkipUnsupportedArchitectures()
387380
if runtime.GOOS == "darwin" || !e2e.RunningOnCI() {
388381
suite.T().Skipf("Skipping TestDeployTwice when not running on CI or on MacOS, as it modifies PATH")
389382
}
@@ -419,7 +412,6 @@ func (suite *DeployIntegrationTestSuite) TestDeployTwice() {
419412

420413
func (suite *DeployIntegrationTestSuite) TestDeployUninstall() {
421414
suite.OnlyRunForTags(tagsuite.Deploy)
422-
suite.SkipUnsupportedArchitectures()
423415
if !e2e.RunningOnCI() {
424416
suite.T().Skipf("Skipping TestDeployUninstall when not running on CI, as it modifies bashrc/registry")
425417
}

test/integration/use_int_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ type UseIntegrationTestSuite struct {
2323

2424
func (suite *UseIntegrationTestSuite) TestUse() {
2525
suite.OnlyRunForTags(tagsuite.Use)
26-
suite.SkipUnsupportedArchitectures()
2726

2827
ts := e2e.New(suite.T(), false)
2928
defer ts.Close()
@@ -78,7 +77,6 @@ func (suite *UseIntegrationTestSuite) TestUse() {
7877

7978
func (suite *UseIntegrationTestSuite) TestUseCwd() {
8079
suite.OnlyRunForTags(tagsuite.Use)
81-
suite.SkipUnsupportedArchitectures()
8280

8381
ts := e2e.New(suite.T(), false)
8482
defer ts.Close()
@@ -109,7 +107,6 @@ func (suite *UseIntegrationTestSuite) TestUseCwd() {
109107

110108
func (suite *UseIntegrationTestSuite) TestReset() {
111109
suite.OnlyRunForTags(tagsuite.Use)
112-
suite.SkipUnsupportedArchitectures()
113110

114111
ts := e2e.New(suite.T(), false)
115112
defer ts.Close()
@@ -163,7 +160,6 @@ func (suite *UseIntegrationTestSuite) TestReset() {
163160

164161
func (suite *UseIntegrationTestSuite) TestShow() {
165162
suite.OnlyRunForTags(tagsuite.Use)
166-
suite.SkipUnsupportedArchitectures()
167163

168164
ts := e2e.New(suite.T(), false)
169165
defer ts.Close()
@@ -218,7 +214,6 @@ func (suite *UseIntegrationTestSuite) TestShow() {
218214

219215
func (suite *UseIntegrationTestSuite) TestSetupNotice() {
220216
suite.OnlyRunForTags(tagsuite.Use)
221-
suite.SkipUnsupportedArchitectures()
222217

223218
ts := e2e.New(suite.T(), false)
224219
defer ts.Close()
@@ -241,7 +236,6 @@ func (suite *UseIntegrationTestSuite) TestSetupNotice() {
241236

242237
func (suite *UseIntegrationTestSuite) TestJSON() {
243238
suite.OnlyRunForTags(tagsuite.Use, tagsuite.JSON)
244-
suite.SkipUnsupportedArchitectures()
245239

246240
ts := e2e.New(suite.T(), false)
247241
defer ts.Close()

0 commit comments

Comments
 (0)