Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Lyons <[email protected]>
  • Loading branch information
mephmanx committed Sep 1, 2024
1 parent 8eee159 commit c923571
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
5 changes: 1 addition & 4 deletions internal/sdkv2provider/resource_cloudflare_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ func resourceCloudflareQueueCreate(ctx context.Context, d *schema.ResourceData,
},
},
}
println(fmt.Sprintf("req: %+v", req))
result, err := client.CreateQueueConsumer(ctx, cloudflare.AccountIdentifier(accountID), req)
println(fmt.Sprintf("result: %+v", result))
println(fmt.Sprintf("err: %+v", err))
_, err := client.CreateQueueConsumer(ctx, cloudflare.AccountIdentifier(accountID), req)
if err != nil {
return diag.FromErr(errors.Wrap(err, "error creating workers queue consumer"))
}
Expand Down
11 changes: 5 additions & 6 deletions internal/sdkv2provider/resource_cloudflare_queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ func TestAccCloudflareQueue_Consumer(t *testing.T) {
ProviderFactories: providerFactories,
CheckDestroy: testAccCloudflareQueueDestroy,
Steps: []resource.TestStep{

{

Config: testAccCheckCloudflareQueueWConsumer(rnd, accountID),
Check: resource.ComposeTestCheckFunc(
testAccCheckCloudflareQueueExists(rnd, &queue),
Expand Down Expand Up @@ -149,29 +151,26 @@ resource "cloudflare_queue" "%[1]s" {

func testAccCheckCloudflareQueueWConsumer(rnd, accountID string) string {
queueModuleContent := `export default { queue(batch, env) { return new Response('Hello world'); }, };`
tf_content := fmt.Sprintf(`
return fmt.Sprintf(`
resource "cloudflare_workers_script" "%[1]s" {
account_id = "%[2]s"
name = "%[1]s"
content = "%[3]s"
module = true
compatibility_date = "2023-03-19"
compatibility_flags = ["nodejs_compat", "web_socket_compression"]
}
resource "cloudflare_queue" "%[1]s" {
account_id = "%[2]s"
name = "%[1]s"
consumers {
script_name = "%[1]s"
environment = "production"
settings {
batch_size = 5
}
}
depends_on = [cloudflare_workers_script.%[1]s]
}`, rnd, accountID, queueModuleContent)
return tf_content

}

Check failure on line 174 in internal/sdkv2provider/resource_cloudflare_queue_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

unnecessary trailing newline (whitespace)


Expand Down

0 comments on commit c923571

Please sign in to comment.