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

Remove pytest option to pass msui settings #2170

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

matrss
Copy link
Collaborator

@matrss matrss commented Jan 30, 2024

This option is, to my knowledge, unused and it does not work anymore since the configuration is reset before each test.

Fixes #2190.

Follow up to #2136.

This option is, to my knowledge, unused and it does not work anymore
since the configuration is reset before each test.
@matrss matrss marked this pull request as ready for review February 13, 2024 10:02
Copy link
Member

@ReimarBauer ReimarBauer left a comment

Choose a reason for hiding this comment

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

this was added to simulate an update of the msui_settings.json former mss_settings.json.

We restart the app when the config is changed by the config editor. This was not an automated test, because changes of the default values changes the behaviour of all other tests.

Maybe that can now differently added.

@matrss
Copy link
Collaborator Author

matrss commented Feb 15, 2024

this was added to simulate an update of the msui_settings.json former mss_settings.json.

Why couldn't that happen inside of a test?

We restart the app when the config is changed by the config editor. This was not an automated test, because changes of the default values changes the behaviour of all other tests.

I don't see how this necessitates setting a config file as a pytest option. This should just happen in an ordinary test.

Also, affecting other tests should no longer be an issue since the config file is reset before each test. And also, if a test isn't automated it might as well not exist, because no one will regularly run it.

Maybe that can now differently added.

As its own normal test case, if I understand your issue correctly. I might not, though.

@ReimarBauer
Copy link
Member

I don't know if we have currently a test active which verifies the reload of the configuration by the restart of the application, https://github.com/Open-MSS/MSS/blob/develop/mslib/msui/msui_mainwindow.py#L998

In the past that made trouble and I think all these were skipped

@ReimarBauer
Copy link
Member

I don't disagree with removing it. At the moment I'm more concerned that we don't add it again afterwards and possibly set up a runner.

@matrss
Copy link
Collaborator Author

matrss commented Feb 16, 2024

I don't know if we have currently a test active which verifies the reload of the configuration by the restart of the application, https://github.com/Open-MSS/MSS/blob/develop/mslib/msui/msui_mainwindow.py#L998

In the past that made trouble and I think all these were skipped

I think the test you refer to is this one:

@mock.patch("mslib.msui.editor.get_open_filename", return_value=sample_file)
def test_file_save_and_quit(self, mockfile):
pytest.skip('needs to be run isolated! With the restart of MSS the config for all other tests is changed')
self.window.file_open()
self.window.path = self.save_file_name
self.window.editor.setPlainText(self.window.editor.toPlainText() + " ")
self.window.file_save_and_quit()
assert os.path.exists(self.save_file_name)

All tests in that file are unconditionally skipped because no one bothered to update them after there was a rework to the config editor.

I don't disagree with removing it. At the moment I'm more concerned that we don't add it again afterwards and possibly set up a runner.

The problem you describe is that the above test was never reworked. Actually fixing that test is a different issue than removing an unused and probably broken pytest option.

Copy link
Member

@ReimarBauer ReimarBauer left a comment

Choose a reason for hiding this comment

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

thx

@matrss matrss merged commit c73d9ba into Open-MSS:develop Feb 16, 2024
4 checks passed
@matrss matrss deleted the remove-unused-pytest-option branch February 16, 2024 12:32
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.

Remove the custom pytest option to pass msui settings to tests
2 participants