Skip to content

Commit

Permalink
Fix 32bit-x86 typo in testsuite
Browse files Browse the repository at this point in the history
The GOARCH here is 386 not i386. This caused a slightly odd test
suite failure on that architecture:

--- FAIL: TestPlatformPrepareCommand (0.00s)
     plugin_test.go:45: Expected arg="os-arch", got "linux-s390x"
     plugin_test.go:64: Expected arg="os-arch", got "linux-s390x"

Signed-off-by: Dirk Müller <dirk@dmllr.de>
(cherry picked from commit 1fc8369)
  • Loading branch information
dirkmueller authored and mattfarina committed Apr 11, 2023
1 parent 88b2db4 commit 272f6b9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/plugin/plugin_test.go
Expand Up @@ -86,7 +86,7 @@ func TestPlatformPrepareCommand(t *testing.T) {
Name: "test",
Command: "echo -n os-arch",
PlatformCommand: []PlatformCommand{
{OperatingSystem: "linux", Architecture: "i386", Command: "echo -n linux-i386"},
{OperatingSystem: "linux", Architecture: "386", Command: "echo -n linux-386"},
{OperatingSystem: "linux", Architecture: "amd64", Command: "echo -n linux-amd64"},
{OperatingSystem: "linux", Architecture: "arm64", Command: "echo -n linux-arm64"},
{OperatingSystem: "linux", Architecture: "ppc64le", Command: "echo -n linux-ppc64le"},
Expand All @@ -98,8 +98,8 @@ func TestPlatformPrepareCommand(t *testing.T) {
var osStrCmp string
os := runtime.GOOS
arch := runtime.GOARCH
if os == "linux" && arch == "i386" {
osStrCmp = "linux-i386"
if os == "linux" && arch == "386" {
osStrCmp = "linux-386"
} else if os == "linux" && arch == "amd64" {
osStrCmp = "linux-amd64"
} else if os == "linux" && arch == "arm64" {
Expand All @@ -125,7 +125,7 @@ func TestPartialPlatformPrepareCommand(t *testing.T) {
Name: "test",
Command: "echo -n os-arch",
PlatformCommand: []PlatformCommand{
{OperatingSystem: "linux", Architecture: "i386", Command: "echo -n linux-i386"},
{OperatingSystem: "linux", Architecture: "386", Command: "echo -n linux-386"},
{OperatingSystem: "windows", Architecture: "amd64", Command: "echo -n win-64"},
},
},
Expand All @@ -134,7 +134,7 @@ func TestPartialPlatformPrepareCommand(t *testing.T) {
os := runtime.GOOS
arch := runtime.GOARCH
if os == "linux" {
osStrCmp = "linux-i386"
osStrCmp = "linux-386"
} else if os == "windows" && arch == "amd64" {
osStrCmp = "win-64"
} else {
Expand Down Expand Up @@ -166,7 +166,7 @@ func TestNoMatchPrepareCommand(t *testing.T) {
Metadata: &Metadata{
Name: "test",
PlatformCommand: []PlatformCommand{
{OperatingSystem: "no-os", Architecture: "amd64", Command: "echo -n linux-i386"},
{OperatingSystem: "no-os", Architecture: "amd64", Command: "echo -n linux-386"},
},
},
}
Expand Down

0 comments on commit 272f6b9

Please sign in to comment.