Add comprehensive test suite#21
Merged
Merged
Conversation
- Implement integration tests for CMORiser workflows, including full workflow, memory efficiency, and multiple variable handling. - Create mock datasets for testing atmospheric and oceanic data. - Introduce a mock file system to simulate file operations during tests. - Develop a mock PBS manager to simulate job submission and tracking. - Add performance tests to evaluate memory usage and chunking strategies. - Generate test data scripts for creating mock NetCDF files. - Establish unit tests for BaseCMORiser, batch processing functions, Jinja2 template rendering, and task tracking. - Include pytest configuration for test discovery and management.
… and update tests for default parent info usage
…nd update related methods; add pytest.ini for test configuration
…ges and missing parent_info
…ts to use subtests for variable validation
… for integration, end-to-end, and performance tests; update README to reflect new testing strategy and workflow files.
… end-to-end and integration tests
… and integration tests; improve error handling in unit tests for ACCESS_ESM_CMORiser
…ch_cmoriser, cmor_dashboard, and test files to validate paths in the test environment
… directories in tests; prevent shell injection in subprocess calls
… and output file paths; improve subprocess command construction to prevent shell injection
…e files to prevent shell injection vulnerabilities
… prevent shell injection in subprocess calls
…periment_id in ACCESS_ESM_CMORiser initialization
… for subprocess calls; improve validation and escaping of script paths
…ion for subprocess calls; improve validation and escaping of job IDs
…uction; improve validation and escaping of arguments in start_dashboard, test_end_to_end, and test_full_cmorisation functions
…_end_to_end for enhanced security; use explicit lists to prevent injection vulnerabilities
…ore specific warnings
…cess call checks are enforced
… by removing unnecessary nosec comments
… by using explicit argument assignment and removing unnecessary nosec comments
…ocess call checks
…ify subprocess usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several updates across workflows, configuration files, notebooks, and source code to enhance CI/CD processes, testing capabilities, and code quality. The changes include improvements to GitHub Actions workflows, updates to pre-commit hooks, enhancements to test configuration, and minor notebook adjustments for consistency and readability.
Workflow Improvements:
.github/workflows/cd.yml: Updated the Conda deployment job to include matrix debugging information and a PyPI propagation wait step to ensure package availability before proceeding. Addedfail-fast: falseto the matrix strategy..github/workflows/ci.yml: Added workflow dispatch inputs for selecting test suites and split test execution into separate steps for unit, integration, and all tests, with conditional logic based on the trigger type. [1] [2].github/workflows/full-tests.yml: Introduced a new workflow for running a comprehensive test suite, including integration, end-to-end, and performance tests, with options to generate and upload coverage reports.Testing Enhancements:
pytest.ini: Configured pytest with custom markers (e.g.,slow,integration,performance), test discovery patterns, and warning filters to streamline test execution and improve maintainability.pyproject.toml: Addedpytest-subteststo the test dependencies for better subtest handling.Pre-commit and Code Quality Updates:
.pre-commit-config.yaml: Upgraded theruffpre-commit hook to versionv0.8.4and added arguments for auto-fixing issues. Simplified the exclusion patterns.Notebook Adjustments:
notebooks/Getting_started.ipynbandnotebooks/Tutorial1_CMORisation_ENSO_Recipes.ipynb: Made minor formatting changes for improved readability, such as consistent use of trailing commas and multi-line string formatting. [1] [2]Source Code Updates:
src/access_mopper/driver.py: Added new attributes (experiment_id,source_id,variant_label,grid_label,activity_id) to theDriverclass to support additional metadata handling.