Changes

663 bytes added ,  15:01, 20 November 2022
Fixing gameTestServer: reminder from a month ago
Line 251: Line 251:     
The Game Test Server is a special configuration which runs a build server. The build server returns an exit code of the number of required, failed Game Tests. All failed tests, whether required or optional, are logged. This server can be run using <code>gradlew runGameTestServer</code>.
 
The Game Test Server is a special configuration which runs a build server. The build server returns an exit code of the number of required, failed Game Tests. All failed tests, whether required or optional, are logged. This server can be run using <code>gradlew runGameTestServer</code>.
 +
 +
==== Failure on Successful Test Execution ====
 +
 +
Due to a quirk in how Gradle works, by default, if a task forces a system exit before it has finished executing, even in a zero code exit, the task will be marked as the failure. ForgeGradle sets by default a force exit on run tasks such that any subprojects are not executed in sequence. However, as such, the Game Test Server will always fail.
 +
 +
This can be fixed by disabling the force exit on the run configuration using the <code>#setForceExit</code> method:
 +
 +
<syntaxhighlight lang="gradle">
 +
// For the Game Test Server run configuration
 +
gameTestServer {
 +
    // ...
 +
    setForceExit false
 +
}
 +
</syntaxhighlight>
    
=== Enabling Game Tests in Other Run Configurations ===
 
=== Enabling Game Tests in Other Run Configurations ===