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

E2E Self-Tests of production server and client #1700

Open
wants to merge 3 commits into
base: 1.21.x
Choose a base branch
from

Conversation

shartte
Copy link
Contributor

@shartte shartte commented Nov 24, 2024

Implements the Gradle plumbing to install and start the production client and server straight out of the current NeoForge project.

installProductionClient and installProductionServer install into a build subdirectory. They ensure that the installer our build produces can actually be used to install a NeoForge client and server successfully.

runProductionClient and runProductionServer will run the client/server installed by the previous tasks. This ensures that for the client, our Launcher version manifest can be evaluated and contains all necessary libraries and arguments, while for the server, it ensures that the libraries and argument files are set up correctly.

testProductionClient and testProductionServer extend the previous tasks by using a small piece of "self test" code added to NeoForge itself, which is enabled by environment variables for server & client (separately). If the environment variables are set, the NeoForge code will write a marker-file and exit on the first client/server tick.
The Gradle tasks then validate after the client/server exits, that the file was created. This ensures that the NeoForge server/client can successfully launch and start ticking, exposing various potential startup problems in the process (in case they do not).
If the server/client hang, the tasks will time out after five minutes.

The GH Actions pipeline was extended to run both testProductionClient and testProductionServer for all PRs and feature branches as part of the gametest workflow.

@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Nov 24, 2024

  • Publish PR to GitHub Packages

Last commit published: c84dff083f36e1726bfa7481e4d346e4fa78da9d.

PR Publishing

The artifacts published by this PR:

Repository Declaration

In order to use the artifacts published by the PR, add the following repository to your buildscript:

repositories {
    maven {
        name 'Maven for PR #1700' // https://github.com/neoforged/NeoForge/pull/1700
        url 'https://prmaven.neoforged.net/NeoForge/pr1700'
        content {
            includeModule('net.neoforged', 'neoforge')
            includeModule('net.neoforged', 'testframework')
        }
    }
}

MDK installation

In order to setup a MDK using the latest PR version, run the following commands in a terminal.
The script works on both *nix and Windows as long as you have the JDK bin folder on the path.
The script will clone the MDK in a folder named NeoForge-pr1700.
On Powershell you will need to remove the -L flag from the curl invocation.

mkdir NeoForge-pr1700
cd NeoForge-pr1700
curl -L https://prmaven.neoforged.net/NeoForge/pr1700/net/neoforged/neoforge/21.3.51-beta-pr-1700-feature-e2e-selftest/mdk-pr1700.zip -o mdk.zip
jar xf mdk.zip
rm mdk.zip || del mdk.zip

To test a production environment, you can download the installer from here.

@shartte shartte marked this pull request as ready for review November 26, 2024 22:26
@Technici4n Technici4n self-requested a review November 27, 2024 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants