Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run headless tests #383

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,41 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Java
- name: Setup java (tests)
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'oracle'
java-version: '22'
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
server-id: 'OpenJFX Test Builds'
server-username: NEXUS_USERNAME
server-password: NEXUS_PASSWORD

- name: Build project (macOS)
if: runner.os == 'macOS'
- name: Build project (Linux/macOS)
if: runner.os != 'Windows'
run: |
./mvnw -B -ntp verify -f rta
./mvnw -B -ntp -Ptest verify -f rta
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}

- name: Build project (Windows)
if: runner.os == 'Windows'
run: |
.\mvnw -B -ntp verify -f rta
.\mvnw -B -ntp -Ptest verify -f rta
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}

- name: Build project (Linux)
if: runner.os == 'Linux'
run: |
export DISPLAY=:90
Xvfb -ac :90 -screen 0 1280x1024x24 > /dev/null 2>&1 &
./mvnw -B -ntp verify -f rta
- name: Setup Java (distribution)
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'oracle'
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN

- name: Publish Snapshots
if: github.ref == 'refs/heads/main' && runner.os == 'Linux'
Expand Down
61 changes: 52 additions & 9 deletions rta/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<javafx.version>23.0.1</javafx.version>
<gpg.plugin.version>3.2.7</gpg.plugin.version>
<emoji.version>1.1.0</emoji.version>
<test.headless/>
<test.javafx.version>24-headless+0-2024-11-30-072408</test.javafx.version>
</properties>

<dependencies>
Expand All @@ -37,16 +39,36 @@
<artifactId>offline</artifactId>
<version>${emoji.version}</version>
</dependency>

<!-- TEST -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.11.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testfx</groupId>
<artifactId>testfx-core</artifactId>
<version>4.0.19-gluon-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testfx</groupId>
<artifactId>testfx-junit5</artifactId>
<version>4.0.18</version>
<version>4.0.19-gluon-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.26.3</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -107,6 +129,21 @@
</repository>
</distributionManagement>

<repositories>
<repository>
<id>Gluon Releases</id>
<url>https://nexus.gluonhq.com/nexus/content/repositories/releases/</url>
</repository>
<repository>
<id>Gluon Snapshots</id>
<url>https://nexus.gluonhq.com/nexus/content/repositories/public-snapshots/</url>
</repository>
<repository>
<id>OpenJFX Test Builds</id>
<url>https://nexus.gluonhq.com/nexus/content/repositories/openjfx-test</url>
</repository>
</repositories>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -150,21 +187,14 @@
<version>3.5.2</version>
<configuration>
<trimStackTrace>false</trimStackTrace>
<argLine>--add-opens javafx.graphics/com.sun.javafx.application=ALL-UNNAMED</argLine>
<argLine>${test.headless} --add-opens javafx.graphics/com.sun.javafx.application=ALL-UNNAMED</argLine>
<systemProperties>
<property>
<name>java.util.logging.config.file</name>
<value>src/test/resources/logging.properties</value>
</property>
</systemProperties>
</configuration>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.11.3</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Expand Down Expand Up @@ -210,5 +240,18 @@
</plugins>
</build>
</profile>
<profile>
<id>test</id>
<properties>
<test.headless>-Dtestfx.headless=true</test.headless>
</properties>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${test.javafx.version}</version>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
Loading