Skip to content

Commit

Permalink
Add debug output and focus failing test
Browse files Browse the repository at this point in the history
Signed-off-by: Natalie Arellano <narellano@vmware.com>
  • Loading branch information
natalieparellano committed Jun 27, 2023
1 parent 1187d0d commit a2b867e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/builder/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -747,14 +747,14 @@ func testBuilder(t *testing.T, when spec.G, it spec.S) {
h.AssertNil(t, err)
})

it("uses the last buildpack", func() {
it.Focus("uses the last buildpack", func() {
logger := logging.NewLogWithWriters(&outBuf, &outBuf, logging.WithVerbose())

subject.AddBuildpack(bp1v1)
subject.AddBuildpack(bp1v1Alt)

err := subject.Save(logger, builder.CreatorMetadata{})
h.AssertNil(t, err)
subject.Save(logger, builder.CreatorMetadata{})
t.Logf("Output: %s", outBuf.String())

h.AssertEq(t, baseImage.IsSaved(), true)

Expand Down
3 changes: 3 additions & 0 deletions pkg/buildpack/buildpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ func ToNLayerTar(dest string, module BuildModule) ([]ModuleTar, error) {
}
return nil, err
}
fmt.Println("XXX", header.Name)
if header.Name == "Files" {
forWindows = true
}
Expand Down Expand Up @@ -434,6 +435,7 @@ func toNLayerTar(origID, origVersion string, firstHeader *tar.Header, tr *tar.Re
return fmt.Errorf("getting module from collection: %w", err)
}
for _, h := range toWrite {
fmt.Println("XXX Writing", h.Name)
if err := mt.writer.WriteHeader(h); err != nil {
return fmt.Errorf("failed to write header '%s': %w", h.Name, err)
}
Expand All @@ -448,6 +450,7 @@ func toNLayerTar(origID, origVersion string, firstHeader *tar.Header, tr *tar.Re
}
return fmt.Errorf("getting next header: %w", err)
}
fmt.Println("XXX", header.Name)
nextID, nextVersion := parseBpIDAndVersion(header)
if nextID != origID || nextVersion != origVersion {
// we found a new module, recurse
Expand Down

0 comments on commit a2b867e

Please sign in to comment.