|
22 | 22 | run: |
|
23 | 23 | mvn test --batch-mode --no-transfer-progress -Dcheckstyle.skip \
|
24 | 24 | -Dfmt.skip -DenableTestCoverage
|
| 25 | + # The `envVarTest` profile runs tests that require an environment variable |
| 26 | + - name: Env Var Tests |
| 27 | + run: | |
| 28 | + mvn test --batch-mode --no-transfer-progress -Dcheckstyle.skip \ |
| 29 | + -Dfmt.skip -DenableTestCoverage -PenvVarTest |
| 30 | + # Set the Env Var for this step only |
| 31 | + env: |
| 32 | + GOOGLE_CLOUD_UNIVERSE_DOMAIN: random.com |
25 | 33 | - run: bazelisk version
|
26 | 34 | - name: Install Maven modules
|
27 | 35 | run: |
|
|
63 | 71 | - name: Unit Tests
|
64 | 72 | run: |
|
65 | 73 | mvn test --batch-mode --no-transfer-progress -Dcheckstyle.skip \
|
66 |
| -
|
| 74 | + -Dfmt.skip -DenableTestCoverage |
| 75 | + # The `envVarTest` profile runs tests that require an environment variable |
| 76 | + - name: Env Var Tests |
| 77 | + run: | |
| 78 | + mvn test --batch-mode --no-transfer-progress -Dcheckstyle.skip \ |
| 79 | + -Dfmt.skip -DenableTestCoverage -PenvVarTest |
| 80 | + # Set the Env Var for this step only |
| 81 | + env: |
| 82 | + GOOGLE_CLOUD_UNIVERSE_DOMAIN: random.com |
67 | 83 | - run: bazelisk version
|
68 | 84 | - name: Install Maven modules
|
69 | 85 | run: |
|
@@ -95,14 +111,25 @@ jobs:
|
95 | 111 | export PATH=${JAVA_HOME}/bin:$PATH
|
96 | 112 | # Maven surefire plugin lets us to specify the JVM when running tests via
|
97 | 113 | # the "jvm" system property.
|
98 |
| - mvn org.apache.maven.plugins:maven-surefire-plugin:test \ |
99 |
| - verify \ |
100 |
| - --batch-mode \ |
101 |
| - --no-transfer-progress \ |
102 |
| - -Dcheckstyle.skip \ |
| 114 | + mvn verify --batch-mode --no-transfer-progress -Dcheckstyle.skip \ |
103 | 115 | -Dfmt.skip \
|
104 |
| - -Djvm="${JAVA8_HOME}/bin/java" \ |
105 |
| - -DargLine="-Djava.util.logging.SimpleFormatter.format='%1$tY %1$tl:%1$tM:%1$tS.%1$tL %2$s %4$s: %5$s%6$s%n'" |
| 116 | + -Djvm="${JAVA8_HOME}/bin/java" |
| 117 | + # The `envVarTest` profile runs tests that require an environment variable |
| 118 | + - name: Compile with Java 17 and run tests with Java 8 (Env Var Tests) |
| 119 | + shell: bash |
| 120 | + run: | |
| 121 | + set -x |
| 122 | + export JAVA_HOME=$JAVA_HOME |
| 123 | + export PATH=${JAVA_HOME}/bin:$PATH |
| 124 | + # Maven surefire plugin lets us to specify the JVM when running tests via |
| 125 | + # the "jvm" system property. |
| 126 | + export GOOGLE_CLOUD_UNIVERSE_DOMAIN=random.com |
| 127 | + mvn test --batch-mode --no-transfer-progress -Dcheckstyle.skip \ |
| 128 | + -Dfmt.skip -DenableTestCoverage -Dsurefire.failIfNoSpecifiedTests=false \ |
| 129 | + -PenvVarTest |
| 130 | + # Set the Env Var for this step only |
| 131 | + env: |
| 132 | + GOOGLE_CLOUD_UNIVERSE_DOMAIN: random.com |
106 | 133 |
|
107 | 134 | build-java8-gapic-generator-java:
|
108 | 135 | name: "build(8) for gapic-generator-java"
|
|
0 commit comments