ScriptCraft

ScriptCraft

14.6k Downloads

Create test suite

jwulf opened this issue ยท 3 comments

commented

The current CI has no tests in it.

I got Jasmine working in Minecraft and use it to unit test the Magikcraft plugins that are built on top of ScriptCraft (example). I also have this working with Nukkit to test our code on Minecraft PE.

It should be possible to layer the SMA image and build different ones with various server combinations, such as Paper 1.14 / 1.15 / 1.15.2, Spigot 1.14 / 1.15 / 1.15.2 etc, Nukkit and write unit tests for ScriptCraft. That way we can know to some degree what combinations are working, and detect when things break and how effective our fixes are.

It's worth it for me to invest some time in doing this, to get it working generally and for the specific version combinations that I am targeting, because ScriptCraft is upstream for Magikcraft - and if I do the work upstream other people can leverage it to add test configs for the combinations that they are using.

commented

I can't get Travis working on the @Magikcraft org without paying for a Travis account it seems, so I'll see if I can automate my own tests with GitHub actions, then see if I can do it with our ScriptCraft fork.

commented

Looks promising...
Screen Shot 2020-01-28 at 3 00 37 am

commented

Got it working. I followed this: https://medium.com/8fit-tech-blog/github-actions-running-javascript-unit-tests-on-docker-20e2426ddc1

Tomorrow I'll get it working in the Magikcraft fork of ScriptCraft. First I will get the Travis build as a GitHub action and PR that in. we'll need that, because we need the built artifacts to run tests on.