Skip to content

Commit

Permalink
Fix SPI compatibility test to not use latest release
Browse files Browse the repository at this point in the history
This makes the test deterministic and allows running on older branches.
  • Loading branch information
electrum committed May 9, 2022
1 parent ffb09f9 commit b465ec0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
1 change: 0 additions & 1 deletion core/trino-server-rpm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>groovy-maven-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<phase>prepare-package</phase>
Expand Down
26 changes: 19 additions & 7 deletions core/trino-spi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
<include>io/trino/spi/trino-spi-version.txt</include>
</includes>
</resource>

<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
Expand All @@ -125,28 +126,39 @@
</excludes>
</resource>
</resources>

<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.3.0</version>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>groovy-maven-plugin</artifactId>
<executions>
<execution>
<id>released-version</id>
<phase>generate-test-resources</phase>
<goals>
<!-- sets releasedVersion.version -->
<goal>released-version</goal>
<goal>execute</goal>
</goals>
<configuration>
<source>
def match = project.version =~ /(\d+)(?:-SNAPSHOT)?/
if (!match.matches()) {
throw new RuntimeException("Invalid version: " + project.version)
}
int version = (match.group(1) as int) - 1
project.properties.setProperty('releasedVersion', version as String)
</source>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>generate-resources</phase>
<phase>generate-test-resources</phase>
<goals>
<goal>copy</goal>
</goals>
Expand All @@ -156,7 +168,7 @@
<artifactItem>
<groupId>io.trino</groupId>
<artifactId>trino-spi</artifactId>
<version>${releasedVersion.version}</version>
<version>${releasedVersion}</version>
<type>jar</type>
<outputDirectory>${released-artifacts.dir}</outputDirectory>
</artifactItem>
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1716,9 +1716,9 @@
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>groovy-maven-plugin</artifactId>
<version>2.1.1</version>
</plugin>

<plugin>
Expand Down

0 comments on commit b465ec0

Please sign in to comment.