.agents/skills/review-tests/SKILL.md
Assume the @maintainer persona. Scope: per-resource acceptance test basics. Ephemeral resources, provider functions, and actions are out of scope. See review-tests-helpers for Exists/Destroy and data source/list/unit tests. Loaded from review-pr.
TestAcc<Service><Resource>_basic — full happy path, including an ImportState step, checking all attributes.TestAcc<Service><Resource>_disappears — verifies the provider re-creates a resource that's gone out-of-band.Tag and identity tests are generated for resources with @Tags and identity annotations. Flag PRs that add hand-written _tags* or _Identity_* tests for new resources.
TestAcc<Service><Resource>_<scenario>.TestAcc<Service><DataSource>DataSource_<scenario>.TestAcc<Service><Resource>_List_<scenario>.TestAcc prefix; flag any unit test that calls AWS.Acceptance tests start with ctx := acctest.Context(t) and use acctest.ParallelTest(ctx, t, resource.TestCase{...}).
The TestCase must set:
PreCheck calling acctest.PreCheck(ctx, t), acctest.PreCheckPartitionHasService(t, names.<Service>EndpointID), and the package's testAccPreCheck(ctx, t).ErrorCheck: acctest.ErrorCheck(t, names.<Service>ServiceID).ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories.CheckDestroy: testAccCheck<Resource>Destroy(ctx, t).Flag missing or replaced versions of any of those.
For tests expected to run more than ~5 minutes, add the long-running guard right after acctest.Context(t):
if testing.Short() {
t.Skip("skipping long-running test in short mode")
}
Use sdkacctest.RandomWithPrefix(acctest.ResourcePrefix). Flag hard-coded names or bare acctest.RandString(...).
testAccPreCheck issues a single cheap List/Describe call and skips on partition/permission errors via acctest.PreCheckSkipError(err). Flag PreChecks that make multiple API calls, return errors instead of calling t.Skipf/t.Fatalf, or skip PreCheckSkipError.
The _basic test's last step verifies import:
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
}
ImportStateVerifyIgnore is for write-only fields the AWS API doesn't return (e.g., passwords, apply_immediately). Flag broad ignore lists used to paper over genuine drift.
acctest.CheckFrameworkResourceDisappears(ctx, acctest.Provider, tf<svc>.Resource<Name>, resourceName).acctest.CheckResourceDisappears(ctx, acctest.Provider, tf<svc>.Resource<Name>(), resourceName).github.com/YakDriver/regexache, not stdlib regexp. Flag any new test that imports regexp.acctest.MatchResourceAttrRegionalARN / CheckResourceAttrRegionalARN (or global / alt-region variants). Flag manual ARN assembly via fmt.Sprintf with account ID or region.