MT-CTF / capturetheflag

Capture the Flag game using the Minetest Voxel Engine
https://ctf.rubenwardy.com
81 stars 88 forks source link

CI idea: Check PRs and the main branch for successfully running #1197

Open farooqkz opened 1 year ago

farooqkz commented 1 year ago

We could possibly check if the code works upon launch by launching a test server(in Github Actions?)

Additionally, we could possibly check if various aspects of the game works. Not sure what is the best way for this. One way is launching a test server and connecting a test client which does somethings. Like throwing grenade to see if the grenade can be thrown without a crash. In other words, we can write test cases for the game.

Emojigit commented 1 year ago

If we really do that, we might need a way to interact with the Minetest client engine. I am thinking a hacked client, combined with a headless Xorg server, but if Minetest Engine itself can make some shared libraries for building a test client, it would be better.

LoneWolfHT commented 1 year ago

headless clients exist, but it's not really possible for testing code to do any more than the developer just testing their code locally

farooqkz commented 1 year ago

headless clients exist, but it's not really possible for testing code to do any more than the developer just testing their code locally

That's exactly the point. We make some common tests automatic. Therefore we can know about the PRs and the master/main branch that certain things work for sure without having to test the PRs ourselves.

LoneWolfHT commented 1 year ago

If you make a PR you should test it. I don't want to allow bad habits to form

farooqkz commented 1 year ago

If you make a PR you should test it. I don't want to allow bad habits to form

Yeah and if I don't test it, the merging will be blocked. As a usage example.

LoneWolfHT commented 1 year ago

Yeah and if I don't test it, the merging will be blocked. As a usage example.

There's no point in the suggested automated testing in that case then

farooqkz commented 1 year ago

Yeah and if I don't test it, the merging will be blocked. As a usage example.

There's no point in the suggested automated testing in that case then

I don't understand. Can you elaborate on your point? My point is that, like any other program, this game could have unit tests and use Actions+Headless client to enforce them.

LoneWolfHT commented 1 year ago

I'd prefer to have code documentation before we start doing unit tests https://github.com/MT-CTF/capturetheflag/blob/master/docs/ctf-api.md