Repository navigation
Conversation
…r migration changes A change to only a resource folder's test_helpers_test.go found no tests: it holds the configs the folder's tests build on but no tests of its own. 53 azurerm folders have one. It now counts as part of the resource, so a change runs every test in the folder. In API mode, a change to a resource folder's migration/ package found no tests either: the test prefix was guessed from the migration's file name (feature_resource_v0_to_v1.go to feature_resource), which no file in the folder starts with. Inside a resource folder it is now every test in that folder. AST mode already found them by following resource.go's import.
… a helper, so its folder's tests run in both modes azurerm's fileregex matches everything under resources/, and its newest refactor PRs name migration files like notification_hub_resource.go. Both turned a folder's migration/ files into resource files with no tests beside them, so a migration-only change triggered nothing in API or AST mode. A file in a package nested inside a resource folder is now a helper whatever its name or the regex says, the AST resource check asks the classifier instead of re-doing the regex, and the azurerm integration suite runs with azurerm's real regex and gains a migration file named like a resource.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Find the right tests for azurerm's resource-per-folder layout (
<service>/resources/<folder>/resource.go,r_*.go,data_source.go, ...) in both API and AST mode.Why: azurerm has moved over 300 resources into folders whose files no longer carry the resource's name, so tctest saw every one as a helper and
/testtriggered nothing.data_source.go,list.goandaction.gorun their own tests, anything else runs every test in the folder.test_helpers_test.goand itsmigration/package run the folder's tests. A package nested in a folder is always a helper, whatever the file is called and whatever--fileregexmatches, since azurerm's regex matches everything underresources/and its migrations may be named*_resource.go.The flat layout is unchanged. Integration tests cover each case in both modes with azurerm's real regex; tests, lint, depscheck and typos pass.