Skip to content

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

Fix Java tests not running headless on Mac (#7260)

James Brunton4191d347ff73
diff --git a/.taskfiles/backend.yml b/.taskfiles/backend.yml
index dde75433a8..fbabd783a3 100644
--- a/.taskfiles/backend.yml
+++ b/.taskfiles/backend.yml
@@ -114,6 +114,15 @@ tasks:
- cmd: ./gradlew test
platforms: [linux, darwin]
+ test:force:
+ desc: "Run backend tests, ignoring cached results"
+ aliases: [test:no-cache]
+ cmds:
+ - cmd: cmd /c ".\gradlew.bat cleanTest test --no-build-cache"
+ platforms: [windows]
+ - cmd: ./gradlew cleanTest test --no-build-cache
+ platforms: [linux, darwin]
+
format:
desc: "Auto-fix code formatting"
cmds:
diff --git a/build.gradle b/build.gradle
index 5f29508958..28e20c9b15 100644
--- a/build.gradle
+++ b/build.gradle
@@ -292,6 +292,8 @@ subprojects {
tasks.withType(Test).configureEach {
useJUnitPlatform()
+ systemProperty 'java.awt.headless', 'true'
+ systemProperty 'apple.awt.UIElement', 'true'
finalizedBy(jacocoReport)
}