Issues with running Ghidra tests in CI
See original GitHub issueI setup mirror for the Ghidra, and currently able build Ghidra on Linux and Mac, on public CI. But when I add unit tests and even worse integration tests, I have an problem with running tests in CI environment. I completely understand that this may be not your concern, but maybe you have some advice based on your existing experience with running CI for Ghidra.
Let’s start with running gradlew unitTestReport
Here the error messages which generated on Linux
java.lang.IllegalArgumentException: java.net.MalformedURLException: unknown protocol: ghidra
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11.XToolkit
java.lang.NoClassDefFoundError: Could not initialize class docking.widgets.table.constrainteditor.EnumConstraintEditor
java.lang.NoClassDefFoundError: Could not initialize class docking.widgets.table.constrainteditor.UnsignedLongRangeConstraintEditor
java.lang.NoClassDefFoundError: Could not initialize class docking.widgets.table.constrainteditor.DoubleValueConstraintEditor
java.lang.NoClassDefFoundError: Could not initialize class docking.widgets.table.constrainteditor.DateRangeConstraintEditor
java.lang.NoClassDefFoundError: Could not initialize class docking.widgets.table.constrainteditor.IntegerRangeConstraintEditor
java.lang.NoClassDefFoundError: Could not initialize class docking.widgets.EmptyBorderButton
java.lang.NoClassDefFoundError: Could not initialize class javax.swing.RepaintManager
java.lang.NoClassDefFoundError: Could not initialize class docking.DockingUtils
java.lang.NoClassDefFoundError: Could not initialize class java.awt.GraphicsEnvironment$LocalGE
java.awt.AWTError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
java.lang.AssertionError: Failed to parse expected composite (see log)
All except latest one clearly from inability to see X11 server in CI environment. Last one not clear for me since I have to debug that, or at least take a look (not have time yet). What I want to have right now is ability to run tests which does not involved in the UI part. So here my quuestions:
- How can I run unit tests without running test which involved in UI. I attempt to run
gradew unitTestReport -Djava.awt.headless=true
and try to play with many other different combinations without luck. But funny things I found that you have that: https://github.com/NationalSecurityAgency/ghidra/blob/master/gradle/javaTestProject.gradle#L150 , - Is it possible to make
java.awt.headless=false
switch configurable somehow? Preferable in a way which easy to change in CI environment? - If I annotate tests which are require to use X11 with some category will this change be accepted by Ghidra? There ~450 tests failing due X11 dependency now. I promise to update documentation to reflect that this is possible, or do any similar activity if this is required to make that happens.
- How can I run unit tests just for single project in Ghidra? I assume
gradlew unitTestReport -PDB
but I it runs tests for Base and other projects, which PDB depends on. This is defeats purpose running tests for single project. This allow me to run less tests in one build. Public build has a limit of 1 hour, but I want to run integration tests as well and they do not fit in that time limit when I simply rungradlew integrationTestReport
These build errors prevent me from at least partial validation of the status of my fork.
Link to build with errors, in case sombody interested: https://codevision.visualstudio.com/Ghidra/_build/results?buildId=10106&view=ms.vss-test-web.build-test-results-tab In case if somebody super-interested here link to build definition: https://github.com/kant2002/ghidra-official/blob/dev/.azure/build.yaml
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (5 by maintainers)
Have you tried using a virtual framebuffer such as Xvfb?
You would do something like this:
K I’ll take a look, thanks.