WIP: Improve test data creation #112

Draft
ansv7779 wants to merge 4 commits from test-data-improvements into develop
Owner

Currently there is only one class used to add test data; DataInitializer. That class is already very large and causes a lot of merge conflicts when multiple changes are in the pipeline as noted by #109.

This change makes it possible to have multiple classes adding test data so that each change adds its own class and thus there are no conflicts. It also has the benefit of making each class smaller and more self-contained for testing a specific feature.

Some additional infrastructure was added in the form of the BaseData and Factory (naming improvements notwithstanding) interfaces to help each class add its own test data and re-use common data.

Finally all test data related classes have been moved to their own module so they can be properly excluded when building for production but are included by default while developing.

Fixes #109

Currently there is only one class used to add test data; [`DataInitializer`](https://gitea.dsv.su.se/DMC/scipro/src/commit/b9f7dd5a49aeebd64a5f44b66ac0775901550476/core/src/main/java/se/su/dsv/scipro/DataInitializer.java). That class is already very large and causes a lot of merge conflicts when multiple changes are in the pipeline as noted by #109. This change makes it possible to have multiple classes adding test data so that each change adds its own class and thus there are no conflicts. It also has the benefit of making each class smaller and more self-contained for testing a specific feature. Some additional infrastructure was added in the form of the `BaseData` and `Factory` (naming improvements notwithstanding) interfaces to help each class add its own test data and re-use common data. Finally all test data related classes have been moved to their own module so they can be properly excluded when building for production but are included by default while developing. Fixes #109
ansv7779 added 4 commits 2025-02-17 15:59:39 +01:00
There will be a lot more test data infrastructure in the future so moving it all to a separate module makes sense.
Document how to add new test data populators
Some checks failed
Deploy to branch.dsv.su.se / deploy (pull_request) Failing after 1m21s
Build and test / build-and-test (push) Successful in 17m48s
c17af42dc9
Some checks failed
Deploy to branch.dsv.su.se / deploy (pull_request) Failing after 1m21s
Build and test / build-and-test (push) Successful in 17m48s
This pull request has changes conflicting with the target branch.
  • core/src/main/java/se/su/dsv/scipro/DataInitializer.java

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin test-data-improvements:test-data-improvements
git checkout test-data-improvements
Sign in to join this conversation.
No description provided.