tdymel / LegacyPlayersV3

Official repository of LegacyPlayers v3
GNU Affero General Public License v3.0
18 stars 25 forks source link

Add tests for guild tooltip generation #77

Closed h3ndrk closed 4 years ago

h3ndrk commented 4 years ago

This PR adds 32 tests for testing the guild tooltip generation. The test requirements have been generated with the ACTS tool.

The tests with the ugly names are the tests for the task's submission. After that, I wrote another test that should work much better and should be better maintainable. I tried writing many comments explaining the automatic test value generation for the improved ACTS test.

FYI: All my tests using ACTS as a tool for generation test requirements (not test cases). Therefore the test value generation happens dynamically in the test case. :sunglasses:

Run the new tests with (assuming a running MySQL instance, see README.md):

cargo test --features integration guild_tooltip
h3ndrk commented 4 years ago

Why do you need it to run under "integration"? You don't use the DB do you?

The reason for the tests being integration tests might be that a full database connection is constructed and this is not optional.

https://github.com/Geigerkind/LegacyPlayersV3/blob/34254cd42de37bea2c64fe4004ea73d5741d3644/Backend/src/modules/armory/material/armory.rs#L17-L26

We discussed that already in our chat at 2020-05-15 at ~16:00. Since I inspired myself from the character_tooltip module/test (which is also an integration test), I did not question the fact that all tooltip tests are integration tests. IMHO, changing this is out of the scope of this PR.