|
| 1 | +Test Suite Infrastructure |
| 2 | +========================= |
| 3 | + |
| 4 | +The `suite` directory provides a comprehensive infrastructure for testing |
| 5 | +MPAS-Analysis on supported machines (Anvil, Chrysalis, Perlmutter-CPU, and |
| 6 | +Compy). The suite is designed to ensure code changes do not introduce |
| 7 | +unexpected results and to validate MPAS-Analysis in various environments. |
| 8 | + |
| 9 | +Overview of Test Scripts |
| 10 | +------------------------ |
| 11 | + |
| 12 | +There are three main scripts for running the test suite: |
| 13 | + |
| 14 | +1. **run_dev_suite.bash** (Developer Testing) |
| 15 | + - Use this script after activating your development environment |
| 16 | + (must be named `mpas_analysis_dev`). |
| 17 | + - It builds the documentation and runs a series of analysis tasks on output |
| 18 | + from a low-resolution (QUwLI240) simulation. |
| 19 | + - Each task produces a web page with results, accessible via the web portal. |
| 20 | + - Example usage: |
| 21 | + |
| 22 | + .. code-block:: bash |
| 23 | +
|
| 24 | + $ source ~/miniforge3/etc/profile.d/conda.sh |
| 25 | + $ conda activate mpas_analysis_dev |
| 26 | + $ ./suite/run_dev_suite.bash |
| 27 | +
|
| 28 | + - After completion, check for successful web page generation, e.g.: |
| 29 | + |
| 30 | + .. code-block:: bash |
| 31 | +
|
| 32 | + $ tail -n 3 chrysalis_test_suite/main_py3.11/mpas_analysis.o793058 |
| 33 | +
|
| 34 | + The last lines should include: |
| 35 | + |
| 36 | + .. code-block:: none |
| 37 | +
|
| 38 | + Generating webpage for viewing results... |
| 39 | + Web page: https://web.lcrc.anl.gov/public/e3sm/diagnostic_output/<username>/analysis_testing/chrysalis/<branch>/main_py3.11/ |
| 40 | +
|
| 41 | + - To quickly identify unfinished or failed tasks: |
| 42 | + |
| 43 | + .. code-block:: bash |
| 44 | +
|
| 45 | + $ grep -L "Web page:" chrysalis_test_suite/*/mpas_analysis.o* |
| 46 | +
|
| 47 | + - Developers should run this suite manually on each pull request before |
| 48 | + merging and link the results in the PR. |
| 49 | + |
| 50 | +2. **run_suite.bash** (Package Build & Test) |
| 51 | + - Use this script to build the MPAS-Analysis conda package and test it in |
| 52 | + fresh environments. |
| 53 | + - It creates conda environments for multiple Python versions, runs tests, |
| 54 | + builds documentation, and executes the analysis suite. |
| 55 | + - Recommended for more thorough validation, especially before releases. |
| 56 | + - Example usage: |
| 57 | + |
| 58 | + .. code-block:: bash |
| 59 | +
|
| 60 | + $ ./suite/run_suite.bash |
| 61 | +
|
| 62 | +3. **run_e3sm_unified_suite.bash** (E3SM-Unified Deployment Testing) |
| 63 | + - Used during test deployments of E3SM-Unified to verify MPAS-Analysis |
| 64 | + works as expected within the deployment. |
| 65 | + - Typically run by E3SM-Unified maintainers during deployment testing. |
| 66 | + - Example usage: |
| 67 | + |
| 68 | + .. code-block:: bash |
| 69 | +
|
| 70 | + $ ./suite/run_e3sm_unified_suite.bash |
| 71 | +
|
| 72 | +Supported Machines |
| 73 | +------------------ |
| 74 | + |
| 75 | +The suite is designed to run only on supported machines: |
| 76 | +- Anvil |
| 77 | +- Chrysalis |
| 78 | +- Perlmutter-CPU (`pm-cpu`) |
| 79 | +- Compy |
| 80 | + |
| 81 | +If you attempt to run the suite on an unsupported machine, you will receive an |
| 82 | +error. |
| 83 | + |
| 84 | +Modifying the Test Suite |
| 85 | +------------------------ |
| 86 | + |
| 87 | +Developers may need to update the suite for new requirements: |
| 88 | + |
| 89 | +- **Python Versions**: |
| 90 | + - The Python versions tested are defined in the scripts (e.g., |
| 91 | + `main_py=3.11`, `alt_py=3.10`). |
| 92 | + - To test additional versions, add them to the relevant script variables and |
| 93 | + loops. |
| 94 | + |
| 95 | +- **Adding New Machines**: |
| 96 | + - Update the machine detection logic in `suite/setup.py` and add appropriate |
| 97 | + input/output paths for the new machine. |
| 98 | + - Ensure the new machine is supported in the scripts and the web portal |
| 99 | + configuration. |
| 100 | + |
| 101 | +- **Adding/Modifying Tests**: |
| 102 | + - To add new tests, update the list of runs in the scripts and |
| 103 | + provide corresponding config files in the `suite` directory. |
| 104 | + - New tests could change which analysis tasks are run, the configuration for |
| 105 | + running tasks overall (e.g. how climatologies are computed), or how |
| 106 | + individual tasks are configured (e.g. focused on polar regions vs. global) |
| 107 | + |
| 108 | +- **Changing Simulation Data**: |
| 109 | + - Update the simulation name and mesh in `suite/setup.py` if you wish to |
| 110 | + test on different output. |
| 111 | + |
| 112 | +Best Practices |
| 113 | +-------------- |
| 114 | + |
| 115 | +- Always run the test suite before merging a pull request. |
| 116 | +- Link the results web page in your PR for reviewers. |
| 117 | +- Use the quick check (`grep -L "Web page:" ...`) to ensure all tasks |
| 118 | + completed successfully. |
| 119 | +- Update the suite scripts and configs as needed to keep pace with |
| 120 | + MPAS-Analysis development. |
| 121 | + |
| 122 | +For more details, see the comments and documentation within each script and |
| 123 | +config file in the `suite` directory. |
0 commit comments