Skip to content

Commit 8079dcd

Browse files
authored
simplify getting the test names (#1416)
* fix * make it a constant * placeholder commit
1 parent 3dada6f commit 8079dcd

File tree

2 files changed

+5
-3
lines changed
  • .github/workflows/composites/maven-build-with-dry-run-for-tests
  • spring-cloud-kubernetes-test-support/src/main/java/org/springframework/cloud/kubernetes/tests/commons/junit_extension

2 files changed

+5
-3
lines changed

.github/workflows/composites/maven-build-with-dry-run-for-tests/action.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ runs:
88
run: |
99
# find all the tests that are supposed to be run, but don't actually run them.
1010
# this is achieved via: 'spring.cloud.k8s.skip.tests=true' in DisabledTestsCondition
11-
./mvnw clean install -B -Dskip.build.image=true -Dspring.cloud.k8s.skip.tests=true \
11+
./mvnw test -B -Dskip.build.image=true -Dspring.cloud.k8s.skip.tests=true \
1212
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=error \
13-
-T 1C > /tmp/tests.txt
13+
-T 1C -q > /tmp/tests.txt
1414
1515
- name: show result
1616
if: always()

spring-cloud-kubernetes-test-support/src/main/java/org/springframework/cloud/kubernetes/tests/commons/junit_extension/DisabledTestsCondition.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@
3737
*/
3838
public class DisabledTestsCondition implements ExecutionCondition {
3939

40+
private static final boolean SKIP_RUNNING_TESTS = "true".equals(System.getProperty("spring.cloud.k8s.skip.tests"));
41+
4042
@Override
4143
public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext extensionContext) {
42-
if ("true".equals(System.getProperty("spring.cloud.k8s.skip.tests"))) {
44+
if (SKIP_RUNNING_TESTS) {
4345
System.out.println(
4446
"\nspring.cloud.k8s.test.to.run -> " + extensionContext.getRequiredTestClass().getName() + " \n");
4547
return ConditionEvaluationResult.disabled("");

0 commit comments

Comments
 (0)