Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spack ci: add support for running stand-alone tests #27877

Merged
merged 1 commit into from
Aug 23, 2022

Conversation

tldahlgren
Copy link
Contributor

@tldahlgren tldahlgren commented Dec 9, 2021

The goal of this work is to run stand-alone tests from spack ci when the --tests option is used. When the option is used, the 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, concise 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).

Update (2022 Mar 28): Handling of concretization failures that do not get reported to CDash is expected to be addressed in a subsequent issue/PR.

Update (2022 Apr 7): spack ci rebuild --tests should not be be trying to run tests for job spec dependencies, only the job spec. If the build jobs of dependency specs fail to upload to the build cache (e.g., configuration, permissions), then those jobs should be failing. (TBD: Should this PR ensure that check or is it better to have a separate PR?)

Tasks:

  • Include the equivalent of the architecture information, or at least the host target, in the CDash output
  • Upload stand-alone test results files as test artifacts
  • Confirm tests are run in GitLab
  • Ensure CDash results are uploaded as artifacts
  • Resolve issues with CDash build-and test results appearing on same row of the table
  • Add unit tests as needed
  • Investigate why some (dependency) packages don't have test results (e.g., related from other pipelines)
    - [ ] Possibly add full hash in build name -- Scott Wittenburg is working on a significant change in this area ATM
  • Ensure proper parsing and reporting of skipped tests (as not run) .. post- Testing: Optionally run tests on externally installed packages #28701 merge
    - [ ] Determine why concretization failure jobs and associated reports -- actually just Update.xml -- are not showing up in CDash
  • Restore the proper CDash URLand or mirror ONCE out-of-band testing completed

@spackbot-app spackbot-app bot added the commands label Dec 9, 2021
@tldahlgren tldahlgren force-pushed the spack-ci-stand-alone-testing branch 3 times, most recently from 52cd1d8 to dc273fb Compare December 15, 2021 03:36
@spackbot-app spackbot-app bot added the tests General test capability(ies) label Dec 15, 2021
@tldahlgren tldahlgren force-pushed the spack-ci-stand-alone-testing branch 2 times, most recently from 3e47927 to 9ef24b3 Compare January 6, 2022 02:46
@spackbot-app spackbot-app bot added the gitlab Issues related to gitlab integration label Jan 15, 2022
@tldahlgren
Copy link
Contributor Author

tldahlgren commented Jan 27, 2022

@zackgalbreath @tgamblin @becker33

(Update: Adding VendorString attribute to the Site element per an off-line discussion.)
(Update: Replaced generated output for the same package as of commit XYZ.)

Commit ec03ceb generated the output below from a run of spack test run --log-format cdash libxml2.

I would prefer to be able to output the architecture as well but I'm not sure how to best represent it given the XSD we've been using.

<?xml version="1.0" encoding="UTF-8"?>
<Site BuildName="libxml2-pr2t5oa33wfrxb3mwr5xcl2gz4cawn3q"
      BuildStamp="20220128-1706-Experimental"
      Name="ruby961"
      Generator="spack-0.17.1-1009-ec03cebdcd"
      Hostname="ruby961"
      OSName="Linux"
      OSRelease="3.10.0-1160.45.1.1chaos.ch6.x86_64"
      VendorString="cascadelake"
>
  <Testing>
    <StartTime>1643418415</StartTime>
    <Test Status="passed">
      <Name>test:_Performing_simple_import_test</Name>
      <FullCommand>unknown</FullCommand>
      <Results>
        <NamedMeasurement type="numeric/double" name="Execution Time">
          <Value>0.000228</Value>
        </NamedMeasurement>
        <NamedMeasurement type="text/string" name="Description">
          <Value>test: Performing simple import test</Value>
        </NamedMeasurement>
        <NamedMeasurement type="text/string" name="Completion Status">
          <Value>Completed</Value>
        </NamedMeasurement>
      </Results>
    </Test>
    <Test Status="passed">
      <Name>xml2-config_--version</Name>
      <FullCommand>'/usr/WS1/dahlgren/spack/opt/spack/linux-rhel7-cascadelake/intel-19.0.4.227/libxml2-2.9.12-pr2t5oa33wfrxb3mwr5xcl2gz4cawn3q/bin/xml2-config' '--version'</FullCommand>
      <Results>
        <NamedMeasurement type="numeric/double" name="Execution Time">
          <Value>0.00592</Value>
        </NamedMeasurement>
        <NamedMeasurement type="text/string" name="Description">
          <Value>test: xml2-config: expect command status in [0]</Value>
        </NamedMeasurement>
        <NamedMeasurement type="text/string" name="Completion Status">
          <Value>Completed</Value>
        </NamedMeasurement>
        <Measurement>
          <Value>2.9.12
