Skript icon indicating copy to clipboard operation
Skript copied to clipboard

Adds back the JUnit testing system

Open TheLimeGlass opened this issue 2 years ago • 1 comments

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

TheLimeGlass avatar Jul 27 '22 08:07 TheLimeGlass

Waiting on https://github.com/SkriptLang/Skript/pull/4994

TheLimeGlass avatar Aug 03 '22 09:08 TheLimeGlass

TODO Add JUnit regression test for code provided in issue https://github.com/SkriptLang/Skript/issues/5016

TheLimeGlass avatar Oct 20 '22 02:10 TheLimeGlass

Add regression tests for https://github.com/SkriptLang/Skript/pull/5300

TheLimeGlass avatar Dec 31 '22 09:12 TheLimeGlass

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.

TheLimeGlass avatar Jan 11 '23 08:01 TheLimeGlass

Both reviews were good changes.

TheLimeGlass avatar Jan 11 '23 08:01 TheLimeGlass

Added descriptions to all the newly added gradle tasks. Untitled

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.

TheLimeGlass avatar Jan 26 '23 07:01 TheLimeGlass