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

TST: Splitting unit testing module from non unit testes inside the new 'unit' folder for the several testing modules. #499

Merged
merged 14 commits into from
Dec 3, 2023

Conversation

lucasfourier
Copy link
Collaborator

@lucasfourier lucasfourier commented Dec 1, 2023

Pull request type

  • Code changes (bugfix, features)
  • Code maintenance (refactoring, formatting, tests)
  • ReadMe, Docs and GitHub updates
  • Other (please describe):

Checklist

  • Tests for the changes have been added (if needed)
  • Docs have been reviewed and added / updated
  • Lint (black rocketpy/ tests/) has passed locally
  • All tests (pytest --runslow) have passed locally
  • CHANGELOG.md has been updated (if relevant)

Current behavior

Every testing module is inside the 'tests' folder.

New behavior

Inside a newly created folder called 'unit', testing modules which contained only tests classified as unit tests were brought inside the unit folder. There are nine modules inside the 'unit' folder, and all of them should contain only unit tests. This is the beginning of the procedure described in #480. Every testing module outside this 'unit' folder contains only tests which are not unit tests. The test_tank.py was not further analyzed because it needs to be worked on more carefully later.

Breaking change

  • Yes
  • No

Additional information

This PR is part of the effort to reorganize the testing suite. Further information can be found here: #480

New behavior:
image

New folders were created (called 'unit' and 'integration') and a test module named 'test_function.py' was put inside the folder called 'unit.'
Copy link

codecov bot commented Dec 1, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (8def7ad) 71.04% compared to head (13204ce) 71.17%.
Report is 18 commits behind head on develop.

Files Patch % Lines
rocketpy/environment/environment.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #499      +/-   ##
===========================================
+ Coverage    71.04%   71.17%   +0.13%     
===========================================
  Files           55       55              
  Lines         9266     9277      +11     
===========================================
+ Hits          6583     6603      +20     
+ Misses        2683     2674       -9     
Flag Coverage Δ
unittests 71.17% <92.30%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Removing output.json, pytest_html_report.html and the other unnecessary file of the last commit.
Copy link
Member

@Gui-FernandesBR Gui-FernandesBR left a comment

Choose a reason for hiding this comment

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

I think I finally understand this PR after the discussions we had yesterday.

I have nothing against the new tst/testing-suite-reestructuring file.

However, what is the difference between this new file and the currently https://github.com/RocketPy-Team/RocketPy/blob/develop/tests/test_function.py file? I was under the impression you were creating new code but I think you simply copy and past code.

Seems like you duplicated a file. The tests in the tests/test_function.py still exist so you're testing the same thing twice. If that's true, you should use git mv command to move one file to another folder. In that case I suggest you to delete the branch and start this work again.

@lucasfourier lucasfourier changed the title TST: Restructuring the test suite TST: Splitting unit tests from non unit tests inside the new 'unit' folder for the function testing module. Dec 2, 2023
@lucasfourier
Copy link
Collaborator Author

Actually, what was classified as an unit test was kept inside the test_function.py module inside the folder 'unit'. What was not an unit test remained intact in the original test_function.py file.

Thanks a lot to @Gui-FernandesBR which greatly contributed this work.

@lucasfourier lucasfourier marked this pull request as draft December 2, 2023 14:32
@lucasfourier lucasfourier marked this pull request as ready for review December 2, 2023 23:48
@lucasfourier lucasfourier changed the title TST: Splitting unit tests from non unit tests inside the new 'unit' folder for the function testing module. TST: Splitting unit testing module from non unit testes inside the new 'unit' folder for the several testing modules. Dec 3, 2023
@Gui-FernandesBR Gui-FernandesBR added the Tests Regarding Tests label Dec 3, 2023
Copy link
Member

@Gui-FernandesBR Gui-FernandesBR left a comment

Choose a reason for hiding this comment

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

Looks great to me, Great work @lucasfourier !!

In the future we want to run unit tests before integration tests when triggering the github actions, this will save us some time.

Next step is defining the integration tests schema, I"m still not sure how to do or where to save them.

@lucasfourier lucasfourier merged commit 8bd1ade into develop Dec 3, 2023
13 checks passed
@lucasfourier lucasfourier deleted the tst/testing-suite-reestructuring branch December 3, 2023 01:29
@Gui-FernandesBR Gui-FernandesBR added this to the Release v1.X.0 milestone Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tests Regarding Tests
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

3 participants