PASSED</Value>
        </Measurement>
      </Results>
    </Test>
    <Test Status="passed">
      <Name>xmllint_--auto_-o_test.xml</Name>
      <FullCommand>'/usr/WS1/dahlgren/spack/opt/spack/linux-rhel7-cascadelake/intel-19.0.4.227/libxml2-2.9.12-pr2t5oa33wfrxb3mwr5xcl2gz4cawn3q/bin/xmllint' '--auto' '-o' 'test.xml'</FullCommand>
      <Results>
        <NamedMeasurement type="numeric/double" name="Execution Time">
          <Value>0.012523</Value>
        </NamedMeasurement>
        <NamedMeasurement type="text/string" name="Description">
          <Value>test: xmllint: expect command status in [0]</Value>
        </NamedMeasurement>
        <NamedMeasurement type="text/string" name="Completion Status">
          <Value>Completed</Value>
        </NamedMeasurement>
        <Measurement>
          <Value>PASSED</Value>
        </Measurement>
      </Results>
    </Test>
    <Test Status="passed">
      <Name>xmllint_--postvalid_test.xml</Name>
      <FullCommand>'/usr/WS1/dahlgren/spack/opt/spack/linux-rhel7-cascadelake/intel-19.0.4.227/libxml2-2.9.12-pr2t5oa33wfrxb3mwr5xcl2gz4cawn3q/bin/xmllint' '--postvalid' 'test.xml'</FullCommand>
      <Results>
        <NamedMeasurement type="numeric/double" name="Execution Time">
          <Value>0.010513</Value>
        </NamedMeasurement>
        <NamedMeasurement type="text/string" name="Description">
          <Value>test: xmllint: expect command status in [3]</Value>
        </NamedMeasurement>
        <NamedMeasurement type="text/string" name="Completion Status">
          <Value>Expected to fail</Value>
        </NamedMeasurement>
        <Measurement>
          <Value>&lt;?xml version="1.0"?&gt;
&lt;info&gt;abc&lt;/info&gt;
validity error : no DTD found!
Document test.xml does not validate
PASSED</Value>
        </Measurement>
      </Results>
    </Test>
    <Test Status="passed">
      <Name>xmllint_--dtdvalid_info.dtd_test.xml</Name>
      <FullCommand>'/usr/WS1/dahlgren/spack/opt/spack/linux-rhel7-cascadelake/intel-19.0.4.227/libxml2-2.9.12-pr2t5oa33wfrxb3mwr5xcl2gz4cawn3q/bin/xmllint' '--dtdvalid' '/g/g21/dahlgren/.spack/test/2wwlsgepwo4ygldrjc4doero3qzyuncu/libxml2-2.9.12-pr2t5oa/data/libxml2/info.dtd' 'test.xml'</FullCommand>
      <Results>
        <NamedMeasurement type="numeric/double" name="Execution Time">
          <Value>0.009787</Value>
        </NamedMeasurement>
        <NamedMeasurement type="text/string" name="Description">
          <Value>test: xmllint: expect command status in [3]</Value>
        </NamedMeasurement>
        <NamedMeasurement type="text/string" name="Completion Status">
          <Value>Expected to fail</Value>
        </NamedMeasurement>
        <Measurement>
          <Value>&lt;?xml version="1.0"?&gt;
