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

Support QUARKUS_TEST_PROFILE environment variable #29951

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class ProfileManager {
public static final String QUARKUS_PROFILE_ENV = "QUARKUS_PROFILE";
public static final String QUARKUS_PROFILE_PROP = "quarkus.profile";
public static final String QUARKUS_TEST_PROFILE_PROP = "quarkus.test.profile";
public static final String QUARKUS_TEST_PROFILE_ENV = "QUARKUS_TEST_PROFILE";
private static final String BACKWARD_COMPATIBLE_QUARKUS_PROFILE_PROP = "quarkus-profile";

private static volatile LaunchMode launchMode = LaunchMode.NORMAL;
Expand Down Expand Up @@ -52,6 +53,10 @@ public static String getActiveProfile() {
if (profile != null) {
return profile;
}
profile = System.getenv(QUARKUS_TEST_PROFILE_ENV);
if (profile != null) {
return profile;
}
return launchMode.getDefaultProfile();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class BootstrapProfile {
public static final String QUARKUS_PROFILE_ENV = "QUARKUS_PROFILE";
public static final String QUARKUS_PROFILE_PROP = "quarkus.profile";
public static final String QUARKUS_TEST_PROFILE_PROP = "quarkus.test.profile";
public static final String QUARKUS_TEST_PROFILE_ENV = "QUARKUS_TEST_PROFILE";
private static final String BACKWARD_COMPATIBLE_QUARKUS_PROFILE_PROP = "quarkus-profile";
public static final String DEV = "dev";
public static final String PROD = "prod";
Expand All @@ -27,6 +28,10 @@ public static String getActiveProfile(QuarkusBootstrap.Mode mode) {
if (profile != null) {
return profile;
}
profile = System.getenv(QUARKUS_TEST_PROFILE_ENV);
if (profile != null) {
return profile;
}
return "test";
}

Expand Down