Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update test to only set CloudProvider on create
* There was an upstream bug that was not persisting the CloudeProvider when included in the CreateBuild API body. Now that this fix is in place, calling the UpdateBuild with the CloudProvider returns an error; thus causing the tests to fail. Tests Before Change ``` === RUN TestAcc_dataSourcePacker data_source_packer_image_iteration_test.go:298: unexpected UpdateBuild error, expected nil. Got [PATCH /packer/2021-04-30/organizations/{location.organization_id}/projects/{location.project_id}/builds/{build_id}][409] PackerService_UpdateBuild default &{Code:6 Details:[] Error:You cannot override a build's Cloud Provider if it has already been set. Message:You cannot override a build's Cloud Provider if it has already been set. } data_source_packer_image_iteration_test.go:466: unexpected CreateChannel error, expected nil. Got [POST /packer/2021-04-30/organizations/{location.organization_id}/projects/{location.project_id}/images/{bucket_slug}/channels][400] PackerService_CreateChannel default &{Code:9 Details:[] Error:Error creating channel: iteration is incomplete. Message:Error creating channel: iteration is incomplete.} data_source_packer_image_iteration_test.go:443: Step 1/1 error: Error running pre-apply refresh: exit status 1 Error: could not load the channel. something in the request is invalid. with data.hcp_packer_image_iteration.alpine, on terraform_plugin_test.tf line 4, in data "hcp_packer_image_iteration" "alpine": 4: data "hcp_packer_image_iteration" "alpine" { ``` Tests After Change ``` testing: warning: no tests to run PASS ok github.com/hashicorp/terraform-provider-hcp/internal/input 0.700s [no tests to run] === RUN TestAcc_dataSourcePacker --- PASS: TestAcc_dataSourcePacker (11.98s) === RUN TestAcc_dataSourcePacker_revokedIteration --- PASS: TestAcc_dataSourcePacker_revokedIteration (7.75s) === RUN TestAcc_dataSourcePackerImage --- PASS: TestAcc_dataSourcePackerImage (8.06s) === RUN TestAcc_dataSourcePackerIteration --- PASS: TestAcc_dataSourcePackerIteration (7.77s) === RUN TestAcc_dataSourcePackerIteration_revokedIteration --- PASS: TestAcc_dataSourcePackerIteration_revokedIteration (7.97s) PASS ok github.com/hashicorp/terraform-provider-hcp/internal/provider 43.926s ```
- Loading branch information