&lt;info&gt;abc&lt;/info&gt;
test.xml:2: element info: validity error : Element info content does not follow the DTD, expecting (data), got (CDATA)
Document test.xml does not validate against /g/g21/dahlgren/.spack/test/2wwlsgepwo4ygldrjc4doero3qzyuncu/libxml2-2.9.12-pr2t5oa/data/libxml2/info.dtd
PASSED</Value>
        </Measurement>
      </Results>
    </Test>
    <Test Status="passed">
      <Name>xmllint_--dtdvalid_info.dtd_info.xml</Name>
      <FullCommand>'/usr/WS1/dahlgren/spack/opt/spack/linux-rhel7-cascadelake/intel-19.0.4.227/libxml2-2.9.12-pr2t5oa33wfrxb3mwr5xcl2gz4cawn3q/bin/xmllint' '--dtdvalid' '/g/g21/dahlgren/.spack/test/2wwlsgepwo4ygldrjc4doero3qzyuncu/libxml2-2.9.12-pr2t5oa/data/libxml2/info.dtd' '/g/g21/dahlgren/.spack/test/2wwlsgepwo4ygldrjc4doero3qzyuncu/libxml2-2.9.12-pr2t5oa/data/libxml2/info.xml'</FullCommand>
      <Results>
        <NamedMeasurement type="numeric/double" name="Execution Time">
          <Value>0.010327</Value>
        </NamedMeasurement>
        <NamedMeasurement type="text/string" name="Description">
          <Value>test: xmllint: expect command status in [0]</Value>
        </NamedMeasurement>
        <NamedMeasurement type="text/string" name="Completion Status">
          <Value>Completed</Value>
        </NamedMeasurement>
        <Measurement>
          <Value>&lt;?xml version="1.0"?&gt;
&lt;info&gt;
&lt;data&gt;abc&lt;/data&gt;
&lt;/info&gt;
PASSED</Value>
        </Measurement>
      </Results>
    </Test>
    <Test Status="passed">
      <Name>xmlcatalog_--create</Name>
      <FullCommand>'/usr/WS1/dahlgren/spack/opt/spack/linux-rhel7-cascadelake/intel-19.0.4.227/libxml2-2.9.12-pr2t5oa33wfrxb3mwr5xcl2gz4cawn3q/bin/xmlcatalog' '--create'</FullCommand>
      <Results>
        <NamedMeasurement type="numeric/double" name="Execution Time">
          <Value>0.0</Value>
        </NamedMeasurement>
        <NamedMeasurement type="text/string" name="Description">
          <Value>test: xmlcatalog: expect command status in [0]</Value>
        </NamedMeasurement>
        <NamedMeasurement type="text/string" name="Completion Status">
          <Value>Completed</Value>
        </NamedMeasurement>
        <Measurement>
          <Value>&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"&gt;
&lt;catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"/&gt;
PASSED</Value>
        </Measurement>
      </Results>
    </Test>
    <EndTestTime>1643418415</EndTestTime>
  </Testing>

This corresponds to the spack test run output text file:

