Skript
Skript copied to clipboard
Adds back the JUnit testing system
Description
Adds back the JUnit testing system.
- Adds JUnit tests under src/test/java again.
- All tests under src/test/java are ran with the test runner server using JUnit.
- Renamed ch.njol.skript.tests to ch.njol.skript.test so that static loadClasses can read ch.njol.skript.test.tests without other classes interfering.
- The old JUnit testing used to run each time the jar was built, this was annoying but not an issue. This pull request keeps the runtime tests separate from the
gradlew clean build
task.
Notes:
- I'll update the test development README to reflect how to contribute Java side tests when this pull request is nearing merge.
- This is superior to https://github.com/SkriptLang/Skript/pull/4670 because it actually uses the JUnit library and runs along side the test runner server without needing a script .sk existing, just a typical JUnit class.
- For some reason JUnit 4 is the only version that has the JUnitCore runner that allows runtime unit checking, so we have to use JUnit 4, which is fine, we just need standard JUnit functionality.
- After merge, if Dependabot creates a pull request to update to JUnit 5, i'll close that issue and add ignore states to the dependabot file.
Related Issues: https://github.com/SkriptLang/Skript/issues/4973
Waiting on https://github.com/SkriptLang/Skript/pull/4994
TODO Add JUnit regression test for code provided in issue https://github.com/SkriptLang/Skript/issues/5016
Add regression tests for https://github.com/SkriptLang/Skript/pull/5300
Added an objective completeness system. A script defines string objectives that the JUnit needs to complete in conjunction with any runtime things the test is doing. New syntax at EffObjectives in test runner package.
Both reviews were good changes.
Added descriptions to all the newly added gradle tasks.
https://github.com/SkriptLang/Skript/pull/5299 is going to convert the multiple booleans making the methods long into enums, so it's best to deal with it then.