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

bake: test empty attribute #2826

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions bake/bake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2019,6 +2019,24 @@
})
}

// https://github.com/docker/buildx/pull/428
// https://github.com/docker/buildx/issues/2822
func TestEmptyAttribute(t *testing.T) {
fp := File{
Name: "docker-bake.hcl",
Data: []byte(`
target "app" {
output = [""]
}
`),
}

ctx := context.TODO()

_, _, err := ReadTargets(ctx, []File{fp}, []string{"app"}, nil, nil)
require.NoError(t, err)

Check failure on line 2037 in bake/bake_test.go

View workflow job for this annotation

GitHub Actions / test-unit (ubuntu-24.04)

Failed: bake/TestEmptyAttribute

=== RUN TestEmptyAttribute bake_test.go:2037: Error Trace: /home/runner/work/buildx/buildx/bake/bake_test.go:2037 Error: Received unexpected error: docker-bake.hcl:3,12-13: Unsuitable value type; Unsuitable value: EOF Test: TestEmptyAttribute --- FAIL: TestEmptyAttribute (0.00s)

Check failure on line 2037 in bake/bake_test.go

View workflow job for this annotation

GitHub Actions / test-unit (macos-14)

Failed: bake/TestEmptyAttribute

=== RUN TestEmptyAttribute bake_test.go:2037: Error Trace: /Users/runner/work/buildx/buildx/bake/bake_test.go:2037 Error: Received unexpected error: docker-bake.hcl:3,12-13: Unsuitable value type; Unsuitable value: EOF Test: TestEmptyAttribute --- FAIL: TestEmptyAttribute (0.00s)

Check failure on line 2037 in bake/bake_test.go

View workflow job for this annotation

GitHub Actions / test-unit (windows-2022)

Failed: bake/TestEmptyAttribute

=== RUN TestEmptyAttribute bake_test.go:2037: Error Trace: D:/a/buildx/buildx/bake/bake_test.go:2037 Error: Received unexpected error: docker-bake.hcl:3,12-13: Unsuitable value type; Unsuitable value: EOF Test: TestEmptyAttribute --- FAIL: TestEmptyAttribute (0.00s)
}

func stringify[V fmt.Stringer](values []V) []string {
s := make([]string, len(values))
for i, v := range values {
Expand Down
Loading