Series Context: Part 5 of 10 in GitLab Core Engineering: Architecture, MCP & CI/CD Deep Dives .
Featured MR: gitlab-org/gitlab!269061 · Work Item: #635243
What Makes a Spec "Vacuous"?
A vacuous (tautological) test passes not because your production code behaves correctly , but because your test harness already short-circuited the execution path under assertion. Worse than having no test at all, a vacuous negative mock ( expect(Service).not_to receive(:call) ) creates false security during future refactors—someone could introduce an expensive network lookup inside the real policy layer and this test would still stay green.
In ee/spec/helpers/secrets_helper_spec.rb , we found an instructive example of this exact anti-pattern—and then watched our MR shrink from a multi-file feature-flag cleanup into a surgical 6-line deletion after master moved underneath us.
Dissecting the Vacuous Mock in SecretsHelperSpec
Look at the enclosing before block for #secrets_manager_variables_cta_data in…