Skip to content

Commit

Permalink
Fixes #4413 - Add Annotations TCK for Piranha Web Profile (#4423)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnriem authored Dec 22, 2024
1 parent b103fe1 commit f2109a0
Show file tree
Hide file tree
Showing 5 changed files with 244 additions and 13 deletions.
42 changes: 29 additions & 13 deletions .github/workflows/tck-webprofile.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
name: tck-webprofile
on:
push:
paths:
- 'external/webprofile-tck/**'
branches:
- '*'
tags-ignore:
- 'v*'
pull_request:
paths:
- 'external/webprofile-tck/**'
branches:
- '*'
on:
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
jobs:
annotations:
if: github.repository == 'piranhacloud/piranha'
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [ '21' ]
os: [ubuntu-latest]
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- name: Set up Java ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Setup for TCK
run: mvn -B -DskipTests=true -ntp install
- name: Run TCK
run: |
cd external/webprofile-tck/annotations
mvn -B -ntp verify
- name: Test Summary
uses: test-summary/action@v2
with:
paths: "external/webprofile-tck/annotations/runner/target/failsafe-reports/*IT.xml"
if: always()
atinject:
if: github.repository == 'piranhacloud/piranha'
runs-on: ${{ matrix.os }}
Expand Down
61 changes: 61 additions & 0 deletions external/webprofile-tck/annotations/installer/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>cloud.piranha.external.webprofiletck.annotations</groupId>
<artifactId>project</artifactId>
<version>25.1.0-SNAPSHOT</version>
</parent>

<artifactId>piranha-external-webprofiletck-annotations-installer</artifactId>
<packaging>pom</packaging>

<name>Piranha - External - Web Profile TCK - Annotations - Installer</name>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>pre-integration-test</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- Download, unzip and rename TCK -->
<get src="https://download.eclipse.org/jakartaee/annotations/3.0/jakarta-annotations-tck-${annotations.tck.version}.zip"
dest="${project.build.directory}/tck.zip"
skipexisting="true"/>
<unzip src="${project.build.directory}/tck.zip"
dest="${project.build.directory}"/>
<move file="${project.build.directory}/annotations-tck"
tofile="${project.build.directory}/tck"/>

<!-- Install the TCK artifacts into local Maven repository -->
<chmod dir="${project.build.directory}/tck/artifacts"
perm="ugo+rx"
includes="*"/>
<exec dir="${project.build.directory}/tck/artifacts"
executable="./artifact-install.sh"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<!-- skipping here as the runner project runs the actual tests -->
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
49 changes: 49 additions & 0 deletions external/webprofile-tck/annotations/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>cloud.piranha.external.webprofiletck</groupId>
<artifactId>project</artifactId>
<version>25.1.0-SNAPSHOT</version>
</parent>

<groupId>cloud.piranha.external.webprofiletck.annotations</groupId>
<artifactId>project</artifactId>
<packaging>pom</packaging>

<name>Piranha - External - Web Profile TCK - Annotations - Project</name>

<properties>
<annotations.tck.version>3.0.0</annotations.tck.version>
<sigtest-maven-plugin.version>2.2</sigtest-maven-plugin.version>
</properties>

<modules>
<module>installer</module>
<module>runner</module>
</modules>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>cloud.piranha</groupId>
<artifactId>bom</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>jakarta.tck</groupId>
<artifactId>sigtest-maven-plugin</artifactId>
<version>${sigtest-maven-plugin.version}</version>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta-annotations-tck</artifactId>
<version>${annotations.tck.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
104 changes: 104 additions & 0 deletions external/webprofile-tck/annotations/runner/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>cloud.piranha.external.webprofiletck.annotations</groupId>
<artifactId>project</artifactId>
<version>25.1.0-SNAPSHOT</version>
</parent>

<artifactId>piranha-external-webprofiletck-annotations-runner</artifactId>
<packaging>pom</packaging>

<name>Piranha - External - Web Profile TCK - Annotations - Runner</name>

<properties>
<jimage.dir>${project.build.directory}/jimage</jimage.dir>
</properties>
<dependencies>
<dependency>
<groupId>cloud.piranha.external.webprofiletck.annotations</groupId>
<artifactId>piranha-external-webprofiletck-annotations-installer</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta-annotations-tck</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.tck</groupId>
<artifactId>sigtest-maven-plugin</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>pre-integration-test</id>
<phase>pre-integration-test</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<!-- version comes from the BOM import in parent project -->
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<outputDirectory>${project.build.directory}</outputDirectory>
<destFileName>jakarta.annotation-api.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>sig-test</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<dependenciesToScan>jakarta.annotation:jakarta-annotations-tck</dependenciesToScan>
<systemPropertyVariables>
<jimage.dir>${jimage.dir}</jimage.dir>
<sigTestClasspath>${project.build.directory}/jakarta.annotation-api.jar:${jimage.dir}/java.base:${jimage.dir}/java.rmi:${jimage.dir}/java.sql:${jimage.dir}/java.naming</sigTestClasspath>
<ca.sig.generated>true</ca.sig.generated>
<ca.sig.postconstruct>true</ca.sig.postconstruct>
<ca.sig.priority>true</ca.sig.priority>
<ca.sig.predestroy>true</ca.sig.predestroy>
<ca.sig.resource>true</ca.sig.resource>
<ca.sig.resources>true</ca.sig.resources>
<ca.sig.securitydeclareroles>true</ca.sig.securitydeclareroles>
<ca.sig.securitydenyall>true</ca.sig.securitydenyall>
<ca.sig.securitypermitall>true</ca.sig.securitypermitall>
<ca.sig.securityrolesallowed>true</ca.sig.securityrolesallowed>
<ca.sig.securityrunas>true</ca.sig.securityrunas>
<ca.sig.sqldatasourcedefinition>true</ca.sig.sqldatasourcedefinition>
<ca.sig.sqldatasourcedefinitions>true</ca.sig.sqldatasourcedefinitions>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
1 change: 1 addition & 0 deletions external/webprofile-tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<cdi.tck.version>4.0.13</cdi.tck.version>
</properties>
<modules>
<module>annotations</module>
<module>atinject</module>
<module>cdi</module>
<module>jsonb</module>
Expand Down

0 comments on commit f2109a0

Please sign in to comment.