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

Use initial Quarkus Dev config for test tags and engines #42766

Merged
merged 1 commit into from
Aug 27, 2024
Merged
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 @@ -513,20 +513,20 @@ public void addListener(TestListener listener) {
private void handleApplicationPropertiesChange() {
SmallRyeConfig updatedConfig = getMinimalConfig();

List<String> includeTags = getTrimmedListFromConfig(updatedConfig, "quarkus.test.include-tags").orElse(List.of());
List<String> excludeTags = getTrimmedListFromConfig(updatedConfig, "quarkus.test.exclude-tags").orElse(List.of());
List<String> includeTags = getTrimmedListFromConfig(updatedConfig, "quarkus.test.include-tags").orElse(null);
List<String> excludeTags = getTrimmedListFromConfig(updatedConfig, "quarkus.test.exclude-tags").orElse(null);
String includePattern = updatedConfig.getOptionalValue("quarkus.test.include-pattern", String.class).orElse(null);
String excludePattern = updatedConfig.getOptionalValue("quarkus.test.exclude-pattern", String.class).orElse(null);
List<String> includeEngines = getTrimmedListFromConfig(updatedConfig, "quarkus.test.include-engines").orElse(List.of());
List<String> excludeEngines = getTrimmedListFromConfig(updatedConfig, "quarkus.test.exclude-engines").orElse(List.of());
List<String> includeEngines = getTrimmedListFromConfig(updatedConfig, "quarkus.test.include-engines").orElse(null);
List<String> excludeEngines = getTrimmedListFromConfig(updatedConfig, "quarkus.test.exclude-engines").orElse(null);
TestType testType = updatedConfig.getOptionalValue("quarkus.test.type", TestType.class).orElse(TestType.ALL);

if (!firstRun) {
if (!Objects.equals(includeTags, appPropertiesIncludeTags)) {
this.includeTags = includeTags;
this.includeTags = Objects.requireNonNullElse(includeTags, Collections.emptyList());
Copy link
Member

Choose a reason for hiding this comment

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

Merged it but in the future, let's use List.of() for empty lists (no need to update it here, it's just a comment for future patches). Thanks!

}
if (!Objects.equals(excludeTags, appPropertiesExcludeTags)) {
this.excludeTags = excludeTags;
this.excludeTags = Objects.requireNonNullElse(excludeTags, Collections.emptyList());
}
if (!Objects.equals(includePattern, appPropertiesIncludePattern)) {
if (includePattern == null) {
Expand All @@ -543,10 +543,10 @@ private void handleApplicationPropertiesChange() {
}
}
if (!Objects.equals(includeEngines, appPropertiesIncludeEngines)) {
this.includeEngines = includeEngines;
this.includeEngines = Objects.requireNonNullElse(includeEngines, Collections.emptyList());
}
if (!Objects.equals(excludeEngines, appPropertiesExcludeEngines)) {
this.excludeEngines = excludeEngines;
this.excludeEngines = Objects.requireNonNullElse(excludeEngines, Collections.emptyList());
}
if (!Objects.equals(testType, appPropertiesTestType)) {
this.testType = testType;
Expand Down
Loading