Skip to content

add AZT007: acceptance test names must not carry a second Acc - #72

Merged
katbyte merged 2 commits into
mainfrom
kt/azt007-stray-acc-in-test-name
Oct 9, 2026
Merged

katbyte merged 2 commits into
mainfrom
kt/azt007-stray-acc-in-test-name

Conversation

@katbyte

@katbyte katbyte commented Oct 9, 2026

Copy link
Copy Markdown
Owner

A new rule, AZT007, that reports a TestAcc name carrying Acc again as a word of its own.

Why: Acc is the marker that makes a function an acceptance test. A second one, as in TestAccMsSqlServerExtendedAuditingPolicy_storageAccBehindFireWall, reads as a mistake, and as an abbreviation of account it is unclear. azurerm has five of these today, across the MsSQL and Synapse auditing policy tests.

A second Acc in the name. Acc counts when it is a whole camel-case word, followed by an upper-case letter, an underscore or the end of the name, so Account, Access and accelerated are left alone. Both TestAcc functions and the lowercase testAcc helpers that sequential tests use are checked, in _test.go files only.

-func TestAccMsSqlServerExtendedAuditingPolicy_storageAccBehindFireWall(t *testing.T) {
+func TestAccMsSqlServerExtendedAuditingPolicy_storageAccountBehindFirewall(t *testing.T) {

Things that are fine as they are. A plain Test name with Acc in the wrong place, like TestWebAppAccActiveSlot_basic, is AZT004's report (#67) when it runs an acceptance test, and is not repeated here. The rule only reports: whether Acc meant account, access or something else is the author's call.

@katbyte
katbyte merged commit ebc947f into main Oct 9, 2026
11 checks passed
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.

1 participant