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

[rqd] Rqd tests were not being executed #1560

Merged

Conversation

DiegoTavares
Copy link
Collaborator

@DiegoTavares DiegoTavares commented Oct 26, 2024

The unit tests were not reporting test failures and interruptions as expected, which caused us to be running with failed unit tests for a long time.

This PR replaces unittest with pytest for RQD and fixes some of the relevant unit tests.

unittest was not reporting test failures and interruptions as expected, which caused us to be running with failed unit tests for a long time.

This commit replaces unittest with pytest for rqd and fixes some of the relevant unit tests.
Signed-off-by: Diego Tavares <dtavares@imageworks.com>
@lithorus
Copy link
Contributor

lithorus commented Oct 28, 2024

@DiegoTavares I actually did some initial look into converting things to pytest. You can check some of the work in #1540
Edit:
One of the problems I found was that it was mocking sys.exit which is not the actual function that's called to exit. @mock.patch('os._exit') needs to be done instead.

Since AcademySoftwareFoundation#1308 rqd stopped supporting stats files containing whitespaces and parenthesis.
There's a whole test suite dedicated to nimby, this unit test is unreliable and don't accomplish enough to justify its existence
@DiegoTavares DiegoTavares changed the title Rqd tests were not being executed [rqd_test] Rqd tests were not being executed Oct 28, 2024
@DiegoTavares DiegoTavares marked this pull request as ready for review October 28, 2024 23:00
@DiegoTavares
Copy link
Collaborator Author

@lithorus I propose we migrate all the python modules to pytest, similarly to what was done here. PyTest's output is way easier to follow and it is more reliable when it comes to having snippet that calls sys.exit

@lithorus
Copy link
Contributor

@lithorus I propose we migrate all the python modules to pytest, similarly to what was done here. PyTest's output is way easier to follow and it is more reliable when it comes to having snippet that calls sys.exit

I agree. When testing with it I also found it to have better output, but it just seemed like a big task for what I was trying to do at the time.

@DiegoTavares DiegoTavares marked this pull request as ready for review October 29, 2024 22:32
@DiegoTavares
Copy link
Collaborator Author

This PR requires a blog post or documentation entry to be merged

@ramonfigueiredo ramonfigueiredo changed the title [rqd_test] Rqd tests were not being executed [rqd] Rqd tests were not being executed Nov 5, 2024
Copy link
Collaborator

@ramonfigueiredo ramonfigueiredo left a comment

Choose a reason for hiding this comment

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

Approved with minor changes!

rqd/rqd/rqmachine.py Show resolved Hide resolved
rqd/rqd/rqmachine.py Show resolved Hide resolved
@DiegoTavares DiegoTavares merged commit 3341bcb into AcademySoftwareFoundation:master Nov 5, 2024
12 checks passed
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.

3 participants