Skip to content

Commit

Permalink
bake: test empty attribute
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Nov 28, 2024
1 parent 71c7889 commit e689d18
Showing 1 changed file with 18 additions and 0 deletions.
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 @@ target "app" {
})
}

// 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

0 comments on commit e689d18

Please sign in to comment.