You are reading the documentation of Golem v0.2.0. The latest version is v0.7.0. Latest docs · What changed · Changelog
Skip to content

Configuration ​

Golem works without any configuration when run from a plugin folder with a tests/ folder.

Command line ​

golem [run] [options]
golem init [--no-workflow]
OptionDefaultDescription
--filter=<text>Only run tests whose Class::method contains <text> (case-insensitive)
--path=<dir>current folderThe plugin folder, containing plugin.yml and src/
--tests=<dir>testsThe tests folder, relative to the plugin
--pocketmine=<version>latestThe PocketMine-MP version to run, e.g. 5.44.3
--log-junit=<file>Also write a JUnit XML report (needs ext-dom)
--timeout=<seconds>600Stop a run that takes longer than this
--watchKeep running: re-run the tests whenever src/, tests/, resources/ or plugin.yml change
--verbosePrint the server console while the tests run
--keepKeep the temporary server folder, to inspect its world or logs
--php=<binary>downloadedUse your own PocketMine PHP build
--phar=<file>downloadedUse your own PocketMine-MP.phar, e.g. a development build
--ansi / --no-ansiautoForce colours on or off. NO_COLOR is respected.

Exit codes: 0 when every test passed (or was skipped), 1 when a test failed or the server crashed, 2 for usage errors such as a missing plugin.yml.

composer.json ​

Project-wide defaults go in extra.golem. Command line options win over them.

json
{
    "extra": {
        "golem": {
            "tests": "tests/golem",
            "pocketmine": "5.44.3",
            "plugins": [
                "dependencies/EconomyAPI.phar",
                "../MyOtherPlugin"
            ]
        }
    }
}
  • tests: the tests folder.
  • pocketmine: pin a PocketMine-MP version so every machine tests against the same one.
  • plugins: other plugins to load alongside yours, typically the ones listed in your depend. .phar files and source folders (with plugin.yml and src/) both work.
  • virions: virions to load that are not in your .poggit.yml (folders with virion.yml and src/, or virion phars).

Virions ​

Golem reads your plugin's .poggit.yml (in its folder, or a parent folder for repositories with several plugins) and loads the virions it lists before your plugin:

yaml
projects:
  MyPlugin:
    libs:
      - src: muqsit/InvMenu/InvMenu    # downloaded from Poggit, cached for a day
        version: ^4.6.0
      - src: libs/MyLocalVirion        # a virion folder or phar in the repository
        vendor: raw

Your source code uses each virion's own namespace (its antigen), and that is the namespace Golem registers: the shading Poggit applies when building the phar is not needed when running from source. Nothing to configure if your plugin already builds on Poggit.

Environment variables ​

VariableDescription
GOLEM_CACHE_DIRWhere PocketMine and its PHP build are cached. Defaults to $XDG_CACHE_HOME/golem, ~/.cache/golem, or ~/Library/Caches/golem on macOS.
NO_COLORDisables colours.

The test server ​

Each run gets a brand new server in a temporary folder, deleted afterwards (unless --keep):

  • a superflat world named golem, survival mode, normal difficulty, shared by the tests (tests marked #[FreshWorld] get their own)
  • Xbox Live authentication off, so golems can log in
  • a random free port on 127.0.0.1, so several runs can happen in parallel
  • player data saving, auto-save, the auto-updater and crash reporting off

Released under the MIT License.