Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cloudflare_tiered_cache: add cf-tf support for new resource #557

Merged

Conversation

foreseaz
Copy link
Member

@foreseaz foreseaz commented May 4, 2023

Add cloudflare_tiered_cache support to generate the resource of tiered_cache.

Tested locally with output:

make build && cd test && ../cf-terraforming generate --zone 0ebc4...2bc4fd6 --resource-type "cloudflare_tier
ed_cache"
resource "cloudflare_tiered_cache" "terraform_managed_resource_0ebc4...2bc4fd6" {
  cache_type = "smart"
  zone_id    = "0ebc4...2bc4fd6"
}

Copy link
Member

@jacobbednarz jacobbednarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR @foreseaz 🙇 i've added some comments in line but we'll also need to add test coverage for this. if you're looking for prior art, #496 is a good starting point.

@foreseaz foreseaz requested a review from jacobbednarz May 5, 2023 20:49
@foreseaz
Copy link
Member Author

foreseaz commented May 5, 2023

@jacobbednarz Added tests, but when I was running make test locally, got errors as following:

?       github.com/cloudflare/cf-terraforming/cmd/cf-terraforming       [no test files]
=== RUN   TestGenerate_writeAttrLine
=== RUN   TestGenerate_writeAttrLine/value_is_nil
=== RUN   TestGenerate_writeAttrLine/value_is_string
=== RUN   TestGenerate_writeAttrLine/value_is_int
=== RUN   TestGenerate_writeAttrLine/value_is_float
=== RUN   TestGenerate_writeAttrLine/value_is_bool
=== RUN   TestGenerate_writeAttrLine/value_is_list_of_strings
=== RUN   TestGenerate_writeAttrLine/value_is_block_of_strings
--- PASS: TestGenerate_writeAttrLine (0.00s)
    --- PASS: TestGenerate_writeAttrLine/value_is_nil (0.00s)
    --- PASS: TestGenerate_writeAttrLine/value_is_string (0.00s)
    --- PASS: TestGenerate_writeAttrLine/value_is_int (0.00s)
    --- PASS: TestGenerate_writeAttrLine/value_is_float (0.00s)
    --- PASS: TestGenerate_writeAttrLine/value_is_bool (0.00s)
    --- PASS: TestGenerate_writeAttrLine/value_is_list_of_strings (0.00s)
    --- PASS: TestGenerate_writeAttrLine/value_is_block_of_strings (0.00s)
=== RUN   TestGenerate_ResourceNotSupported
time="2023-05-05T13:53:23-07:00" level=fatal msg="failed to detect provider installation"
FAIL    github.com/cloudflare/cf-terraforming/internal/app/cf-terraforming/cmd  17.905s
FAIL
make: *** [test] Error 1

Is there extra settings before running the test? Besides, let me know if there is anything off in the current commits.

@jacobbednarz
Copy link
Member

you can either pass in --terraform-install-path to your tests or you can run these in an initialised terraform directory to get this going. i usually use the former via env vars in tests for simplicity.

@foreseaz
Copy link
Member Author

@jacobbednarz Hi thanks for the last comment, and is there anything that needs working for this PR?

@jacobbednarz jacobbednarz merged commit 7c3ff3a into cloudflare:master May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants