You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, tctest checks for test patterns in the _test.go filename of modified PR files. Most of the time this is great and covers what should be tested, however there are scenarios where it may be desirable or necessary to use other test patterns:
Test declarations in other files: In Terraform Providers, services may only allow 1 resource to exist so testing is serialized across many resources and the test declaration is in a separate shared file.
Additional testing desired: In Terraform Providers, resources may also have an associated data source, which will be in a separate test file. Otherwise, there may also be other resources or testing that use the changing functionality.
Proposal
Support the ability to declare additional test patterns via code comments. Go convention is //XXX with no space for programatic comments. Including an additional :add: field to the comment for future proofing (e.g. if we wanted to have the ability to programmatically skip tests too).
Proposal 1
//tctest:add:TestAccExample
Personally, I think this this more desirable since it gives full control to run singular tests.
Proposal 2
//tctest:add:path/to/other/file_test.go
The text was updated successfully, but these errors were encountered:
Description
Currently,
tctest
checks for test patterns in the_test.go
filename of modified PR files. Most of the time this is great and covers what should be tested, however there are scenarios where it may be desirable or necessary to use other test patterns:Proposal
Support the ability to declare additional test patterns via code comments. Go convention is
//XXX
with no space for programatic comments. Including an additional:add:
field to the comment for future proofing (e.g. if we wanted to have the ability to programmatically skip tests too).Proposal 1
//tctest:add:TestAccExample
Personally, I think this this more desirable since it gives full control to run singular tests.
Proposal 2
//tctest:add:path/to/other/file_test.go
The text was updated successfully, but these errors were encountered: