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

Feature/restructure tests #265

Merged
merged 3 commits into from
Jul 5, 2024
Merged

Feature/restructure tests #265

merged 3 commits into from
Jul 5, 2024

Conversation

ladsmund
Copy link
Contributor

Refactored and Organized Test Modules

  • Moved test modules and data from the package directory to the root-level tests directory.
  • Updated directory structure to ensure clear separation of source code and tests.
  • Updated import statements in test modules to reflect new paths.
  • Restructured the tests module:
      - Renamed original automatic tests to e2e as they primarily test the main CLI scripts.
      - Added unit directory for unit tests.
      - Created data directory for shared test data files.

This comprehensive refactoring improves project organization by clearly separating test code from application code. It facilitates easier test discovery and enhances maintainability by following common best practices.

@ladsmund ladsmund force-pushed the feature/restructure_tests branch 2 times, most recently from 1e682ae to 792d121 Compare June 28, 2024 11:05
@ladsmund ladsmund changed the base branch from main to develop June 28, 2024 11:05
@ladsmund ladsmund force-pushed the feature/restructure_tests branch from 792d121 to 3519686 Compare June 28, 2024 12:12
@PennyHow
Copy link
Member

Why is the test module outside of src/pypromice? I would have thought it would be better to be inside pypromice and distributed with the package so that users can also test their installations (and we can test installations on new instances).

@PennyHow
Copy link
Member

I've just opened a PR to this branch #'270, just to update the function naming conventions in e2e.

@ladsmund
Copy link
Contributor Author

Why is the test module outside of src/pypromice? I would have thought it would be better to be inside pypromice and distributed with the package so that users can also test their installations (and we can test installations on new instances).

The tests are located outside the package to maintain a clear separation of concerns. This way, the pypromice package is solely focused on functionalities intended for production and end-users. The tests, run during continuous integration (CI), ensure that the distributed package works as intended. This approach also reduces the package size by excluding test code and data. I understand your point about using tests to verify an installation. The CI script is designed to test scenarios where pypromice is installed in a new environment, addressing this concern.

I am open for discussion, but these are my current thoughts.

@PennyHow
Copy link
Member

PennyHow commented Jun 28, 2024

This approach also reduces the package size by excluding test code and data.

I thought the test datasets were pretty light-weight, so do not make the package particularly bulky.

I understand your point about using tests to verify an installation.

I think this will be useful (to us, and general users) especially now we have the bufr processing tests in here, as the eccodes bindings can sometimes not install correctly. Running the unit tests within the pypromice installation in say, a docker image, would be really useful.

Let's discuss more next time we talk

ladsmund and others added 3 commits July 3, 2024 13:47
- Moved test modules and data from the package directory to the root-level tests directory.
- Updated directory structure to ensure clear separation of source code and tests.
- Updated import statements in test modules to reflect new paths.
- Restructured the tests module:
  - Renamed original automatic tests to `e2e` as they primarily test the main CLI scripts.
  - Added `unit` directory for unit tests.
  - Created `data` directory for shared test data files.

This comprehensive refactoring improves project organization by clearly separating test code from application code. It facilitates easier test discovery and enhances maintainability by following common best practices.
@ladsmund ladsmund force-pushed the feature/restructure_tests branch from 8be1933 to 4a98e48 Compare July 3, 2024 11:48
Copy link
Member

@PennyHow PennyHow left a comment

Choose a reason for hiding this comment

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

Looks good @ladsmund!

@ladsmund ladsmund merged commit 44f0d3c into develop Jul 5, 2024
4 checks passed
@ladsmund ladsmund deleted the feature/restructure_tests branch July 5, 2024 09:47
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