RocketPy-Team / RocketPy

Next generation High-Power Rocketry 6-DOF Trajectory Simulation
https://docs.rocketpy.org/
MIT License
616 stars 146 forks source link

TST: Reorganize only the test_environment.py tests into Integration/Unit Tests #577

Closed lucasfourier closed 3 months ago

lucasfourier commented 6 months ago

Pull request type

Checklist

Current behavior

Currently, the folder tests/integration is empty.

New behavior

Integration tests folder is no longer empty and contains integration tests. They are not new, they were simply moved to the right place.

Breaking change

Additional information

image

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 71.92%. Comparing base (5f57e5f) to head (622ae81). Report is 1 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #577 +/- ## =========================================== - Coverage 73.73% 71.92% -1.81% =========================================== Files 70 70 Lines 10334 10334 =========================================== - Hits 7620 7433 -187 - Misses 2714 2901 +187 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Gui-FernandesBR commented 6 months ago

@lucasfourier , why moving just some of the tests of the tests from tests/test_environment.py instead of all of them? What does set these tests apart?

lucasfourier commented 6 months ago

Because the tests that have been moved can be defined as integration tests as opposed to the remaining ones. The fundamental trait is the communication with external dependencies.

Gui-FernandesBR commented 6 months ago

@lucasfourier Can you please re-work on this branch to move all the integration tests at once instead of just some of the tests?

Gui-FernandesBR commented 4 months ago

@lucasfourier what is the reason for these methods be considered integration and not unit tests? They were moved from unit tests to the integration tests.

  1. test_environment_export_environment_exports_valid_environment_json
  2. test_date_aware_set_date_saves_custom_timezone
  3. test_date_naive_set_date_saves_utc_timezone_by_default

The definition of unit and integration are not clear enough. I think it is important that you write down these definition before proceeding with any changes in this PR. This should take a few minutes, but save you from questions like the 3 above.

lucasfourier commented 3 months ago

@Gui-FernandesBR You are 100% right. For some reason i thought pytz made some http request at some point, but it does not. Every test there is an unit test, thank you.

lucasfourier commented 3 months ago

Tests with connection to API'S/interfaces were moved into the integration folder and therefore are only run with --runslow flag, just for the record.