Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
devashish-patel committed Apr 4, 2024
1 parent a8cb35c commit 4962fb8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions internal/hcp/registry/types.bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/hashicorp/packer-plugin-sdk/packer/registry/image"
"github.com/hashicorp/packer/hcl2template"
hcpPackerAPI "github.com/hashicorp/packer/internal/hcp/api"
pkr "github.com/hashicorp/packer/packer"
)

func createInitialTestBucket(t testing.TB) *Bucket {
Expand Down Expand Up @@ -486,7 +487,7 @@ func TestCompleteBuild(t *testing.T) {
client: mockCli,
}

dummyBucket.Version.StoreBuild("test-build", &Build{
dummyBucket.Version.StoreBuild("test.build", &Build{
ID: "test-build",
Platform: "none",
ComponentType: "none",
Expand All @@ -495,7 +496,11 @@ func TestCompleteBuild(t *testing.T) {
Status: models.HashicorpCloudPacker20230101BuildStatusBUILDRUNNING,
})

_, err := dummyBucket.completeBuild(context.Background(), "test-build", tt.artifactsToUse, nil)
testCoreBuild := pkr.CoreBuild{
BuildName: "test",
Type: "build",
}
_, err := dummyBucket.completeBuild(context.Background(), &testCoreBuild, tt.artifactsToUse, nil)
if err != nil != tt.expectError {
t.Errorf("expected %t error; got %t", tt.expectError, err != nil)
t.Logf("error was: %s", err)
Expand Down

0 comments on commit 4962fb8

Please sign in to comment.