Repository navigation
add AZT004: acceptance tests must be named TestAcc - #67
Merged
katbyte merged 4 commits intoOct 9, 2026
Merged
Conversation
katbyte
force-pushed
the
kt/azt004-azt005-acceptance-test-naming-and-coverage
branch
from
October 9, 2026 21:02
7ac70e6 to
99ddd77
Compare
katbyte
force-pushed
the
kt/azt004-azt005-acceptance-test-naming-and-coverage
branch
from
October 9, 2026 21:17
941f3c5 to
6fbd08b
Compare
katbyte
force-pushed
the
kt/azt004-azt005-acceptance-test-naming-and-coverage
branch
from
October 9, 2026 21:18
6fbd08b to
6356fd9
Compare
…ss are not a stray Acc
…lts reading it do not
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.
A new rule, AZT004, that reports acceptance tests whose name does not start with
TestAcc.Why: acceptance runs select tests by that prefix. A test named
TestThing_basicthat drives the acceptance framework is skipped by every acceptance run, so the resource it covers is never actually tested against Azure, however complete the test looks. A survey of azurerm found 65 such functions covering 16 resources and data sources: every Oracle resource, the Cosmos PostgreSQL role, node configuration and firewall rule, the IoT security device group, and two App Service resources. tfproviderlint's AT005 misses all of them because it only recognises directresource.Testcalls, not azurerm's wrapper.Tests that exist but never run. AZT004 reports a top-level
Testfunction in a test file that reaches the acceptance harness, itself or through helpers, sequential maps or aTF_ACCcheck, without theTestAccprefix. Lowercase helpers and methods are left alone, since no runner selects them. WhenAccalready sits elsewhere in the name, as inTestWebAppAccActiveSlot_basic, the report says to move it rather than suggesting a doubled-up name.Shared code. The harness-reachability analysis AZT003 kept privately moves into
lib/acctestas an analyzer with a result, so AZT003 and AZT004 compute it once per package. It returns early for packages with no test files.Things that are fine as they are. AZT003's messages, fixtures and tests are unchanged and pass on the shared code. Its
TestAccountNamehandling, whereAccstarts a word, is untouched.The rule only reports. This is the mirror of AZT003, which reports the opposite case. The companion rule for resources missing their core tests is #68.