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

Fix fit ellipsoid test #12

Merged
merged 6 commits into from
Nov 30, 2023
Merged

Fix fit ellipsoid test #12

merged 6 commits into from
Nov 30, 2023

Conversation

stefanhahmann
Copy link
Collaborator

@stefanhahmann stefanhahmann commented Oct 26, 2023

Due to changes in https://github.com/mastodon-sc/mastodon the FitEllipsoidTest was failing on GitHub.

The reason is that the ProjectModel that the test uses instantiates the WindowManager, which instantiates a PreferenceDialog. This would need a graphical environment, which is not present in the Github CI environment.

A workaround for this is a newly introduced class MinimalProjectModel, which is used in the FitEllipsoidPlugin and in the FitEllipsoidPluginTest

…Data and a SelectionModel

* The reasoning behind this new class is to achieve testability of the FitEllipsoidPlugin in a headless way / in a non-graphics supported environment
* This is to allow the class to be used for graphical and non-graphical applications.
@stefanhahmann stefanhahmann self-assigned this Oct 26, 2023
…efactor HeadlessProjectModel to DefaultMinimalProjectModel

* Add javadoc for MinimalProjectModel and DefaultMinimalProjectModel
@stefanhahmann stefanhahmann force-pushed the fix-fit-ellipsoid-test branch from 7da1205 to 5d2bebe Compare November 6, 2023 10:20
@maarzt maarzt self-requested a review November 6, 2023 10:35
Copy link
Contributor

@maarzt maarzt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR fixes the FitEllipsoidPluginTest by using an UI independent MinimalProjectModel for testing.

The new name MinimalProjectModel is I think less confusing than the first idea: HeadlessProjectModel. 👍

Splitting a class into implementation and interface is often a good idea. But I don't think we need it here. (The MinimalProjectModel is for now only meant for testing not part of a plugin API.) Please remove the interface and rename the DefaultMinimalProjectModel to MinimalProjectModel.

…lProjectModel to MinimalProjectModel.

* Splitting into implementation and interface is not needed here. (The MinimalProjectModel is for now only meant for testing not part of a plugin API.)
@stefanhahmann stefanhahmann force-pushed the fix-fit-ellipsoid-test branch from 19659e8 to 2b03a0d Compare November 6, 2023 11:01
@stefanhahmann
Copy link
Collaborator Author

This PR fixes the FitEllipsoidPluginTest by using an UI independent MinimalProjectModel for testing.

The new name MinimalProjectModel is I think less confusing than the first idea: HeadlessProjectModel. 👍

Splitting a class into implementation and interface is often a good idea. But I don't think we need it here. (The MinimalProjectModel is for now only meant for testing not part of a plugin API.) Please remove the interface and rename the DefaultMinimalProjectModel to MinimalProjectModel.

Agreed and Done.

@stefanhahmann
Copy link
Collaborator Author

@tinevez do you think this could be merged? this would fix the currently failing ci.

@maarzt maarzt merged commit 4b10c5b into master Nov 30, 2023
1 check passed
@stefanhahmann stefanhahmann deleted the fix-fit-ellipsoid-test branch April 18, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants