platforms: fill default arm variant when parse platform specifier
arm has been supported, but something is missing, causes test failure
--- FAIL: TestParseSelector/linux (0.00s)
platforms_test.go:292: arm support not fully implemented: not implemented
--- FAIL: TestParseSelector/macOS (0.00s)
platforms_test.go:292: arm support not fully implemented: not implemented
Signed-off-by: Shengjing Zhu <zhsj@debian.org>
This commit is contained in:
@@ -26,10 +26,15 @@ import (
|
||||
|
||||
func TestParseSelector(t *testing.T) {
|
||||
var (
|
||||
defaultOS = runtime.GOOS
|
||||
defaultArch = runtime.GOARCH
|
||||
defaultOS = runtime.GOOS
|
||||
defaultArch = runtime.GOARCH
|
||||
defaultVariant = ""
|
||||
)
|
||||
|
||||
if defaultArch == "arm" && cpuVariant != "v7" {
|
||||
defaultVariant = cpuVariant
|
||||
}
|
||||
|
||||
for _, testcase := range []struct {
|
||||
skip bool
|
||||
input string
|
||||
@@ -255,8 +260,9 @@ func TestParseSelector(t *testing.T) {
|
||||
expected: specs.Platform{
|
||||
OS: "linux",
|
||||
Architecture: defaultArch,
|
||||
Variant: defaultVariant,
|
||||
},
|
||||
formatted: joinNotEmpty("linux", defaultArch),
|
||||
formatted: joinNotEmpty("linux", defaultArch, defaultVariant),
|
||||
},
|
||||
{
|
||||
input: "s390x",
|
||||
@@ -279,8 +285,9 @@ func TestParseSelector(t *testing.T) {
|
||||
expected: specs.Platform{
|
||||
OS: "darwin",
|
||||
Architecture: defaultArch,
|
||||
Variant: defaultVariant,
|
||||
},
|
||||
formatted: joinNotEmpty("darwin", defaultArch),
|
||||
formatted: joinNotEmpty("darwin", defaultArch, defaultVariant),
|
||||
},
|
||||
} {
|
||||
t.Run(testcase.input, func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user