-
Notifications
You must be signed in to change notification settings - Fork 9
Add more tests #720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more tests #720
Conversation
WalkthroughThe test suite for BigQuery integration was updated by renaming an existing test and adding a new one to verify partition handling for both BigQuery native tables and views. The tests use the Changes
Possibly related PRs
Suggested reviewers
Poem
Warning Review ran into problems🔥 ProblemsGitHub Actions and Pipeline Checks: Resource not accessible by integration - https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository. Please grant the required permissions to the CodeRabbit GitHub App under the organization or repository settings. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (17)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/BigQueryCatalogTest.scala (3)
55-66: Renamed and expanded view compatibility test.Test now verifies both views and tables return identical partitions for November 2023.
Slight grammar issue in test name, should be "works with views" → "work with views".
68-77: Added new test for truncated date range.Test verifies partition filtering works correctly on smaller date range.
Grammar issue in test name, should be "works with" → "work with".
55-77: Consider extracting common test logic.Both tests share similar structure and assertions.
+ private def verifyPartitionsMatch(viewName: String, nativeName: String, startDate: String, endDate: String, expectedCount: Int): Unit = { + val viewParts = tableUtils.partitions(viewName, partitionRange = Option(PartitionRange(startDate, endDate)(tableUtils.partitionSpec)), partitionColumnName = "ds") + assertEquals(expectedCount, viewParts.size) + val nativeParts = tableUtils.partitions(nativeName, partitionRange = Option(PartitionRange(startDate, endDate)(tableUtils.partitionSpec)), partitionColumnName = "ds") + assertEquals(expectedCount, nativeParts.size) + assertEquals(nativeParts.toSet, viewParts.toSet) + } + it should "works with views" ignore { val viewName = "data.purchases_native_view" val nativeName = "data.purchases" - val viewParts = tableUtils.partitions(viewName, partitionRange = Option(PartitionRange("2023-11-01", "2023-11-30")(tableUtils.partitionSpec)), partitionColumnName = "ds") - assertEquals(30, viewParts.size) - val nativeParts = tableUtils.partitions(nativeName, partitionRange = Option(PartitionRange("2023-11-01", "2023-11-30")(tableUtils.partitionSpec)), partitionColumnName = "ds") - assertEquals(30, nativeParts.size) - assertEquals(nativeParts.toSet, viewParts.toSet) + verifyPartitionsMatch(viewName, nativeName, "2023-11-01", "2023-11-30", 30) } it should "works with a partition range for views and tables" ignore { val viewName = "data.purchases_native_view" val nativeName = "data.purchases" - val viewTruncated = tableUtils.partitions(viewName, partitionRange = Option(PartitionRange("2023-11-28", "2023-11-30")(tableUtils.partitionSpec)), partitionColumnName = "ds") - assertEquals(3, viewTruncated.size) - val nativeTruncated = tableUtils.partitions(nativeName, partitionRange = Option(PartitionRange("2023-11-28", "2023-11-30")(tableUtils.partitionSpec)), partitionColumnName = "ds") - assertEquals(3, nativeTruncated.size) - assertEquals(nativeTruncated.toSet, viewTruncated.toSet) + verifyPartitionsMatch(viewName, nativeName, "2023-11-28", "2023-11-30", 3) }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)
📒 Files selected for processing (1)
cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/BigQueryCatalogTest.scala(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/BigQueryCatalogTest.scala (2)
spark/src/main/scala/ai/chronon/spark/catalog/TableUtils.scala (3)
TableUtils(43-656)TableUtils(658-660)partitions(183-208)cloud_gcp/src/main/scala/ai/chronon/integrations/cloud_gcp/BigQueryNative.scala (1)
partitions(128-204)
⏰ Context from checks skipped due to timeout of 90000ms (17)
- GitHub Check: service_tests
- GitHub Check: service_tests
- GitHub Check: service_commons_tests
- GitHub Check: online_tests
- GitHub Check: cloud_gcp_tests
- GitHub Check: cloud_gcp_tests
- GitHub Check: cloud_aws_tests
- GitHub Check: cloud_aws_tests
- GitHub Check: online_tests
- GitHub Check: api_tests
- GitHub Check: flink_tests
- GitHub Check: aggregator_tests
- GitHub Check: api_tests
- GitHub Check: scala_compile_fmt_fix
- GitHub Check: flink_tests
- GitHub Check: aggregator_tests
- GitHub Check: enforce_triggered_workflows
🔇 Additional comments (3)
cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/BigQueryCatalogTest.scala (3)
3-3: Added PartitionRange import to support partition filtering in tests.New import enables date-based partition range specification in test cases.
40-48: Activated BigQuery Iceberg catalog configuration.Uncommented configuration enables BigQuery Iceberg catalog integration for tests.
55-77:✅ Verification successful
Both tests are marked with
ignore.Tests won't run in automated test suites but follow existing pattern for integration tests.
🏁 Script executed:
#!/bin/bash # Check if other BigQuery tests are also ignored and if there's documentation grep -n "ignore.*BigQuery" cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/BigQueryCatalogTest.scala grep -n "TODO.*BigQuery" cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/BigQueryCatalogTest.scalaLength of output: 225
Confirm intentional ignores on BigQuery view tests
Both tests in BigQueryCatalogTest.scala are markedignore, matching our existing integration-test pattern. No changes needed.
## Summary
## Checklist
- [ ] Added Unit Tests
- [ ] Covered by existing CI
- [ ] Integration tested
- [ ] Documentation update
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Tests**
- Improved and expanded tests to verify partition range filtering works
consistently between BigQuery native tables and views.
- Added a new test to ensure partition filtering over specific date
ranges returns matching results for both views and tables.
- Renamed and enhanced an existing test for better clarity and coverage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- av pr metadata
This information is embedded by the av CLI when creating PRs to track
the status of stacks when using Aviator. Please do not delete or edit
this section of the PR.
```
{"parent":"main","parentHead":"","trunk":"main"}
```
-->
---------
Co-authored-by: thomaschow <[email protected]>
## Summary
## Checklist
- [ ] Added Unit Tests
- [ ] Covered by existing CI
- [ ] Integration tested
- [ ] Documentation update
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Tests**
- Improved and expanded tests to verify partition range filtering works
consistently between BigQuery native tables and views.
- Added a new test to ensure partition filtering over specific date
ranges returns matching results for both views and tables.
- Renamed and enhanced an existing test for better clarity and coverage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- av pr metadata
This information is embedded by the av CLI when creating PRs to track
the status of stacks when using Aviator. Please do not delete or edit
this section of the PR.
```
{"parent":"main","parentHead":"","trunk":"main"}
```
-->
---------
Co-authored-by: thomaschow <[email protected]>
## Summary
## Cheour clientslist
- [ ] Added Unit Tests
- [ ] Covered by existing CI
- [ ] Integration tested
- [ ] Documentation update
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Tests**
- Improved and expanded tests to verify partition range filtering works
consistently between BigQuery native tables and views.
- Added a new test to ensure partition filtering over specific date
ranges returns matching results for both views and tables.
- Renamed and enhanced an existing test for better clarity and coverage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- av pr metadata
This information is embedded by the av CLI when creating PRs to traour clients
the status of staour clientss when using Aviator. Please do not delete or edit
this section of the PR.
```
{"parent":"main","parentHead":"","trunk":"main"}
```
-->
---------
Co-authored-by: thomaschow <[email protected]>
Summary
Checklist
Summary by CodeRabbit