-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract ClearGithubEnvVariablesExtension
- Loading branch information
1 parent
95008c1
commit 599a6dc
Showing
3 changed files
with
23 additions
and
16 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
...t/groovy/pl/allegro/tech/build/axion/release/util/ClearGithubEnvVariablesExtension.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package pl.allegro.tech.build.axion.release.util | ||
|
||
import org.spockframework.runtime.extension.IGlobalExtension | ||
|
||
import static java.util.stream.Collectors.toList | ||
|
||
class ClearGithubEnvVariablesExtension implements IGlobalExtension { | ||
|
||
@Override | ||
void start() { | ||
def keysToRemove = TestEnvironment.getEnvVariableNames().stream() | ||
.filter { variableName -> variableName.startsWith("GITHUB_") } | ||
.collect(toList()) | ||
keysToRemove.forEach(TestEnvironment::unsetEnvVariable) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/test/resources/META-INF/services/org.spockframework.runtime.extension.IGlobalExtension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
pl.allegro.tech.build.axion.release.util.TestEnvironment | ||
pl.allegro.tech.build.axion.release.util.ClearGithubEnvVariablesExtension |