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

Improve unit testing #99

Merged
merged 6 commits into from
Jul 14, 2023
Merged

Improve unit testing #99

merged 6 commits into from
Jul 14, 2023

Commits on Jun 27, 2023

  1. Improve unit testing

    Currently, benchcab does not have extensive coverage in its unit tests.
    Parts of the code that have poor test coverage are dependent on system
    interaction (e.g. environment modules, running subprocess commands (SVN,
    build scripts, executables, PBS).
    
    This change refactors and adds unit testing for these parts of the code
    base.
    
    Move the code from the benchcab.run_cable_site module to the
    benchcab.task module. This is done so that we reduce coupling between
    modules that use fluxnet tasks. This also has the benefit that we can
    test the two modules easily by sharing the same test setup functions. We
    move the code from the benchcab.run_comparison module to
    benchcab.task module for the same reasons.
    
    Unit tests now check exception messages and standard output produced by
    benchcab for both non-verbose and verbose modes. **Beware:** standard
    output messages have been updated in some areas. These changes will need
    to be updated in the documentation.
    
    Refactor the default build so that environment modules are loaded via
    python instead of writing module load statements into the temporary
    build script. This is done to reduce the complexity of the unit tests.
    
    The stderr output from subprocess commands are now redirected to stdout
    so that stderr is suppressed in non-verbose mode.
    
    Fixes #58 #22 #86
    SeanBryan51 committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    e2813ac View commit details
    Browse the repository at this point in the history

Commits on Jul 4, 2023

  1. Configuration menu
    Copy the full SHA
    865da7a View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2023

  1. Refactor code and unit tests

    This change refactors the code to be more object oriented so that we can
    better support mocking via dependency injection rather than resorting to
    the `unittest.mock.patch` function. This allows us to write unit tests
    that are simpler and that preserve the API layer (as opposed to using
    `unittest.mock.patch` which breaks the API layer).
    
    Fixes #102
    SeanBryan51 committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    ecc7940 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2023

  1. Configuration menu
    Copy the full SHA
    06c2c61 View commit details
    Browse the repository at this point in the history

Commits on Jul 14, 2023

  1. Add requested changes from code review

    Co-authored-by: Claire Carouge <[email protected]>
    SeanBryan51 and ccarouge committed Jul 14, 2023
    Configuration menu
    Copy the full SHA
    95f1871 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8acd685 View commit details
    Browse the repository at this point in the history