-
Notifications
You must be signed in to change notification settings - Fork 9
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
RUMM-2346 Add more environment variables #109
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,6 +78,8 @@ internal class DdAndroidGradlePluginTest { | |
fakeFlavorNames = fakeFlavorNames.take(5) // A D F G A♭ A A♭ G F | ||
fakeProject = ProjectBuilder.builder().build() | ||
testedPlugin = DdAndroidGradlePlugin(mock()) | ||
setEnv(DdAndroidGradlePlugin.DD_API_KEY, "") | ||
setEnv(DdAndroidGradlePlugin.DATADOG_API_KEY, "") | ||
Comment on lines
+81
to
+82
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is it mostly for cleanup? per code logic having an empty value is not different from not having env variable at all, so it seems these 2 lines don't make any change compared to the current setup (only if to clean up values set by some tests). If it is for the cleanup, maybe it is better to remove env variables for the clean state? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it's for cleanup, the test for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. interesting, it seems there is no easy way to delete them |
||
} | ||
|
||
// region configureVariant() | ||
|
@@ -486,6 +488,19 @@ internal class DdAndroidGradlePluginTest { | |
assertThat(apiKey.source).isEqualTo(ApiKeySource.ENVIRONMENT) | ||
} | ||
|
||
@Test | ||
fun `𝕄 resolve API KEY from alternative environment variable 𝕎 resolveApiKey()`() { | ||
// Given | ||
setEnv(DdAndroidGradlePlugin.DATADOG_API_KEY, fakeApiKey.value) | ||
|
||
// When | ||
val apiKey = testedPlugin.resolveApiKey(fakeProject) | ||
|
||
// Then | ||
assertThat(apiKey.value).isEqualTo(fakeApiKey.value) | ||
assertThat(apiKey.source).isEqualTo(ApiKeySource.ENVIRONMENT) | ||
} | ||
|
||
@Test | ||
fun `𝕄 returns empty String 𝕎 resolveApiKey() {key not defined anywhere}`() { | ||
// When | ||
|
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.
can be also written like:
but I'm also fine with introducing another variable, it is a minor thing anyway