Skip to content

Add comprehensive test suite#21

Merged
rbeucher merged 32 commits into
v2from
test_suite
Aug 4, 2025
Merged

Add comprehensive test suite#21
rbeucher merged 32 commits into
v2from
test_suite

Conversation

@rbeucher

@rbeucher rbeucher commented Aug 4, 2025

Copy link
Copy Markdown
Member

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. Added fail-fast: false to 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: Added pytest-subtests to the test dependencies for better subtest handling.

Pre-commit and Code Quality Updates:

  • .pre-commit-config.yaml: Upgraded the ruff pre-commit hook to version v0.8.4 and added arguments for auto-fixing issues. Simplified the exclusion patterns.

Notebook Adjustments:

  • notebooks/Getting_started.ipynb and notebooks/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 the Driver class to support additional metadata handling.

rbeucher added 19 commits August 4, 2025 11:20
- 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
… for integration, end-to-end, and performance tests; update README to reflect new testing strategy and workflow files.
… 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
rbeucher added 10 commits August 4, 2025 16:59
…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
@rbeucher rbeucher merged commit ddebbf3 into v2 Aug 4, 2025
7 checks passed
@rbeucher rbeucher deleted the test_suite branch June 23, 2026 03:14
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.

1 participant