==> Testing package libxml2-2.9.12-pr2t5oa
==> [2022-01-28-17:07:07.892801] test: Performing simple import test
==> [2022-01-28-17:07:07.894672] test: xml2-config: expect command status in [0]
==> [2022-01-28-17:07:07.894900] '/usr/WS1/dahlgren/spack/opt/spack/linux-rhel7-cascadelake/intel-19.0.4.227/libxml2-2.9.12-pr2t5oa33wfrxb3mwr5xcl2gz4cawn3q/bin/xml2-config' '--version'
2.9.12
PASSED
==> [2022-01-28-17:07:07.900820] test: xmllint: expect command status in [0]
==> [2022-01-28-17:07:07.901089] '/usr/WS1/dahlgren/spack/opt/spack/linux-rhel7-cascadelake/intel-19.0.4.227/libxml2-2.9.12-pr2t5oa33wfrxb3mwr5xcl2gz4cawn3q/bin/xmllint' '--auto' '-o' 'test.xml'
PASSED
==> [2022-01-28-17:07:07.913612] test: xmllint: expect command status in [3]
==> [2022-01-28-17:07:07.913883] '/usr/WS1/dahlgren/spack/opt/spack/linux-rhel7-cascadelake/intel-19.0.4.227/libxml2-2.9.12-pr2t5oa33wfrxb3mwr5xcl2gz4cawn3q/bin/xmllint' '--postvalid' 'test.xml'
<?xml version="1.0"?>
<info>abc</info>
validity error : no DTD found!
Document test.xml does not validate
PASSED
==> [2022-01-28-17:07:07.924396] test: xmllint: expect command status in [3]
==> [2022-01-28-17:07:07.924671] '/usr/WS1/dahlgren/spack/opt/spack/linux-rhel7-cascadelake/intel-19.0.4.227/libxml2-2.9.12-pr2t5oa33wfrxb3mwr5xcl2gz4cawn3q/bin/xmllint' '--dtdvalid' '/g/g21/dahlgren/.spack/test/2wwlsgepwo4ygldrjc4doero3qzyuncu/libxml2-2.9.12-pr2t5oa/data/libxml2/info.dtd' 'test.xml'
<?xml version="1.0"?>
<info>abc</info>
test.xml:2: element info: validity error : Element info content does not follow the DTD, expecting (data), got (CDATA)
Document test.xml does not validate against /g/g21/dahlgren/.spack/test/2wwlsgepwo4ygldrjc4doero3qzyuncu/libxml2-2.9.12-pr2t5oa/data/libxml2/info.dtd
PASSED
==> [2022-01-28-17:07:07.934458] test: xmllint: expect command status in [0]
==> [2022-01-28-17:07:07.934732] '/usr/WS1/dahlgren/spack/opt/spack/linux-rhel7-cascadelake/intel-19.0.4.227/libxml2-2.9.12-pr2t5oa33wfrxb3mwr5xcl2gz4cawn3q/bin/xmllint' '--dtdvalid' '/g/g21/dahlgren/.spack/test/2wwlsgepwo4ygldrjc4doero3qzyuncu/libxml2-2.9.12-pr2t5oa/data/libxml2/info.dtd' '/g/g21/dahlgren/.spack/test/2wwlsgepwo4ygldrjc4doero3qzyuncu/libxml2-2.9.12-pr2t5oa/data/libxml2/info.xml'
<?xml version="1.0"?>
<info>
<data>abc</data>
</info>
PASSED
==> [2022-01-28-17:07:07.945059] test: xmlcatalog: expect command status in [0]
==> [2022-01-28-17:07:07.945330] '/usr/WS1/dahlgren/spack/opt/spack/linux-rhel7-cascadelake/intel-19.0.4.227/libxml2-2.9.12-pr2t5oa33wfrxb3mwr5xcl2gz4cawn3q/bin/xmlcatalog' '--create'
<?xml version="1.0"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"/>
PASSED

@tldahlgren
Copy link
Contributor Author

tldahlgren commented Jan 29, 2022

Since we want to know if a package does not have tests to run, I created a dummy test part so we can flag/track such packages (starting with commit 2c1ac7c). What do others think of reporting packages in this manner?

An example output from running at the command line for the blt package is given below.

<?xml version="1.0" encoding="UTF-8"?>
<Site BuildName="blt-m6hnxcd346nyhmzwagcmyfzv35piomjy"
      BuildStamp="20220128-1706-Experimental"
      Name="ruby961"
      Generator="spack-0.17.1-1009-ec03cebdcd"
      Hostname="ruby961"
      OSName="Linux"
      OSRelease="3.10.0-1160.45.1.1chaos.ch6.x86_64"
      VendorString="cascadelake"
>
  <Testing>
    <StartTime>1643418411</StartTime>
    <Test Status="notrun">
      <Name>blt</Name>
      <FullCommand>Not Applicable</FullCommand>
      <Results>
        <NamedMeasurement type="numeric/double" name="Execution Time">
          <Value>0.0</Value>
        </NamedMeasurement>
        <NamedMeasurement type="text/string" name="Completion Status">
          <Value>No tests to run</Value>
        </NamedMeasurement>
      </Results>
    </Test>
    <EndTestTime>1643418411</EndTestTime>
  </Testing>

Is there anything missing or you would want changed?

@tldahlgren tldahlgren force-pushed the spack-ci-stand-alone-testing branch 2 times, most recently from 7012ba2 to eb0310e Compare February 3, 2022 19:16
@tldahlgren tldahlgren force-pushed the spack-ci-stand-alone-testing branch 7 times, most recently from 7dda56f to de1fd1d Compare February 16, 2022 18:40
@tldahlgren tldahlgren force-pushed the spack-ci-stand-alone-testing branch 3 times, most recently from 9c2454e to ebb1e82 Compare February 17, 2022 02:10
@tldahlgren
Copy link
Contributor Author

