-
Notifications
You must be signed in to change notification settings - Fork 9
feat: Add unit tests for GCP support #162
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
Conversation
WalkthroughThis pull request involves package restructuring and minor code modifications across several GCP integration test files. The changes primarily focus on adjusting package declarations, removing specific imports, and introducing a new test class for GCS format testing. The modifications suggest a reorganization of the project's package structure and test coverage for Google Cloud Storage format handling. Changes
Suggested reviewers
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
cb65e63 to
8cec3e7
Compare
29465e7 to
3caa9f9
Compare
8963d86 to
98b6e58
Compare
0f85bbb to
3502bab
Compare
c30c4ab to
f6573cf
Compare
3502bab to
e800c39
Compare
f6573cf to
14f7ef9
Compare
dd86306 to
3b7bb43
Compare
d0deb93 to
9390cba
Compare
3b7bb43 to
150f0b8
Compare
9390cba to
8f9777e
Compare
150f0b8 to
9f8afaa
Compare
8f9777e to
563195b
Compare
5da0b1c to
454d9a8
Compare
616e47c to
2fe5f01
Compare
2fe5f01 to
e6fb9e6
Compare
7af07f1 to
ce3448d
Compare
e6fb9e6 to
37e326a
Compare
david-zlai
left a comment
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.
awesomeeeee
| lazy val spark: SparkSession = SparkSessionBuilder.build( | ||
| "BigQuerySparkTest", | ||
| local = true | ||
| ) |
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.
wondered if we should put this in a setup and then add a teardown to stop the spark session?
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.
that would be a good way to do it, but I think it may not work well with how things are set up in Chronon - we actually use a singleton spark session everywhere for unit tests. If the tests run in parallel, shutting down the spark session here may cause other in flight unit tests to crash unexpectedly.
-e Co-authored-by: Thomas Chow <[email protected]> -e Co-authored-by: Thomas Chow <[email protected]> -e Co-authored-by: Thomas Chow <[email protected]> -e Co-authored-by: Thomas Chow <[email protected]> -e Co-authored-by: Thomas Chow <[email protected]> Co-authored-by: Thomas Chow <[email protected]>
-e Co-authored-by: Thomas Chow <[email protected]> -e Co-authored-by: Thomas Chow <[email protected]> -e Co-authored-by: Thomas Chow <[email protected]> -e Co-authored-by: Thomas Chow <[email protected]> -e Co-authored-by: Thomas Chow <[email protected]> Co-authored-by: Thomas Chow <[email protected]>
-e Co-authored-by: Thomas Chow <[email protected]> -e Co-authored-by: Thomas Chow <[email protected]> -e Co-authored-by: Thomas Chow <[email protected]> -e Co-authored-by: Thomas Chow <[email protected]> -e Co-authored-by: Thomas Chow <[email protected]> Co-authored-by: Thomas Chow <[email protected]>
-e Co-authored-by: Thomas Chow <[email protected]> -e Co-authored-by: Thomas Chow <[email protected]> -e Co-authored-by: Thomas Chow <[email protected]> -e Co-authored-by: Thomas Chow <[email protected]> -e Co-authored-by: Thomas Chow <[email protected]> Co-authored-by: Thomas Chow <[email protected]>
37e326a to
9b39ab2
Compare
Co-authored-by: Thomas Chow <[email protected]>
Co-authored-by: Thomas Chow <[email protected]>
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 (1)
cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/GCSFormatTest.scala (1)
3-3: Prefer ScalaTest assertions
You're mixing JUnitassertEqualswith ScalaTestAnyFunSuite. Using ScalaTest's built-ins (e.g.,assert) yields consistency.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)
📒 Files selected for processing (4)
cloud_gcp/src/main/scala/ai/chronon/integrations/cloud_gcp/BigQueryFormat.scala(1 hunks)cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/BigQueryCatalogTest.scala(1 hunks)cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/DataprocSubmitterTest.scala(1 hunks)cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/GCSFormatTest.scala(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- cloud_gcp/src/main/scala/ai/chronon/integrations/cloud_gcp/BigQueryFormat.scala
- cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/DataprocSubmitterTest.scala
🔇 Additional comments (5)
cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/BigQueryCatalogTest.scala (1)
1-1: Verify references. The package rename might break them if they’re no longer in scope.cloud_gcp/src/test/scala/ai/chronon/integrations/cloud_gcp/GCSFormatTest.scala (4)
16-21: Revisit shared Spark session
Using a shared singleton spark session can cause concurrency issues in parallel test runs (previously discussed).
23-41: Comprehensive partition test
This effectively tests partition logic. Good coverage.
43-61: Empty partition test
Nice check for absence of partitions.
63-91: Date partition test
Good approach. Watch out for time zone differences.
Co-authored-by: Thomas Chow <[email protected]>
## Summary - Adding unit tests for #147 - https://app.asana.com/0/1208949807589885/1208960391734329/f ## Checklist - [x] 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 - **New Features** - Added a new test class to validate GCS format partitioning functionality. - **Refactor** - Updated package structure for test files. - Removed specific imports in test files. - **Chores** - Added an import for a BigQuery table in the format handling. <!-- 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: Thomas Chow <[email protected]>
## Summary - Adding unit tests for #147 - https://app.asana.com/0/1208949807589885/1208960391734329/f ## Checklist - [x] 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 - **New Features** - Added a new test class to validate GCS format partitioning functionality. - **Refactor** - Updated package structure for test files. - Removed specific imports in test files. - **Chores** - Added an import for a BigQuery table in the format handling. <!-- 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: Thomas Chow <[email protected]>
## Summary - Adding unit tests for #147 - https://app.asana.com/0/1208949807589885/1208960391734329/f ## Checklist - [x] 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 - **New Features** - Added a new test class to validate GCS format partitioning functionality. - **Refactor** - Updated package structure for test files. - Removed specific imports in test files. - **Chores** - Added an import for a BigQuery table in the format handling. <!-- 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: Thomas Chow <[email protected]>
## Summary - Adding unit tests for #147 - https://app.asana.com/0/1208949807589885/1208960391734329/f ## Cheour clientslist - [x] 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 - **New Features** - Added a new test class to validate GCS format partitioning functionality. - **Refactor** - Updated paour clientsage structure for test files. - Removed specific imports in test files. - **Chores** - Added an import for a BigQuery table in the format handling. <!-- 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: Thomas Chow <[email protected]>
Summary
Checklist
Summary by CodeRabbit
New Features
Refactor
Chores