Skip to content

godot-tester

Choose a tag to compare

@croconut croconut released this 05 Jan 22:21
· 12 commits to master since this release
360be46

for running godot tests made with GUT (and now potentially without GUT)

new additions

  • can ignore SCRIPT ERRORs
  • general improvements to the asset importing process
  • can specify gut config file

additions from the previous releases

  • customizing the test directory path (e.g. tests instead of test)
  • support for alternative release types, previously only stable was supported
  • can set maximum failures with max-fails
  • can check assert pass / fail counts instead of test pass / fail counts

You can also run your own testing framework if you have a scene that can run tests on load and then exit.

You would use the 'direct-scene' option for that and you'll want the output for that scene to be similar to GUT's to help this action's pass / fail to work properly.

Refer to the folder in this action's repo "/tester/test/alt_mode" to see how to up an override test scene for GUT (recommended for applications with heavy duty test setups).

## example setup

name: Godot testing

on: [ push ]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: croconut/godot-tester@v2.5
      with:
        # required
        version: "3.2.2"
        # the type of release of godot that the tests should be run with
        release_type: "rc2"
        is-mono: "true"
        # the folder with your projects.godot file in it
        path: "tester"
        # how long to spend importing assets before tests are run
        import-time: "5"
        # how long tests can run in seconds
        test-timeout: "45"
        # the ratio of tests that must pass for this action to pass
        # e.g. 0.6 means 60% of your tests must pass
        minimum-pass: "0.6"
        # the directory containing Gut tests
        test-dir: "res://test"
        # instead of running GUT's command line tool, you can run a GUT test scene if you have one
        # set up correctly
        # helps enable things like mouse mocking and current scene to work without any extra coding steps
        # set up a scene like in this repo --> located at /tester/test/alt_mode/tests.tscn
        # set up a script like in this repo --> located at /tester/test/alt_mode/cli_plugin.gd
        # ensure cli_plugin.gd inherits from the GUT plugin
        # and exits on test completion
        # ensure tests.tscn uses your modified plugin script and check yes for run on load
        # uses relative path from your godot project directory
        direct-scene: "test/alt_mode/tests.tscn" 
        # default is false, set true to count asserts instead of tests
        assert-check: "true" 
        # not checked by default, set to a number to limit the 
        # maximum amount of failed tests for a passing test suite
        max-fails: 3  
        # to ensure all SCRIPT ERRORs dont contribute to your failure rate        
        ignore-errors: "true" 
        # default is GUTs default: 'res://.gutconfig.json'; set this to load a different config file
        config-file: "res://.myconfig.json" 

What's Changed

  • swap test to pending by @croconut in #14
  • handle custom configuration files, improves import process, enables SCRIPT ERROR ignoring by @croconut in #18

Full Changelog: v2.4...v2.5