Skip to content

Conversation

@misolt
Copy link
Member

@misolt misolt commented Sep 3, 2025

Increase test coverage in snowflake

  • Make all classes with 10+ lines of logic (as counted by JaCoCo) meet the current target of 50% coverage.
  • Overall, increase the average coverage for snowflake from 52 to 78%.

Make SnowflakeLogsConnector more testable

  • Move bits of logic into helper functions that are easier to test.
  • Use enum abstract methods instead of switches.
  • Use fields to store constants with long definitions
  • Minimize duplication in hard-to-cover parts of code.

Add tests for Snowflake connector logic

Add to the tests of metadata derivative connectors, logs and abstract connector. Add a util to avoid repeating the redundant throws IOException each test.

Other fixes

  • Prevent using derivative metadata connectors with the assessment flag, since assessment doesn't support them.
  • Move SnowflakeLogsConnectorProperties to a separate class.
  • Remove ConnectorArguments#optionAsOptional.
  • Move a comment to a more relevant context.

@misolt misolt changed the title Snowflake unit tests Fix test coverage in Snowflake Sep 4, 2025
@misolt misolt marked this pull request as ready for review September 4, 2025 08:56
@misolt misolt changed the title Fix test coverage in Snowflake Fix: insufficient test coverage in Snowflake Sep 4, 2025
@misolt misolt merged commit 82c235a into google:main Sep 12, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants