Terasology
Terasology copied to clipboard
Refactor `UseWorldGenerator` and `Dependencies` annotations in Module Land
In the aftermath of https://github.com/MovingBlocks/Terasology/pull/5046 reworking the test annotations for MTE, the UseWorldGenerator and Dependencies annotations need to be replaced all across module land.
Migration Path
The replacement annotation is the class annotation @IntegrationEnvironment which will apply MTEExtension, mark it with an MteTest JUnit tag and includes parameters for world generation and module dependencies.
The worldGenerator parameter is replacing @UseWorldGenerator, the dependencies parameter is replacing @Dependencies.
Contributes to https://github.com/Terasology/ModuleTestingEnvironment/issues/76
Module land usages of @UseWorldGenerator:
- [x]
DynamicCities::SettlementEntityManagerTest - [x]
ItemPipes::ItemPipesTest - [x]
SimpleFarming::BushAuthoritySystemTest - [x]
SimpleFarming::PlantAuthoritySystemTest
Module land usages of @Dependencies:
- [x]
Behaviors::BehaviorTests - [x]
Behaviors::MovementTests - [x]
DynamicCities::RegionEntitiesTest - [x]
DynamicCities::SettlementEntityManagerTest - [x]
Health::BlockTest - [x]
Health::DamageEventTest - [x]
Health::RestorationTest - [x]
Health::RegenTest - [x]
ItemPipes::ItemPipesTest - [x]
NameGenerator::CreatureNameGeneratorSystemTest - [x]
NameGenerator::CreatureNameProviderTest - [x]
NameGenerator::RegionNameProviderTest - [x]
NameGenerator::TownNameProviderTest - [x]
NameGenerator::WaterNameProviderTest - [x]
Rails:RailsTest - [x]
SimpleFarming::BushAuthoritySystemTest - [x]
SimpleFarming::PlantAuthoritySystemTest - [x]
Tasks::TaskGraphTypeHandlerTest
No additional module land usages of @Tag("MteTest") and @ExtendWith(MTEExtension.class) that were not yet listed above.
Hi, I am new to the project and I would like to work on a few simple tasks to familiarize myself with the project. I could at least do some of the refactoring of the annotations.
For the file "PlantAuthoritySystemTest.java" of the "SimpleFarming" module, would you have to replace the lines
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.extension.ExtendWith;
import org.terasology.engine.integrationenvironment.jupiter.Dependencies;
import org.terasology.engine.integrationenvironment.jupiter.UseWorldGenerator;
...
@ExtendWith(MTEExtension.class)
@UseWorldGenerator("unittest:empty")
@Dependencies({"SimpleFarming", "CoreAssets"})
@Tag("MteTest")
with these here
import org.terasology.engine.integrationenvironment.jupiter.IntegrationEnvironment;
...
@IntegrationEnvironment(dependencies={"SimpleFarming", "CoreAssets"}, worldGenerator="unittest:empty")
?
@Sabo2k @F14V10 That's exactly what we have pull request reviews for :wink: Yes, your proposed changes are correct. In the future, please open a PR proposing them and in our review, we'll tell you if there's anything that doesn't look alright :slightly_smiling_face:
I did the same changes last night, right now going through the PR process just to learn it
There's enough modules for which changes are needed, so I'm looking forward to PRs from all of you 😉
Hey! how can I contribute on this one?
Hi @manumafe98, basically follow the issue description. for an example of expected changes, you can also have a look at F14V10's comment above. If you're new to Terasology, check out our getting started website page and guide doc
Thanks @jdrueckert I will give it a try!
All sub-items done 💚