@@ -2,6 +2,7 @@ package cache
2
2
3
3
import (
4
4
"fmt"
5
+ "runtime"
5
6
"testing"
6
7
7
8
"github.com/stretchr/testify/assert"
@@ -86,6 +87,8 @@ func TestCache_Get_missing_data(t *testing.T) {
86
87
}
87
88
88
89
func TestCache_buildKey (t * testing.T ) {
90
+ skipNotAmd64 (t )
91
+
89
92
pkgCache := setupCache (t )
90
93
91
94
pkg := fakePackage ()
@@ -97,6 +100,10 @@ func TestCache_buildKey(t *testing.T) {
97
100
}
98
101
99
102
func TestCache_pkgActionID (t * testing.T ) {
103
+ if runtime .GOARCH != "amd64" {
104
+ t .Skip ("skipping test because cache values change on arm64" )
105
+ }
106
+
100
107
pkgCache := setupCache (t )
101
108
102
109
pkg := fakePackage ()
@@ -108,6 +115,8 @@ func TestCache_pkgActionID(t *testing.T) {
108
115
}
109
116
110
117
func TestCache_packageHash_load (t * testing.T ) {
118
+ skipNotAmd64 (t )
119
+
111
120
pkgCache := setupCache (t )
112
121
113
122
pkg := fakePackage ()
@@ -121,6 +130,8 @@ func TestCache_packageHash_load(t *testing.T) {
121
130
}
122
131
123
132
func TestCache_packageHash_store (t * testing.T ) {
133
+ skipNotAmd64 (t )
134
+
124
135
pkgCache := setupCache (t )
125
136
126
137
pkg := fakePackage ()
@@ -143,6 +154,8 @@ func TestCache_packageHash_store(t *testing.T) {
143
154
}
144
155
145
156
func TestCache_computeHash (t * testing.T ) {
157
+ skipNotAmd64 (t )
158
+
146
159
pkgCache := setupCache (t )
147
160
148
161
pkg := fakePackage ()
@@ -156,3 +169,11 @@ func TestCache_computeHash(t *testing.T) {
156
169
assert .Equal (t , "f1288ac9e75477e1ed42c06ba7d78213ed3cc52799c01a4f695bc54cd4e8a698" , results [HashModeNeedDirectDeps ])
157
170
assert .Equal (t , "11d5b95830a3d86ad6dcac15b0adb46f686a30f1633cc1b74f7133d093da7979" , results [HashModeNeedAllDeps ])
158
171
}
172
+
173
+ func skipNotAmd64 (t * testing.T ) {
174
+ t .Helper ()
175
+
176
+ if runtime .GOARCH != "amd64" {
177
+ t .Skip ("skipping test because cache values change on arm64" )
178
+ }
179
+ }
0 commit comments