tldahlgren commented Feb 17, 2022

Interesting test failures in what appear to be a section untouched by this PR (Updated example below):

_______________________________ test_config_edit _______________________________
[2540](https://github.com/spack/spack/runs/5236546178?check_suite_focus=true#step:6:2540)

[2541](https://github.com/spack/spack/runs/5236546178?check_suite_focus=true#step:6:2541)
    def test_config_edit():
[2542](https://github.com/spack/spack/runs/5236546178?check_suite_focus=true#step:6:2542)
        """Ensure `spack config edit` edits the right paths."""
[2543](https://github.com/spack/spack/runs/5236546178?check_suite_focus=true#step:6:2543)
    
[2544](https://github.com/spack/spack/runs/5236546178?check_suite_focus=true#step:6:2544)
        dms = spack.config.default_modify_scope('compilers')
[2545](https://github.com/spack/spack/runs/5236546178?check_suite_focus=true#step:6:2545)
        dms_path = spack.config.config.scopes[dms].path
[2546](https://github.com/spack/spack/runs/5236546178?check_suite_focus=true#step:6:2546)
        user_path = spack.config.config.scopes['user'].path
[2547](https://github.com/spack/spack/runs/5236546178?check_suite_focus=true#step:6:2547)
    
[2548](https://github.com/spack/spack/runs/5236546178?check_suite_focus=true#step:6:2548)
        comp_path = os.path.join(dms_path, 'compilers.yaml')
[2549](https://github.com/spack/spack/runs/5236546178?check_suite_focus=true#step:6:2549)
        repos_path = os.path.join(user_path, 'repos.yaml')
[2550](https://github.com/spack/spack/runs/5236546178?check_suite_focus=true#step:6:2550)
    
[2551](https://github.com/spack/spack/runs/5236546178?check_suite_focus=true#step:6:2551)
>       assert config('edit', '--print-file', 'compilers').strip() == comp_path
[2552](https://github.com/spack/spack/runs/5236546178?check_suite_focus=true#step:6:2552)
E       AssertionError: assert '/tmp/pytest-...st/spack.yaml' == '/tmp/pytest-o...ompilers.yaml'
[2553](https://github.com/spack/spack/runs/5236546178?check_suite_focus=true#step:6:2553)
E         - /tmp/pytest-of-spack-test/pytest-0/mock-env-path87/test/spack.yaml
[2554](https://github.com/spack/spack/runs/5236546178?check_suite_focus=true#step:6:2554)
E         + /tmp/pytest-of-spack-test/pytest-0/mock-env-path87/test/spack.yaml/compilers.yaml
[2555](https://github.com/spack/spack/runs/5236546178?check_suite_focus=true#step:6:2555)
E         ?                                                                   +++++++++++++++
[2556](https://github.com/spack/spack/runs/5236546178?check_suite_focus=true#step:6:2556)

[2557](https://github.com/spack/spack/runs/5236546178?check_suite_focus=true#step:6:2557)
lib/spack/spack/test/cmd/config.py:100: AssertionError
FAILED lib/spack/spack/test/cmd/config.py::test_config_edit - AssertionError:...

Note the error seems to be related to a file path being treated as a directory:

>       assert config('edit', '--print-file', 'compilers').strip() == comp_path
E       AssertionError: assert '/tmp/pytest-...st/spack.yaml' == '/tmp/pytest-o...ompilers.yaml')
E         - /tmp/pytest-of-spack-test/pytest-0/mock-env-path87/test/spack.yaml
E         + /tmp/pytest-of-spack-test/pytest-0/mock-env-path87/test/spack.yaml/compilers.yaml
E         ?                                                                   +++++++++++++++

@spackbot-app
Copy link

spackbot-app bot commented Aug 9, 2022

Let me see if I can fix that for you!

@spackbot-app
Copy link

spackbot-app bot commented Aug 9, 2022

I was able to run spack style --fix for you!

spack style --fix
==> Running style checks on spack
  selected: isort, mypy, black, flake8
==> Modified files
  lib/spack/spack/binary_distribution.py
  lib/spack/spack/build_environment.py
  lib/spack/spack/ci.py
  lib/spack/spack/cmd/__init__.py
  lib/spack/spack/cmd/ci.py
  lib/spack/spack/cmd/install.py
  lib/spack/spack/cmd/test.py
  lib/spack/spack/environment/environment.py
  lib/spack/spack/install_test.py
  lib/spack/spack/installer.py
  lib/spack/spack/package_base.py
  lib/spack/spack/relocate.py
  lib/spack/spack/report.py
  lib/spack/spack/reporters/cdash.py
  lib/spack/spack/reporters/extract.py
  lib/spack/spack/reporters/junit.py
  lib/spack/spack/schema/gitlab_ci.py
  lib/spack/spack/test/ci.py
  lib/spack/spack/test/cmd/ci.py
  lib/spack/spack/test/cmd/config.py
  lib/spack/spack/test/cmd/install.py
  lib/spack/spack/test/cmd/test.py
  lib/spack/spack/test/reporters.py
  lib/spack/spack/test/test_suite.py
  lib/spack/spack/test/util/path.py
  lib/spack/spack/util/path.py
==> Running isort checks
  isort checks were clean
==> Running mypy checks
Success: no issues found in 557 source files
  mypy checks were clean
==> Running black checks
reformatted lib/spack/spack/cmd/ci.py
reformatted lib/spack/spack/cmd/install.py
reformatted lib/spack/spack/ci.py
reformatted lib/spack/spack/install_test.py
reformatted lib/spack/spack/installer.py
reformatted lib/spack/spack/package_base.py
reformatted lib/spack/spack/report.py
reformatted lib/spack/spack/reporters/extract.py
reformatted lib/spack/spack/reporters/junit.py
reformatted lib/spack/spack/schema/gitlab_ci.py
reformatted lib/spack/spack/reporters/cdash.py
reformatted lib/spack/spack/test/ci.py
reformatted lib/spack/spack/test/cmd/ci.py
reformatted lib/spack/spack/test/cmd/install.py
reformatted lib/spack/spack/test/reporters.py
reformatted lib/spack/spack/test/util/path.py
reformatted lib/spack/spack/test/test_suite.py
All done! ✨ 🍰 ✨
17 files reformatted, 9 files left unchanged.
  black checks were clean
==> Running flake8 checks
  flake8 checks were clean
==> spack style checks were clean
Keep in mind that I cannot fix your flake8 or mypy errors, so if you have any you'll need to fix them and update the pull request. If I was able to push to your branch, if you make further changes you will need to pull from your updated branch before pushing again.

I've updated the branch with isort fixes.

@tldahlgren
Copy link
Contributor Author

@spackbot fix style

@spackbot-app
Copy link

spackbot-app bot commented Aug 9, 2022

Let me see if I can fix that for you!

@tldahlgren
Copy link
Contributor Author

@spackbot fix style

@spackbot-app
Copy link

spackbot-app bot commented Aug 9, 2022

Let me see if I can fix that for you!

@spackbot-app
Copy link

spackbot-app bot commented Aug 9, 2022

I was able to run spack style --fix for you!

spack style --fix
==> Running style checks on spack
  selected: isort, mypy, black, flake8
==> Modified files
  lib/spack/spack/build_environment.py
  lib/spack/spack/ci.py
  lib/spack/spack/cmd/__init__.py
  lib/spack/spack/cmd/ci.py
  lib/spack/spack/cmd/install.py
  lib/spack/spack/cmd/test.py
  lib/spack/spack/environment/environment.py
  lib/spack/spack/install_test.py
  lib/spack/spack/installer.py
  lib/spack/spack/main.py
  lib/spack/spack/package_base.py
  lib/spack/spack/report.py
  lib/spack/spack/reporters/cdash.py
  lib/spack/spack/reporters/extract.py
  lib/spack/spack/reporters/junit.py
  lib/spack/spack/schema/gitlab_ci.py
  lib/spack/spack/test/ci.py
  lib/spack/spack/test/cmd/ci.py
  lib/spack/spack/test/cmd/config.py
  lib/spack/spack/test/cmd/install.py
  lib/spack/spack/test/cmd/test.py
  lib/spack/spack/test/reporters.py
  lib/spack/spack/test/test_suite.py
==> Running isort checks
  isort checks were clean
==> Running mypy checks
Success: no issues found in 557 source files
  mypy checks were clean
==> Running black checks
reformatted lib/spack/spack/cmd/ci.py
reformatted lib/spack/spack/cmd/install.py
reformatted lib/spack/spack/ci.py
reformatted lib/spack/spack/install_test.py
reformatted lib/spack/spack/installer.py
reformatted lib/spack/spack/report.py
reformatted lib/spack/spack/reporters/cdash.py
reformatted lib/spack/spack/reporters/extract.py
reformatted lib/spack/spack/reporters/junit.py
reformatted lib/spack/spack/schema/gitlab_ci.py
reformatted lib/spack/spack/package_base.py
reformatted lib/spack/spack/test/ci.py
reformatted lib/spack/spack/test/cmd/ci.py
reformatted lib/spack/spack/test/cmd/install.py
reformatted lib/spack/spack/test/reporters.py
reformatted lib/spack/spack/test/test_suite.py
All done! ✨ 🍰 ✨
16 files reformatted, 7 files left unchanged.
  black checks were clean
==> Running flake8 checks
  flake8 checks were clean
==> spack style checks were clean
Keep in mind that I cannot fix your flake8 or mypy errors, so if you have any you'll need to fix them and update the pull request. If I was able to push to your branch, if you make further changes you will need to pull from your updated branch before pushing again.

I've updated the branch with isort fixes.

@tldahlgren
Copy link
Contributor Author

The 2.7, clingo unit tests check failed while installing system packages with:

E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/main/c/cmake/cmake-data_3.16.3-1ubuntu1_all.deb  Connection failed [IP: 52.154.174.208 80]
[79](https://github.com/spack/spack/runs/7753927130?check_suite_focus=true#step:4:80)
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
[80](https://github.com/spack/spack/runs/7753927130?check_suite_focus=true#step:4:81)
Error: Process completed with exit code 100.

@tldahlgren
Copy link
Contributor Author

Rebased to develop in the hopes that that odd 2.7 clingo check will not encounter system package installation issues this time.

@tldahlgren
Copy link
Contributor Author

Everything is currently passing so I am going to drop the temporary mirror, etc.

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.
@tldahlgren
Copy link
Contributor Author

@tgamblin Looks like all checks have passed and this PR is RFR.

@tldahlgren
Copy link
Contributor Author

ping @tgamblin

@tldahlgren tldahlgren added this to In progress in Spack v0.19.0 release via automation Aug 19, 2022
@tldahlgren tldahlgren moved this from In progress to Review in progress in Spack v0.19.0 release Aug 19, 2022
@tldahlgren
Copy link
Contributor Author

@tgamblin There are a number of new CI-related PRs that, if merged before this one, may result in yet another round of rebasing and fixes for this PR (e.g., #32187, #32290, #32300). Should I split this PR to make it easier to review since it has at least a few sets of changes?

Copy link
Member

@tgamblin tgamblin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me @tldahlgren! Thanks for all the work debugging pipelines to get this running properly.

Spack v0.19.0 release automation moved this from Review in progress to Reviewer approved Aug 23, 2022
@tgamblin tgamblin merged commit 3c3b18d into spack:develop Aug 23, 2022
Spack v0.19.0 release automation moved this from Reviewer approved to Done Aug 23, 2022
ma595 pushed a commit to ma595/spack that referenced this pull request Sep 13, 2022
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- spack#28701 merge
- [x] Restore the proper CDash URLand or mirror ONCE out-of-band testing completed
@@ -245,6 +245,7 @@ def __init__(self, cls, function, format_name, args):
self.cls = cls
self.function = function
self.filename = None
self.ctest_parsing = getattr(args, "ctest_parsing", False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zackgalbreath @tldahlgren Where is args.ctest_parsing defined? I'm currently trying to refactor these classes to make them independent of argparse namespaces and for some reason I can't find references to this argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binary-packages build-environment commands core PR affects Spack core functionality ecp environments gitlab Issues related to gitlab integration tests General test capability(ies) utilities
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants