Skip to content
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

Get test coverage for telemetry reporting (was missing) + Fix SnowflakeServiceClient test code to allow per-API overrides #839

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

sfc-gh-hmadan
Copy link
Collaborator

As part of bringing in ExternalVolume (presigned url based uploads), I decided to not add test-only code into ExtVol / ExtVolManager. This meant the following:

  1. All the httpClient mock logic to return hardcoded responses now needs to handle multiple APIs (client configure AND getPresignedUrls) - this looked very similar to MockSnowflakeServiceClient logic but duplicated 10 times.
  2. To fix this, introduced a per-API behavior override mechanism in MockSNowflakeServiceClient; helped me remove hundreds of lines of code that was just setting up the httpclient mock, and reduce how brittle that setup is
  3. To do away with isTestMode in InternalStage / InternalStageManager, also did the following two changes:
    1. Make the snowflake service client respond to telemetry upload calls correctly when isTestMode is false
    2. Initialize the telemetry client even when isTestMode is false

Tested all affected unit test classes locally

Copy link
Contributor

@sfc-gh-alhuang sfc-gh-alhuang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@sfc-gh-hmadan sfc-gh-hmadan merged commit 0919151 into master Sep 23, 2024
45 checks passed
@sfc-gh-hmadan sfc-gh-hmadan deleted the hmadan-fixmockserviceclient branch September 23, 2024 23:01
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