Skip to content

Commit

Permalink
ensure tests pass on arm64
Browse files Browse the repository at this point in the history
Signed-off-by: Joey Brown <brown.joseph@salesforce.com>
  • Loading branch information
joeybrown-sf committed Nov 7, 2024
1 parent 186f89b commit afa3e21
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion local/local_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ func testImage(t *testing.T, when spec.G, it spec.S) {
h.AssertNil(t, err)

// based on static base image refs
expectedTime := time.Date(2018, 10, 2, 17, 19, 34, 239926273, time.UTC)
expectedTime := time.Date(2024, 9, 26, 21, 31, 42, 0, time.UTC)
if daemonOS == "windows" {
expectedTime = time.Date(2020, 03, 04, 13, 28, 48, 673000000, time.UTC)
}
Expand Down
9 changes: 6 additions & 3 deletions remote/remote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,12 @@ func testImage(t *testing.T, when spec.G, it spec.S) {
})

when("base image is a multi-OS/Arch manifest list", func() {
it("returns a base image matching linux/amd64", func() {
it("returns a base image matching linux/architecture", func() {
manifestListName := "golang:1.13.8"
existingLayerSha := "sha256:427da4a135b0869c1a274ba38e23d45bdbda93134c4ad99c8900cb0cfe9f0c9e"
existingLayerDigests := map[string]string{
"amd64": "sha256:427da4a135b0869c1a274ba38e23d45bdbda93134c4ad99c8900cb0cfe9f0c9e",
"arm64": "sha256:c50765ba68c46491618574144955985555c2c7584137e69a0bd1017f411111d2",
}

img, err := remote.NewImage(
repoName,
Expand All @@ -293,7 +296,7 @@ func testImage(t *testing.T, when spec.G, it spec.S) {
h.AssertNil(t, err)
h.AssertEq(t, arch, runtime.GOARCH)

readCloser, err := img.GetLayer(existingLayerSha)
readCloser, err := img.GetLayer(existingLayerDigests[runtime.GOARCH])
h.AssertNil(t, err)
defer readCloser.Close()
})
Expand Down
2 changes: 1 addition & 1 deletion testhelpers/testhelpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ func RunnableBaseImage(os string) string {
// windows/amd64 image from manifest cached on github actions Windows 2019 workers: https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md#docker-images
return "mcr.microsoft.com/windows/nanoserver@sha256:08c883692e527b2bb4d7f6579e7707a30a2aaa66556b265b917177565fd76117"
}
return "busybox@sha256:915f390a8912e16d4beb8689720a17348f3f6d1a7b659697df850ab625ea29d5"
return "busybox@sha256:768e5c6f5cb6db0794eec98dc7a967f40631746c32232b78a3105fb946f3ab83"
}

func StringElementAt(elements []string, offset int) string {
Expand Down

0 comments on commit afa3e21

Please sign in to comment.