Commit ddebbf3
authored
Add comprehensive test suite (#21)
* Add comprehensive tests for ACCESS-MOPPeR functionality
- 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.
* Add comprehensive test suite and restructure tests for ACCESS-MOPPeR
* Add unit tests for ACCESS_ESM_CMORiser driver class
* Add unit tests for various components and ensure proper test marking
* Enhance ACCESS_ESM_CMORiser initialization with additional parameters and update tests for default parent info usage
* Refactor TaskTracker to use 'experiment_id' instead of 'experiment' and update related methods; add pytest.ini for test configuration
* Update pytest.ini to ignore additional warnings for ndarray size changes and missing parent_info
* Add pytest-subtests to test dependencies and refactor integration tests to use subtests for variable validation
* Enhance CI workflows by adding a full test suite with manual triggers for integration, end-to-end, and performance tests; update README to reflect new testing strategy and workflow files.
* Enhance conda deployment workflow with matrix support and add PyPI availability check
* Add jinja2 to project dependencies in pyproject.toml
* Enhance security by validating input paths before subprocess calls in end-to-end and integration tests
* Enhance subprocess call safety by validating file paths in end-to-end and integration tests; improve error handling in unit tests for ACCESS_ESM_CMORiser
* Enhance security by adding nosec comments for subprocess calls in batch_cmoriser, cmor_dashboard, and test files to validate paths in the test environment
* Enhance security by adding path validation and using secure temporary directories in tests; prevent shell injection in subprocess calls
* Update action versions in full-tests.yml for improved stability and performance
* Enhance security by adding validation for allowed characters in table and output file paths; improve subprocess command construction to prevent shell injection
* Enhance security by escaping paths in subprocess calls across multiple files to prevent shell injection vulnerabilities
* Enhance security by adding validation for dashboard and script paths; prevent shell injection in subprocess calls
* Enhance error handling in tests by asserting TypeError for missing experiment_id in ACCESS_ESM_CMORiser initialization
* Enhance security in submit_job by using explicit command construction for subprocess calls; improve validation and escaping of script paths
* Enhance security in wait_for_jobs by using explicit command construction for subprocess calls; improve validation and escaping of job IDs
* Enhance security in subprocess calls by using explicit command construction; improve validation and escaping of arguments in start_dashboard, test_end_to_end, and test_full_cmorisation functions
* Refactor subprocess argument construction in start_dashboard and test_end_to_end for enhanced security; use explicit lists to prevent injection vulnerabilities
* Add Codacy configuration for Bandit to enable security checks and ignore specific warnings
* Add duplicate entry for B602 in Codacy configuration to ensure subprocess call checks are enforced
* Test
* Refactor subprocess call in test_full_cmorisation to enhance security by removing unnecessary nosec comments
* Refactor code structure for improved readability and maintainability
* Refactor subprocess call in test_full_cmorisation to enhance security by using explicit argument assignment and removing unnecessary nosec comments
* Add duplicate entry for B601 in Codacy configuration to enforce subprocess call checks
* Refactor test_batch_cmoriser.py to improve security comments and clarify subprocess usage1 parent 885e6b9 commit ddebbf3
38 files changed
Lines changed: 2963 additions & 279 deletions
File tree
- .github/workflows
- notebooks
- src/access_mopper
- dashboard
- executors
- tests
- e2e
- integration
- mocks
- performance
- scripts
- unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
48 | 77 | | |
49 | 78 | | |
50 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
9 | 19 | | |
10 | 20 | | |
11 | 21 | | |
| |||
44 | 54 | | |
45 | 55 | | |
46 | 56 | | |
47 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
48 | 71 | | |
49 | 72 | | |
50 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
765 | 765 | | |
766 | 766 | | |
767 | 767 | | |
768 | | - | |
| 768 | + | |
769 | 769 | | |
770 | 770 | | |
771 | 771 | | |
| |||
790 | 790 | | |
791 | 791 | | |
792 | 792 | | |
| 793 | + | |
793 | 794 | | |
794 | 795 | | |
795 | 796 | | |
| |||
815 | 816 | | |
816 | 817 | | |
817 | 818 | | |
818 | | - | |
819 | | - | |
820 | | - | |
821 | | - | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
826 | | - | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
827 | 828 | | |
828 | 829 | | |
829 | 830 | | |
| |||
860 | 861 | | |
861 | 862 | | |
862 | 863 | | |
863 | | - | |
864 | | - | |
| 864 | + | |
| 865 | + | |
865 | 866 | | |
866 | 867 | | |
867 | 868 | | |
| |||
0 commit comments