-
-
Notifications
You must be signed in to change notification settings - Fork 75
CommandAPI Bukkit testing matrix
Jorel Ali edited this page Jan 12, 2023
·
2 revisions
To test the CommandAPI for Bukkit, we have a matrix of tests in commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test.
The testing matrix structure is as follows:
commandapi-bukkit-test/
├── commandapi-bukkit-test-impl
├── commandapi-bukkit-test-impl-1.16.5
├── commandapi-bukkit-test-impl-1.17
├── commandapi-bukkit-test-impl-1.18
├── ...
├── commandapi-bukkit-test-tests
├── commandapi-bukkit-test-tests-1.16.5
├── commandapi-bukkit-test-tests-1.17
├── commandapi-bukkit-test-tests-1.18
├── ...
└── pom.xml
There are four primary components:
-
commandapi-bukkit-test-impl. This is a collection of interfaces and templates for thecommandapi-bukkit-test-impl-a.b.cmodules -
commandapi-bukkit-test-impl-a.b.c. This is an implementation ofMockNMS, the primary wrapper forNMSspecific to Minecraft versiona.b.c -
commandapi-bukkit-test-tests. This is a collection of tests to run -
commandapi-bukkit-test-tests-a.b.c. This is a collection of tests to run specific to Minecraft versionx.x.xthat would otherwise be unable to test incommandapi-bukkit-test-tests
Developer's Note:
At the time of writing (12th Jan 2023) The testing matrix is still in very early development!
commandapi-bukkit-test-impldoesn't exist yet! For now, usecommandapi-bukkit-test-impl-1.19.2.
-
commandapi-bukkit-test-testsshould be built against the lowest version of Minecraft (1.13) -
commandapi-bukkit-test-testsshould be run against all versions (1.13 - 1.19.3) using the variousMinecraft_a_b_cprofiles -
commandapi-bukkit-test-tests-a.b.cshould ONLY be run against versiona.b.c -
commandapi-bukkit-test-tests-a.b.candcommandapi-bukkit-test-tests-d.e.fmay have overlapping tests. This is fine and should be the only place in the repo with copy/pasta all over the place
To figure out where this argument goes depends on the version (or versions) of Minecraft that this argument is compatible with. For arguments compatible with all Minecraft versions, start with commandapi-bukkit-test-impl and commandapi-bukkit-test-tests. Then follow these steps:
- Create a class
Argument<Name>Tests.javaindev.jorel.commandapi.test.arguments. For example, aListArgumenttest needs to be underArgumentListTests.java. It's probably easier to copy an existing file, such asArgumentTimeTests.java- Make sure your class extends
TestBase - Declare your
setUp()andtearDown()methods and place those under aSetupcomment - Declare your
Testscomment andSuggestion testscomment
- Make sure your class extends
- Write your tests. Depending on the test type, follow these guidelines
For execution tests (testing the command runs):
- Declare them in a method
executionTestWith<Name>Argument() - Declare one command per method
- Add
assertNoMoreResults(results)at the end if you've usedMut<> results = Mut.of()at the top
- Declare them in a method
suggestionTestWith<Name>Argument()