Skip to content

Commit

Permalink
gobin: fix unit test when run on ARM64
Browse files Browse the repository at this point in the history
Unit test builds and scans a layer containing a go executable.
Clair doesn't scan eg. Mac ARM64 go executables, so this test would fail when run on an ARM Mac

Signed-off-by: Mark Frost <[email protected]>
  • Loading branch information
frostmar authored and hdonnay committed Jul 31, 2023
1 parent 9c88f39 commit 52c374d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions gobin/gobin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func TestScanner(t *testing.T) {
// Build a go binary.
outname := filepath.Join(tmpdir, "bisect")
cmd := exec.CommandContext(ctx, "go", "build", "-o", outname, "github.com/quay/claircore/test/bisect")
cmd.Env = append(cmd.Environ(), "GOOS=linux", "GOARCH=amd64") // build a Linux amd64 ELF exe, supported by clair. Unit tests may be running on another architecture
out, err := cmd.CombinedOutput()
if len(out) != 0 {
t.Logf("%q", string(out))
Expand Down

0 comments on commit 52c374d

Please sign in to comment.