Skip to content

Commit cfd8f88

Browse files
Merge pull request #1156 from hongkailiu/unit-test-on-mac
NO-JIRA: Fix a few AMD64-oriented tests on Non-AMD64 machines
2 parents 57247f8 + 4d13e32 commit cfd8f88

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

pkg/cvo/availableupdates_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
"net/http"
88
"net/http/httptest"
9+
"runtime"
910
"testing"
1011
"time"
1112

@@ -125,7 +126,7 @@ func newOperator(url, version string, promqlMock clusterconditions.Condition) (*
125126
release: currentRelease,
126127
}
127128
availableUpdates := &availableUpdates{
128-
Architecture: "amd64",
129+
Architecture: runtime.GOARCH,
129130
Current: configv1.Release{Version: version, Image: "payload/" + version},
130131
}
131132
return availableUpdates, operator

pkg/cvo/cvo_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2357,7 +2357,7 @@ func TestOperator_availableUpdatesSync(t *testing.T) {
23572357
wantUpdates: &availableUpdates{
23582358
UpdateService: "",
23592359
Channel: "fast",
2360-
Architecture: "amd64",
2360+
Architecture: runtime.GOARCH,
23612361
Condition: configv1.ClusterOperatorStatusCondition{
23622362
Type: configv1.RetrievedUpdates,
23632363
Status: configv1.ConditionFalse,
@@ -2400,7 +2400,7 @@ func TestOperator_availableUpdatesSync(t *testing.T) {
24002400
wantUpdates: &availableUpdates{
24012401
UpdateService: "http://localhost:8080/graph",
24022402
Channel: "",
2403-
Architecture: "amd64",
2403+
Architecture: runtime.GOARCH,
24042404
Condition: configv1.ClusterOperatorStatusCondition{
24052405
Type: configv1.RetrievedUpdates,
24062406
Status: configv1.ConditionFalse,
@@ -2442,7 +2442,7 @@ func TestOperator_availableUpdatesSync(t *testing.T) {
24422442
wantUpdates: &availableUpdates{
24432443
UpdateService: "http://localhost:8080/graph",
24442444
Channel: "fast",
2445-
Architecture: "amd64",
2445+
Architecture: runtime.GOARCH,
24462446
Condition: configv1.ClusterOperatorStatusCondition{
24472447
Type: configv1.RetrievedUpdates,
24482448
Status: configv1.ConditionFalse,
@@ -2491,7 +2491,7 @@ func TestOperator_availableUpdatesSync(t *testing.T) {
24912491
wantUpdates: &availableUpdates{
24922492
UpdateService: "http://localhost:8080/graph",
24932493
Channel: "fast",
2494-
Architecture: "amd64",
2494+
Architecture: runtime.GOARCH,
24952495
Condition: configv1.ClusterOperatorStatusCondition{
24962496
Type: configv1.RetrievedUpdates,
24972497
Status: configv1.ConditionFalse,
@@ -2555,7 +2555,7 @@ func TestOperator_availableUpdatesSync(t *testing.T) {
25552555
wantUpdates: &availableUpdates{
25562556
UpdateService: "http://localhost:8080/graph",
25572557
Channel: "fast",
2558-
Architecture: "amd64",
2558+
Architecture: runtime.GOARCH,
25592559
Current: configv1.Release{
25602560
Version: "4.0.1",
25612561
Image: "image/image:v4.0.1",
@@ -2622,7 +2622,7 @@ func TestOperator_availableUpdatesSync(t *testing.T) {
26222622
wantUpdates: &availableUpdates{
26232623
UpdateService: "http://localhost:8080/graph",
26242624
Channel: "fast",
2625-
Architecture: "amd64",
2625+
Architecture: runtime.GOARCH,
26262626
Current: configv1.Release{Version: "4.0.1", Image: "image/image:v4.0.1"},
26272627
Updates: []configv1.Release{
26282628
{Version: "4.0.2", Image: "image/image:v4.0.2"},
@@ -2723,7 +2723,7 @@ func TestOperator_availableUpdatesSync(t *testing.T) {
27232723
wantUpdates: &availableUpdates{
27242724
UpdateService: "http://localhost:8080/graph",
27252725
Channel: "fast",
2726-
Architecture: "amd64",
2726+
Architecture: runtime.GOARCH,
27272727
Condition: configv1.ClusterOperatorStatusCondition{
27282728
Type: configv1.RetrievedUpdates,
27292729
Status: configv1.ConditionFalse,

0 commit comments

Comments
 (0)