CtrlK
BlogDocsLog inGet started
Tessl Logo

acc-test-helper-client-without-provider-meta

Use when an acceptance test panics with 'interface {} is nil, not *clientset.ClientSet' in a CheckDestroy or check helper, or a helper calls testAccProvider.Meta().

68

Quality

81%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Passed

No findings from the security scan

SKILL.md
Quality
Evals
Security

Acceptance-test helpers must build their own client

Trigger: A CheckDestroy or Check helper panics with interface conversion: interface {} is nil, not *clientset.ClientSet, often only when the test runs alone (-run '^TestX$') or in its own CI shard, such as a provider-migration job.

Fix: Build the client in the helper instead of reading it from testAccProvider.Meta():

cs, err := testAccNewClientSet()
if err != nil {
	return err
}

Why: testAccProvider is the SDKv2 provider, and it is only configured once some earlier test in the same process has used it. A framework-only or ExternalProviders test that runs alone never configures it, so Meta() is nil.

Repository
coralogix/terraform-provider-coralogix
Last updated
First committed

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.