spack/share/spack
Tamara Dahlgren 3c3b18d858
spack ci: add support for running stand-alone tests (#27877)
This support requires adding the '--tests' option to 'spack ci rebuild'.
Packages whose stand-alone tests are broken (in the CI environment) can
be configured in gitlab-ci to be skipped by adding them to
broken-tests-packages.

Highlights include:
- Restructured 'spack ci' help to provide better subcommand summaries;
- Ensured only one InstallError (i.e., installer's) rather than allowing
  build_environment to have its own; and
- Refactored CI and CDash reporting to keep CDash-related properties and
  behavior in a separate class.

This allows stand-alone tests from `spack ci` to run when the `--tests`
option is used.  With `--tests`, stand-alone tests are run **after** a
**successful** (re)build of the package.  Test results are collected
and report(able) using CDash.

This PR adds the following features:
- Adds `-t` and `--tests` to `spack ci rebuild` to run stand-alone tests;
- Adds `--fail-fast` to stop stand-alone tests after the first failure;
- Ensures a *single* `InstallError` across packages
    (i.e., removes second class from build environment);
- Captures skipping tests for externals and uninstalled packages
    (for CDash reporting);
- Copies test logs and outputs to the CI artifacts directory to facilitate
    debugging;
- Parses stand-alone test results to report outputs from each `run_test` as
    separate test parts (CDash reporting);
- Logs a test completion message to allow capture of timing of the last
    `run_test` part;
- Adds the runner description to the CDash site to better distinguish entries
    in CDash tables;
- Adds `gitlab-ci` `broken-tests-packages` to CI configuration to skip
    stand-alone testing for packages with known issues;
- Changes `spack ci --help` so description of each subcommand is a single line;
- Changes `spack ci <subcommand> --help` to provide the full description of
    each command (versus no description); and
- Ensures `junit` test log file ends in an `.xml` extension (versus default where
    it does not).

Tasks:

- [x] Include the equivalent of the architecture information, or at least the host target, in the CDash output
- [x] Upload stand-alone test results files as  `test` artifacts
- [x] Confirm tests are run in GitLab
- [x] Ensure CDash results are uploaded as artifacts
- [x] Resolve issues with CDash build-and test results appearing on same row of the table 
- [x] Add unit tests  as needed
- [x] Investigate why some (dependency) packages don't have test results (e.g., related from other pipelines)
- [x] Ensure proper parsing and reporting of skipped tests (as `not run`) .. post- #28701 merge
- [x] Restore the proper CDash URLand or mirror ONCE out-of-band testing completed
2022-08-23 00:52:48 -07:00
..
bash Delocalize type output for bash completion (#30360) 2022-04-28 23:24:10 +00:00
bootstrap Add a command to generate a local mirror for bootstrapping (#28556) 2022-05-24 21:33:52 +00:00
csh Update copyright year to 2022 2022-01-14 22:50:21 -08:00
docker Update Dockerfiles and images for Spack v0.18.0 (#30216) 2022-04-22 08:51:26 +02:00
docs/docker/module-file-tutorial Update copyright year to 2022 2022-01-14 22:50:21 -08:00
gitlab spack ci: add support for running stand-alone tests (#27877) 2022-08-23 00:52:48 -07:00
keys update tutorial command for v0.18.0 and new gpg key (#30904) 2022-05-28 02:36:20 +00:00
logo add artisanal handcrafted SVG Spack logo. (#6165) 2017-11-06 22:42:16 -08:00
qa CI: reduce the amount of tests run in the original concretizer (#32179) 2022-08-17 09:16:19 +02:00
templates spack ci: add support for running stand-alone tests (#27877) 2022-08-23 00:52:48 -07:00
setup-env.csh Update copyright year to 2022 2022-01-14 22:50:21 -08:00
setup-env.fish Update copyright year to 2022 2022-01-14 22:50:21 -08:00
setup-env.ps1 refactor powershell setup to make it sourceable (#29987) 2022-04-20 17:11:44 -07:00
setup-env.sh Update copyright year to 2022 2022-01-14 22:50:21 -08:00
setup-tutorial-env.sh Update copyright year to 2022 2022-01-14 22:50:21 -08:00
spack-completion.bash spack ci: add support for running stand-alone tests (#27877) 2022-08-23 00:52:48 -07:00