Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestDispatchArgDefaultBuiltins is failing on arm/v8 #160

Closed
siretart opened this issue May 19, 2020 · 4 comments
Closed

TestDispatchArgDefaultBuiltins is failing on arm/v8 #160

siretart opened this issue May 19, 2020 · 4 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@siretart
Copy link

siretart commented May 19, 2020

I've packaged this project for debian, where we build it on a large number of different platforms. It turns out that the update from verison 1.0 to 1.1.4 broke the test TestDispatchArgDefaultBuiltins on all Arm platforms (links to buildlogs for: arm64, armel, and armhf)

The symptom looks always like this.

=== RUN   TestDispatchArgDefaultBuiltins
    TestDispatchArgDefaultBuiltins: dispatchers_test.go:31: Expected [BUILDARCH=arm64 TARGETPLATFORM=linux/arm64], got [BUILDARCH=arm64 TARGETPLATFORM=linux/arm64/v8]
--- FAIL: TestDispatchArgDefaultBuiltins (0.00s)

This test code is here:

func TestDispatchArgDefaultBuiltins(t *testing.T) {
mybuilder := *NewBuilder(make(map[string]string))
args := []string{"TARGETPLATFORM"}
if err := arg(&mybuilder, args, nil, nil, ""); err != nil {
t.Errorf("arg error: %v", err)
}
args = []string{"BUILDARCH"}
if err := arg(&mybuilder, args, nil, nil, ""); err != nil {
t.Errorf("arg(2) error: %v", err)
}
localspec := platforms.DefaultSpec()
expectedArgs := []string{
"BUILDARCH=" + localspec.Architecture,
"TARGETPLATFORM=" + localspec.OS + "/" + localspec.Architecture,
}
got := mybuilder.Arguments()
sort.Strings(got)
if !reflect.DeepEqual(got, expectedArgs) {
t.Errorf("Expected %v, got %v\n", expectedArgs, got)
}
}

It was introduced in 54d2f38

If I had to guess, I think that the following condition is only entered in ARM platforms and that's not covered by the test:

imagebuilder/dispatchers.go

Lines 586 to 588 in e388800

if p.Variant != "" {
b.Args["TARGETPLATFORM"] = b.Args["TARGETPLATFORM"] + "/" + p.Variant
}

@grooverdan any chance you could have a look and form an opinion on what's the right approach to fix this?

siretart added a commit to siretart/imagebuilder that referenced this issue May 19, 2020
On ARM, the variant is non-empty and reflected in the TARGETPLATFORM default string

Fixes: openshift#160
@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 13, 2020
@openshift-bot
Copy link

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci-robot openshift-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Nov 12, 2020
@openshift-bot
Copy link

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

@openshift-ci-robot
Copy link

@openshift-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants