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

Testing framework #160

Merged
merged 15 commits into from
Feb 10, 2025
Merged

Testing framework #160

merged 15 commits into from
Feb 10, 2025

Conversation

mohitulm
Copy link
Contributor

Testing framework based on pytest that would run on GitHub Actions

Description

The PR includes

  •  Tests written with pytest
    
  •  A GitHub workflow that runs these tests upon a push/ PR to the main branch
    
  •  pyproject.toml that has test dependencies
    

This pyproject.toml is based on @Neverhorst 's PR in qudi-core
Some tests which fail have been commented out and opened as issues.

Motivation and Context

The testing framework would assist in identifying whether any new changes break the current functionality.
So far, the tests written cover loading of all modules, resetting status variables, modifying status variables, and unit testing for the Odmr Logic module.

How Has This Been Tested?

The framework has been tested on a fork repository using the same test workflow

Types of changes

The PR only changes the pyproject.toml and setup.py files
The rest of the newly added files are part of testing and do not modify any existing code

  • Bug fix
  • New feature
  • Breaking change (Causes existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • I have documented my changes in /docs/changelog.md.
  • My change requires additional/updated documentation.
  • I have updated the documentation accordingly.
  • I have added/updated the config example for any module docstrings as necessary.
  • I have checked that the change does not contain obvious errors
    (syntax, indentation, mutable default values, etc.).
  • I have tested my changes using 'Load all modules' on the default dummy configuration.
  • All changed Jupyter notebooks have been stripped of their output cells.

@prithviulm
Copy link
Contributor

This is looking really good! Thanks for your efforts. As a broader point (you don't have to address this right now), I think we need to decide whether the status vars using randomisation should dump their randomly generated values somewhere as artifacts to make it easier to debug if something goes wrong. Alternatively, it could be easier to randomly generate seeds and store the seeds as artifacts.

@mohitulm
Copy link
Contributor Author

This is looking really good! Thanks for your efforts. As a broader point (you don't have to address this right now), I think we need to decide whether the status vars using randomisation should dump their randomly generated values somewhere as artifacts to make it easier to debug if something goes wrong. Alternatively, it could be easier to randomly generate seeds and store the seeds as artifacts.

Thanks! Yes, dumping status variables would be good. However, I have commented out the tests that randomize the status variables because they break some modules.

@prithviulm
Copy link
Contributor

@astropiuu can you check why the tests are failing?

@prithviulm
Copy link
Contributor

Looks good as an initial framework. Just need to use qudi-core from ulm-iqo rather than my fork. Also need a pyproject.toml to be added to qudi-iqo-modules.

@prithviulm prithviulm marked this pull request as ready for review February 10, 2025 10:54
prithviulm
prithviulm previously approved these changes Feb 10, 2025
Copy link
Contributor

@prithviulm prithviulm left a comment

Choose a reason for hiding this comment

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

Great work! This can be merged.

Copy link
Contributor

@prithviulm prithviulm left a comment

Choose a reason for hiding this comment

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

Tests pass with the pyproject.toml merged from PR #185 so we should be good to go. Can be merged!

@prithviulm prithviulm merged commit 6ed6184 into Ulm-IQO:main Feb 10, 2025
3 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.

2 participants