Skip to content

Commit 1fcd379

Browse files
ludochgae-java-bot
authored andcommitted
Use project version from Maven in tests.
Replace hardcoded "4.0.3-SNAPSHOT" with the actual project version by passing ${project.version} as a system property to the Maven Surefire plugin. This ensures tests correctly locate build artifacts regardless of the current project version. PiperOrigin-RevId: 871341195 Change-Id: I447c7cc3a440e8b99f8607110ce265c9f735dab7
1 parent a037536 commit 1fcd379

5 files changed

Lines changed: 21 additions & 4 deletions

File tree

appengine_setup/test/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@
7474
<groupId>org.apache.maven.plugins</groupId>
7575
<artifactId>maven-surefire-plugin</artifactId>
7676
<version>3.2.5</version>
77+
<configuration>
78+
<systemPropertyVariables>
79+
<appengine.projectversion>${project.version}</appengine.projectversion>
80+
</systemPropertyVariables>
81+
</configuration>
7782
</plugin>
7883
<plugin>
7984
<groupId>com.jcabi</groupId>

appengine_setup/test/src/test/java/com/google/appengine/setup/test/Jetty12TestAppTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ protected String appName() {
2626
@Override
2727
protected String relativePathForUserApplicationJar() {
2828
return "../testapps/jetty12_testapp/target/"
29-
+ "jetty12_testapp-4.0.3-SNAPSHOT-jar-with-dependencies.jar";
29+
+ "jetty12_testapp-"
30+
+ System.getProperty("appengine.projectversion")
31+
+ "-jar-with-dependencies.jar";
3032
}
3133
}

appengine_setup/test/src/test/java/com/google/appengine/setup/test/SpringBootTestAppTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ protected String appName() {
2525

2626
@Override
2727
protected String relativePathForUserApplicationJar() {
28-
return "../testapps/springboot_testapp/target/" + "springboot_testapp-4.0.3-SNAPSHOT.jar";
28+
return "../testapps/springboot_testapp/target/"
29+
+ "springboot_testapp-"
30+
+ System.getProperty("appengine.projectversion")
31+
+ ".jar";
2932
}
3033
}

appengine_setup/test/src/test/java/com/google/appengine/setup/test/util/TestUtil.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ public static HttpClient initializeHttpClient(int timeoutMillis) {
6262
@SneakyThrows
6363
public static Process initializeHttpApiServer() {
6464
String apiServerRelativeJarPath =
65-
"../apiserver_local/target/" + "apiserver_local-4.0.3-SNAPSHOT-jar-with-dependencies.jar";
65+
"../apiserver_local/target/"
66+
+ "apiserver_local-"
67+
+ System.getProperty("appengine.projectversion")
68+
+ "-jar-with-dependencies.jar";
6669
File currentDirectory = new File("").getAbsoluteFile();
6770
File apiServerJar = new File(currentDirectory, apiServerRelativeJarPath);
6871
ImmutableList<String> processArgs = ImmutableList.<String>builder()

runtime/test/src/test/java/com/google/apphosting/runtime/tests/GuestBookTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ public GuestBookTest(
7575
System.setProperty("appengine.sdk.root", "../../sdk_assembly/target/appengine-java-sdk");
7676
String[] args = {
7777
"stage",
78-
appRootTarget.getAbsolutePath() + "/target/" + appName + "-4.0.3-SNAPSHOT",
78+
appRootTarget.getAbsolutePath()
79+
+ "/target/"
80+
+ appName
81+
+ "-"
82+
+ System.getProperty("appengine.projectversion"),
7983
appRootTarget.getAbsolutePath() + "/target/appengine-staging"
8084
};
8185
AppCfg.main(args);

0 commit comments

Comments
 (0)