Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor UseWorldGenerator and Dependencies annotations in Module Land #5087

Closed
jdrueckert opened this issue Dec 17, 2022 · 9 comments
Closed
Assignees
Labels
Category: Test/QA Requests, Issues and Changes targeting tests and quality assurance Good First Issue Good for learners that are new to Terasology Topic: Stabilization Requests, Issues and Changes related to improving stablity and reducing flakyness Type: Refactoring Request for or implementation of pure and automatic refactorings, e.g. renaming, to improve clarity

Comments

@jdrueckert
Copy link
Member

In the aftermath of #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 Terasology/ModuleTestingEnvironment#76

@jdrueckert jdrueckert added Good First Issue Good for learners that are new to Terasology Topic: Stabilization Requests, Issues and Changes related to improving stablity and reducing flakyness Category: Test/QA Requests, Issues and Changes targeting tests and quality assurance Type: Refactoring Request for or implementation of pure and automatic refactorings, e.g. renaming, to improve clarity labels Dec 17, 2022
@jdrueckert jdrueckert moved this to 🚀 Next Up (5.4.0) in Terasology Stabilization Dec 17, 2022
@jdrueckert
Copy link
Member Author

jdrueckert commented Dec 18, 2022

Module land usages of @UseWorldGenerator:

  • DynamicCities::SettlementEntityManagerTest
  • ItemPipes::ItemPipesTest
  • SimpleFarming::BushAuthoritySystemTest
  • SimpleFarming::PlantAuthoritySystemTest

Module land usages of @Dependencies:

  • Behaviors::BehaviorTests
  • Behaviors::MovementTests
  • DynamicCities::RegionEntitiesTest
  • DynamicCities::SettlementEntityManagerTest
  • Health::BlockTest
  • Health::DamageEventTest
  • Health::RestorationTest
  • Health::RegenTest
  • ItemPipes::ItemPipesTest
  • NameGenerator::CreatureNameGeneratorSystemTest
  • NameGenerator::CreatureNameProviderTest
  • NameGenerator::RegionNameProviderTest
  • NameGenerator::TownNameProviderTest
  • NameGenerator::WaterNameProviderTest
  • Rails:RailsTest
  • SimpleFarming::BushAuthoritySystemTest
  • SimpleFarming::PlantAuthoritySystemTest
  • Tasks::TaskGraphTypeHandlerTest

No additional module land usages of @Tag("MteTest") and @ExtendWith(MTEExtension.class) that were not yet listed above.

@jdrueckert jdrueckert moved this from 🚀 Next Up (5.4.0) to 🏗 In progress in Terasology Stabilization Dec 18, 2022
@jdrueckert jdrueckert self-assigned this Dec 18, 2022
@F14V10
Copy link

F14V10 commented Nov 19, 2023

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")

?

@jdrueckert
Copy link
Member Author

@Sabo2k @F14V10 That's exactly what we have pull request reviews for 😉
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 🙂

@varangian-core
Copy link

I did the same changes last night, right now going through the PR process just to learn it

@jdrueckert
Copy link
Member Author

There's enough modules for which changes are needed, so I'm looking forward to PRs from all of you 😉

@manumafe98
Copy link

Hey! how can I contribute on this one?

@jdrueckert
Copy link
Member Author

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

@manumafe98
Copy link

Thanks @jdrueckert I will give it a try!

@jdrueckert
Copy link
Member Author

All sub-items done 💚

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Test/QA Requests, Issues and Changes targeting tests and quality assurance Good First Issue Good for learners that are new to Terasology Topic: Stabilization Requests, Issues and Changes related to improving stablity and reducing flakyness Type: Refactoring Request for or implementation of pure and automatic refactorings, e.g. renaming, to improve clarity
Projects
Status: 🏗 In progress
Development

No branches or pull requests

4 participants