Closed stirby closed 4 months ago
@mtojek I removed the coder_parameter
test from examples_test.go
since that test targets resources specifically.
~I find it interesting that the only two resources which don't generate code examples in the docs are prefixed with the provider.~
Since coder_workspace_tags
is in the correct directory, the problem may be deeper than a pathing issue.
I couldn't find any errors in the output of make gen
's tfplugindocs
call:
...
generating missing resource content
generating new template for "coder_app"
...
generating missing data source content
...
generating new template for data-source "coder_workspace_owner"
generating new template for data-source "coder_workspace_tags"
...
generating new template for data-source "coder_parameter"
generating missing function content
generating missing provider content
...
I also tried to add other resources to the examples_test.go
, each of which failed.
All this said, I would actually like to take a stab at rewriting the examples_test.go
. ~My fear is that the tests only pass with inclusion of the provider, which prevents the docs from correctly generating.~
Mind taking a look?
For now, lazily duplicated resource examples test loop for data sources to test.
Alright, I think I made the CI happy now. coder_parameter
and coder_workspace_tags
are in data-sources
now, and examples_test.go
is validating them.
I also tried to add other resources to the examples_test.go, each of which failed.
This may not be straightforward if examples depend on external fields or providers. For instance: coder_agent_instance
uses google_compute_instance
and we do not import gcp
module.
EDIT:
Let me know if this is ready to review, and I will re-check everything 👍
I did some reading of other providers. Rarely do code examples reference other providers but it feels essential for our examples like coder_agent
. I think we could revisit extending the testing someday but full coverage is not critical right now.
~I think this is ready for your review.~
Edit: trying one more thing.
Ended up over complicating. Should be good for your review.
The
coder_parameter
data-source's code example was in the resources directory by mistake, moved.Fixes https://github.com/coder/terraform-provider-coder/issues/242.
Curious what the failed
examples_test.go
looks like so intentionally ignored.