Skip to content

Commit 97f1a42

Browse files
authored
chore: fix buildpack integration tests (#198)
1 parent 5264e35 commit 97f1a42

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

invoker/conformance/buildpack_pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
<dependency>
2727
<groupId>com.google.cloud.functions</groupId>
2828
<artifactId>functions-framework-api</artifactId>
29-
<version>0.0.0-SNAPSHOT</version>
29+
<version>FRAMEWORK-API-VERSION</version>
3030
</dependency>
3131
<dependency>
3232
<groupId>com.google.cloud.functions.invoker</groupId>
3333
<artifactId>java-function-invoker</artifactId>
34-
<version>0.0.0-SNAPSHOT</version>
34+
<version>INVOKER-VERSION</version>
3535
</dependency>
3636
<dependency>
3737
<groupId>com.google.code.gson</groupId>

invoker/conformance/prerun.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,26 @@ mkdir /tmp/tests
2727

2828
cp -r $REPO_ROOT/invoker/conformance /tmp/tests
2929

30-
cd $REPO_ROOT/invoker
31-
mvn versions:set -DnewVersion=0.0.0-SNAPSHOT -DprocessAllModules=true
30+
function get_mvn_version() {
31+
mvn -q \
32+
-Dexec.executable=echo \
33+
-Dexec.args='${project.version}' \
34+
--non-recursive \
35+
exec:exec
36+
}
37+
38+
# Must first install a local version of the API package
39+
cd $REPO_ROOT/functions-framework-api
3240
mvn install -Dmaven.repo.local=/tmp/tests/conformance/artifacts
41+
FRAMEWORK_API_VERSION=$(get_mvn_version)
3342

34-
cd $REPO_ROOT/functions-framework-api
35-
mvn versions:set -DnewVersion=0.0.0-SNAPSHOT -DprocessAllModules=true
43+
# Build invoker packages against the latest API package
44+
cd $REPO_ROOT/invoker
3645
mvn install -Dmaven.repo.local=/tmp/tests/conformance/artifacts
46+
INVOKER_VERSION=$(get_mvn_version)
3747

3848
rm /tmp/tests/conformance/pom.xml
3949
mv /tmp/tests/conformance/buildpack_pom.xml /tmp/tests/conformance/pom.xml
50+
51+
sed -i "s/FRAMEWORK-API-VERSION/${FRAMEWORK_API_VERSION}/g" /tmp/tests/conformance/pom.xml
52+
sed -i "s/INVOKER-VERSION/${INVOKER_VERSION}/g" /tmp/tests/conformance/pom.xml

0 commit comments

Comments
 (0)