refactor(planner): split monolithic planner_test.go into focused test…#23
Conversation
… files Extract test suites into dedicated files: - cycles_test.go — Tarjan's SCC and cycle resolution tests - integration_test.go — full pipeline integration tests - planner_test.go now contains only core planner tests
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Free Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
This pull request adds comprehensive unit and integration tests for the
plannerpackage, focusing on the correctness and robustness of theBuildPlanfunction for database table generation order, especially in the presence of foreign key cycles, nullable constraints, and real-world schemas.Cycle handling and edge cases:
cycles_test.gothat verifyBuildPlancorrectly handles various cycle scenarios, including cycles with nullable and non-nullable foreign keys, self-referencing tables, composite foreign keys, and mixed acyclic/cyclic graphs. These tests ensure that cycles with nullable breakpoints are deferred properly, and errors are raised when cycles are unresolvable.Integration and realistic schema coverage:
integration_test.gothat check row count propagation, deferred foreign key metadata, and the ability to generate a valid plan for a realistic ecommerce schema with multiple tables and dependencies.Test coverage and helper utilities:
These additions significantly increase test coverage for complex schema scenarios and help ensure the correctness of the table generation planning logic.… files
Extract test suites into dedicated files:
What does this PR do?
Why is it needed?
Closes #
How was it tested?
Does it change any existing behavior?
Checklist
make testpasses (go test ./... -race)make lintpasses (golangci-lint run ./...)time.Now()or unseeded randomness in the generation pipelinemake test-golden UPDATE=true)