Repository navigation
Chore | Remove tests that repeat others at the same level - #391
Merged
Merged
Conversation
Overlap review across the test suites (#346). Each removed test only re-checked what a kept one already checks; with them gone no line or branch loses coverage (85% before and after) and mutation testing keeps the same 85 survivors on auth.py and tf.py. - test_runner.py 46 -> 31: a literal copy (no args vs "None" args), subsets (missing-binary message, override inside the merge test), attribute checks every run test implies, and exec re-testing run's env merging. One test now checks exec passes env_vars and working_dir on. - test_tfrunner.py 14 -> 8: TFRunner.run only forwards to Runner.run, so its env and argument tests repeated test_runner.py. Gap found and covered: TFRunner.exec doesn't raise by default, unlike Runner.exec. - test_path.py: the two pytester get_root_path tests, which test_root_path.py covers with real git. The pytester plugin (root conftest.py) goes with them. - test_tf.py: test_init_with_args, a case of test_init_arguments. - test_project.py: the render-destination test; the golden files of `project create` fail on the same bug. - bats: 4 tofu lifecycle tests that never reach tofu or repeat a CliRunner test (--layers inside a layer, a missing layer, the layout check on init, stop at the first failing layer). They ran on 5 CI jobs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 28 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Coverage Report for CI Build 46054779519Coverage increased (+0.04%) to 85.443%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
binbashdevops
approved these changes
Nov 27, 2026
21 tasks done
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.
Part of #346: the overlap review between test types.
How overlap was measured
pytest --cov-context=test. That gave 27 groups of tests that run exactly the same lines.master: 0 lines or branches lost, 85% → 85%make mutationonauth.pyandtf.py: the same 85 survivorsRule applied: each behavior is checked at the cheapest level that catches its bug. A test stays when it adds something the others don't.
Removed (pytest 495 → 470, bats lifecycle 10 → 6)
test_runner.py..._none_args_...calledrun()with no arguments, like..._no_args_...). Subsets: the missing-binary message, and the override already inside the merge test. Attribute checks that everyruntest implies.execre-testingrun's env var merging. One test now checks thatexecpassesenv_varsandworking_dirontest_tfrunner.pyTFRunner.runonly forwards toRunner.run: its env var and argument tests repeatedtest_runner.pytest_path.pypytestertests ofget_root_path, whichtest_root_path.pycovers with real git. Thepytesterplugin (rootconftest.py) goes with them, and so does mutmut'salso_copytest_tf.pytest_init_with_argsis the-migrate-statecase oftest_init_argumentstest_project.pyproject createfail on the same bug (that's how #388 found it)leverage_tofu_lifecycle.batstest_layers_errorsandtest_init_stops_on_an_invalid_layoutalready check. "Stops at the first failing layer" repeatstest_layers_stop_at_the_first_failing_layer, and the lifecycle test already checks the exit code of a real tofu run. They ran on 5 CI jobsOverlaps reviewed and kept
check_sso_token,credentials,backend_config): different inputs, different results.test__parsing,test_backend_configvstest_properties): the examples document the behavior; the properties look for counterexamples.--layersorder: bats runs each layer in its real directoryvalidate-layoutunit tests: the contract tests run on the ref-arch, while the unit tests cover the error branches.Gap found and covered
TFRunner.execdoesn't raise by default (raises=False), unlikeRunner.exec, and no test checked it. Addedtest_exec_does_not_raise_by_default.What each suite is for
pytest, mocks at the boundary)CliRunner)--layershypothesis)le-tf-infra-awsproject create)tofu validate(needs providers)leveragewith real tofu/terraform, no AWSmake mutation, by hand)auth.py/tf.pyreally check🤖 Generated with Claude Code