Github操作-由于意外错误(可能是由于构建矩阵配置)导致的工作流失败?

时间:2020-10-20 14:24:47

标签: javafx github-actions headless

我正在运行Github Actions工作流,其中CI工作流中要执行的任务之一是使用testfx和monocle进行无头gui Javafx测试。我没有使用Travis CI或Appveyor。

我在Windows本地运行它没有任何问题,并且gui测试可以正常工作。但是,当我推送到存储库时,相同的gui测试会由于错误而失败。

WARNING: An illegal reflective access operation has occurred

> Task :test
WARNING: Illegal reflective access by org.testfx.toolkit.impl.ApplicationLauncherImpl (file:/home/runner/.gradle/caches/modules-2/files-2.1/org.testfx/testfx-core/4.0.16-alpha/12d7481c9326282f1023bfae9b0f96d91738af96/testfx-core-4.0.16-alpha.jar) to field com.sun.glass.ui.PlatformFactory.instance
WARNING: Please consider reporting this to the maintainers of org.testfx.toolkit.impl.ApplicationLauncherImpl
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

seedu.address.ui.WidgetViewBoxTest > update_matchingContent(FxRobot) FAILED
    java.lang.RuntimeException
        Caused by: java.util.concurrent.ExecutionException
            Caused by: java.lang.reflect.InvocationTargetException
                Caused by: java.lang.AbstractMethodError at WidgetViewBoxTest.java:77
java.lang.AbstractMethodError: Receiver class com.sun.glass.ui.monocle.MonocleTimer does not define or inherit an implementation of the resolved method 'abstract void _pause(long)' of abstract class com.sun.glass.ui.Timer.
    at javafx.graphics/com.sun.glass.ui.Timer.pause(Timer.java:143)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pauseTimer(QuantumToolkit.java:502)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.postPulse(QuantumToolkit.java:489)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$12(QuantumToolkit.java:345)
    at com.sun.glass.ui.monocle.MonocleTimer$1.run(MonocleTimer.java:58)
    at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
    at java.base/java.util.TimerThread.run(Timer.java:506)

这是我针对CI的YAML文件配置。

name: Java CI

on: [push, pull_request]

jobs:
  build:
    strategy:
      matrix:
        platform: [ubuntu-latest]
    runs-on: ${{ matrix.platform }}

    steps:
      - name: Set up repository
        uses: actions/checkout@master

      - name: Set up repository
        uses: actions/checkout@master
        with:
          ref: master

      - name: Merge to master
        run: git checkout --progress --force ${{ github.sha }}

      - name: Run repository-wide tests
        if: runner.os == 'Linux'
        working-directory:  ${{ github.workspace }}/.github
        run: ./run-checks.sh

      - name: Validate Gradle Wrapper
        uses: gradle/wrapper-validation-action@v1

      - name: Setup JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: '11'
          java-package: jdk+fx
      
      - name: Setup headless system
        run: ./gradlew headless

      - name: Build and check with Gradle
        run: ./gradlew check coverage

      - uses: codecov/codecov-action@v1
        if: runner.os == 'Linux'
        with:
          file: ${{ github.workspace }}/build/reports/jacoco/coverage/coverage.xml
          fail_ci_if_error: false

它在Build and check with Gradle处失败。我怀疑作业的构建矩阵设置有问题,但是我不确定是什么原因造成的。

1 个答案:

答案 0 :(得分:0)

您在pom.xml中声明了什么openjfx-monocle版本依赖性?我快速浏览了一下,丢失的_pause(long)方法已在最新版本(v12.0.1+2)中实现。请尝试将openjfx-monocle更新到该版本,并检查是否可以解决问题。

相关问题