1. 17 Mar, 2021 1 commit
    • Massimiliano Culpo's avatar
      Speed-up CI by reorganizing tests (#22247) · b304b4bd
      Massimiliano Culpo authored
      * unit tests: mark slow tests as "maybeslow"
      
      This commit also removes the "network" marker and
      marks every "network" test as "maybeslow". Tests
      marked as db are maintained, but they're not slow
      anymore.
      
      * GA: require style tests to pass before running unit-tests
      
      * GA: make MacOS unit tests fail fast
      
      * GA: move all unit tests into the same workflow, run style tests as a prerequisite
      
      All the unit tests have been moved into the same workflow so that a single
      run of the dorny/paths-filter action can be used to ask for coverage based
      on the files that have been changed in a PR. The basic idea is that for PRs
      that introduce only changes to packages coverage is not necessary, this
      resulting in a faster execution of the tests.
      
      Also, for package only PRs slow unit tests are skipped.
      
      Finally, MacOS and linux unit tests are now conditional on style tests passing
      meaning that e.g. we won't waste a MacOS worker if we know that the PR has
      flake8 issues.
      
      * Addressed review comments
      
      * Skipping slow tests on MacOS for package only recipes
      
      * QA: make tests on changes correct before merging
      b304b4bd
  2. 03 Jan, 2021 1 commit
    • Todd Gamblin's avatar
      copyrights: update all files with license headers for 2021 · a8ccb8e1
      Todd Gamblin authored
      - [x] add `concretize.lp`, `spack.yaml`, etc. to licensed files
      - [x] update all licensed files to say 2013-2021 using
            `spack license update-copyright-year`
      - [x] appease mypy with some additions to package.py that needed
            for oneapi.py
      a8ccb8e1
  3. 18 Nov, 2020 1 commit
    • Greg Becker's avatar
      spack test (#15702) · 77b2e578
      Greg Becker authored
      
      
      Users can add test() methods to their packages to run smoke tests on
      installations with the new `spack test` command (the old `spack test` is
      now `spack unit-test`). spack test is environment-aware, so you can
      `spack install` an environment and then run `spack test run` to run smoke
      tests on all of its packages. Historical test logs can be perused with
      `spack test results`. Generic smoke tests for MPI implementations, C,
      C++, and Fortran compilers as well as specific smoke tests for 18
      packages.
      
      Inside the test method, individual tests can be run separately (and
      continue to run best-effort after a test failure) using the `run_test`
      method. The `run_test` method encapsulates finding test executables,
      running and checking return codes, checking output, and error handling.
      
      This handles the following trickier aspects of testing with direct
      support in Spack's package API:
      
      - [x] Caching source or intermediate build files at build time for
            use at test time.
      - [x] Test dependencies,
      - [x] packages that require a compiler for testing (such as library only
            packages).
      
      See the packaging guide for more details on using Spack testing support.
      Included is support for package.py files for virtual packages. This does
      not change the Spack interface, but is a major change in internals.
      Co-authored-by: default avatarTamara Dahlgren <dahlgren1@llnl.gov>
      Co-authored-by: default avatarwspear <wjspear@gmail.com>
      Co-authored-by: default avatarAdam J. Stewart <ajstewart426@gmail.com>
      77b2e578
  4. 13 Aug, 2020 1 commit
    • Massimiliano Culpo's avatar
      Moved flake8, shell and documentation tests to Github Action (#17328) · fc94dde3
      Massimiliano Culpo authored
      * Move flake8 tests on Github Actions
      
      * Move shell test to Github Actions
      
      * Moved documentation build to Github Action
      
      * Don't run coverage on Python 2.6
      
      Since we get connection errors consistently on Travis
      when trying to upload coverage results for Python 2.6,
      avoid computing coverage entirely to speed-up tests.
      fc94dde3
  5. 02 Jul, 2020 1 commit
    • Massimiliano Culpo's avatar
      Moved flake8, shell and documentation tests to Github Action (#17328) · a5eabfad
      Massimiliano Culpo authored
      * Move flake8 tests on Github Actions
      
      * Move shell test to Github Actions
      
      * Moved documentation build to Github Action
      
      * Don't run coverage on Python 2.6
      
      Since we get connection errors consistently on Travis
      when trying to upload coverage results for Python 2.6,
      avoid computing coverage entirely to speed-up tests.
      a5eabfad
  6. 13 May, 2020 1 commit
    • Massimiliano Culpo's avatar
      travis: use bionic as default for Linux (#16521) · 11fa6166
      Massimiliano Culpo authored
      Modifications:
      
      - [x] Travis now uses `bionic` as a default (`xenial` used for Python 3.5, `trusty` for Python 2.6)
      - [x] Shell unit tests have been factored into their own run
      - [x] `kcov` is built only for tests that upload coverage results
      
      Overall with this we shave 3-4 mins. on each run and add an additional run of about 3 min. For some reason `kcov` 38 fails forwarding output when used with Python unit tests, so I used v34 for that and v38 (latest) for shell testing. Previously we were using v25.
      11fa6166
  7. 23 Apr, 2020 1 commit
  8. 21 Mar, 2020 1 commit
  9. 06 Mar, 2020 1 commit
  10. 23 Jan, 2020 1 commit
    • Adam J. Stewart's avatar
      Use `spack commands --format=bash` to generate shell completion (#14393) · 11f2b612
      Adam J. Stewart authored
      
      
      This PR adds a `--format=bash` option to `spack commands` to
      auto-generate the Bash programmable tab completion script. It can be
      extended to work for other shells.
      
      Progress:
      
      - [x] Fix bug in superclass initialization in `ArgparseWriter`
      - [x] Refactor `ArgparseWriter` (see below)
      - [x] Ensure that output of old `--format` options remains the same
      - [x] Add `ArgparseCompletionWriter` and `BashCompletionWriter`
      - [x] Add `--aliases` option to add command aliases
      - [x] Standardize positional argument names
      - [x] Tests for `spack commands --format=bash` coverage
      - [x] Tests to make sure `spack-completion.bash` stays up-to-date
      - [x] Tests for `spack-completion.bash` coverage
      - [x] Speed up `spack-completion.bash` by caching subroutine calls
      
      This PR also necessitates a significant refactoring of
      `ArgparseWriter`. Previously, `ArgparseWriter` was mostly a single
      `_write` method which handled everything from extracting the information
      we care about from the parser to formatting the output. Now, `_write`
      only handles recursion, while the information extraction is split into a
      separate `parse` method, and the formatting is handled by `format`. This
      allows subclasses to completely redefine how the format will appear
      without overriding all of `_write`.
      Co-Authored-by: default avatarTodd Gamblin <tgamblin@llnl.gov>
      11f2b612
  11. 31 Dec, 2019 1 commit
  12. 24 Dec, 2019 1 commit
    • Massimiliano Culpo's avatar
      Travis exits at the first failing test, pin codecov at v4.5.4 (#14179) · 8616a264
      Massimiliano Culpo authored
      Before this commit we used to run the entire unit test suite
      in the presence of a failure. Since we currently rely a lot
      on the state of the filesystem etc. the end report was most
      of the time showing spurious failures that were a consequence
      of the first failing test.
      
      This PR makes unit tests exit at the first failing test
      
      Also, pin codecov at v4.5.4 (last one supporting Python 2.6)
      8616a264
  13. 16 Dec, 2019 1 commit
    • Massimiliano Culpo's avatar
      Travis exits at the first failing test, pin codecov at v4.5.4 (#14179) · f8049182
      Massimiliano Culpo authored
      Before this commit we used to run the entire unit test suite
      in the presence of a failure. Since we currently rely a lot
      on the state of the filesystem etc. the end report was most
      of the time showing spurious failures that were a consequence
      of the first failing test.
      
      This PR makes unit tests exit at the first failing test
      
      Also, pin codecov at v4.5.4 (last one supporting Python 2.6)
      f8049182
  14. 06 Jul, 2019 1 commit
    • Todd Gamblin's avatar
      tests: add tests for setup-env.sh · 47e9f7aa
      Todd Gamblin authored
      - tests use a shell-script harness and test all Spack commands that
        require special shell support.
      
      - tests work in bash, zsh, and dash
      
      - run setup-env.sh tests on macos and linux builds.
        - we run them on macos and linux
      47e9f7aa
  15. 09 Jun, 2019 1 commit
  16. 06 Jun, 2019 1 commit
  17. 11 May, 2019 1 commit
  18. 01 Jan, 2019 1 commit
  19. 18 Oct, 2018 1 commit
  20. 25 Sep, 2018 1 commit
  21. 12 Apr, 2018 1 commit
    • Massimiliano Culpo's avatar
      Fixes conflicts in OSX nightly tests (#7732) · fa07f95a
      Massimiliano Culpo authored
      fixes #7593
      
      Unit tests on OSX are trying to concretize mpileaks, and they fail due
      to a conflict in the package:
      
      "%gcc@7.2.0:" conflicts with "elfutils@0.163"
      
      This solves the issue asking explicitly to concretize against
      elfutils@1.170
      fa07f95a
  22. 30 Mar, 2018 1 commit
    • scheibelp's avatar
      update tests: concretize mpileaks with gcc (#7635) · 5e758b97
      scheibelp authored
      Fixes #7593
      
      By default MacOS concretizes using the clang compiler. The unit tests
      include a call to "spack spec mpileaks", which has elfutils as a
      dependency; #7096 added a conflict in elfutils to avoid building
      with clang, which lead to the MacOS unit tests to start failing.
      This updates the concretization to force using gcc when concretizing
      mpileaks.
      5e758b97
  23. 21 Jan, 2018 1 commit
    • Massimiliano Culpo's avatar
      Restore multiprocessing in unit tests (#6949) · 621388e5
      Massimiliano Culpo authored
      * Revert "Travis: use --concurrency=multiprocessing only on build tests (#6872)"
      
      This reverts commit 596d4637.
      
      * Removing 'coverage combine' in test script
      
      According to what was discovered in #6887, one of the problems is
      calling 'coverage combine' twice without the '-a' flag. This removes
      the first call within our test scripts.
      621388e5
  24. 09 May, 2017 1 commit
    • Todd Gamblin's avatar
      rework spack help (#3033) · ff3b5d88
      Todd Gamblin authored
      - Full help is now only generated lazily, when needed.
        - Executing specific commands doesn't require loading all of them.
        - All commands are only loaded if we need them for help.
      
      - There is now short and long help:
        - short help (spack help) shows only basic spack options
        - long help (spack help -a) shows all spack options
        - Both divide help on commands into high-level sections
      
      - Commands now specify attributes from which help is auto-generated:
        - description: used in help to describe the command.
        - section: help section
        - level: short or long
      
      - Clean up command descriptions
      
      - Add a `spack docs` command to open full documentation
        in the browser.
      
      - move `spack doc` command to `spack pydoc` for clarity
      
      - Add a `spack --spec` command to show documentation on 
        the spec syntax.
      ff3b5d88
  25. 02 May, 2017 1 commit
    • Todd Gamblin's avatar
      Allow user to specify profile sort column on the command line. (#4056) · 094d47bf
      Todd Gamblin authored
      - Add -P <STAT> argument so that caller can specify a sort column for
        cProfile. Can specify multiple columns with commas. e.g.:
            spack -P cumtime,module
      
      - Add --lines option to Spack spec to control number of profile lines
        displayed
      
      - Sort by time by default (because it works in all Python versions)
      
      - Show sort column options in command help.
      
      - Do a short profile run in the unit tests.
      094d47bf
  26. 28 Apr, 2017 1 commit
    • Todd Gamblin's avatar
      Separate integration tests; simplify test scripts (#4006) · bb5a433a
      Todd Gamblin authored
      * Separate build integration tests; simplify test scripts
      
      - Move build tests out of the regular Travis unit tests, add more smoke
        test packages to build.
      
      - Run all test scripts with bash -e, which fails on error.
      
      - Factor coverage out into a Travis environment variable, so it's more
        obvious from .travis.yml which tests contribute to coverage and which
        don't.
      
      - Factor dependency checking and much of the front-matter in tests
        scripts into a setup.sh script, which is sourced by all the test
        scripts.  Extra cruft in each tests script now reduced to 2 lines at
        the beginning.
      bb5a433a
  27. 22 Apr, 2017 1 commit
  28. 02 Jan, 2017 1 commit
  29. 31 Dec, 2016 1 commit
  30. 30 Dec, 2016 1 commit
    • Massimiliano Culpo's avatar
      unit tests: replace nose with pytest (#2502) · 7ea10e76
      Massimiliano Culpo authored
      * Porting: substitute nose with ytest
      
      This huge commit substitutes nose with pytest as a testing system. Things done here:
      
      * deleted external/nose as it is no longer used
      * moved mock resources in their own directory 'test/mock/'
      * ported two tests (cmd/find, build_system) to pytest native syntax as an example
      * build_environment, log: used monkeypatch instead of try/catch
      * moved global mocking of fetch_cache to an auto-used fixture
      * moved global mocking from test/__init__.py to conftest.py
      * made `spack test` a wrapper around pytest
      * run-unit-tests: avoid running python 2.6 tests under coverage to speed them up
      * use `pytest --cov` instead of coverage run to cut down testing time
      
      * mock/packages_test: moved mock yaml configuration to files instead of leaving it in the code as string literals
      
      * concretize.py: ported tests to native pytest, reverted multiprocessing in pytest.ini as it was creating the wrong report for coveralls
      
      * conftest.py, fixtures: added docstrings
      
      * concretize_preferences.py: uses fixtures instead of subclassing MockPackagesTest
      
      * directory_layout.py: uses fixtures instead of subclassing MockPackagesTest
      
      * install.py: uses fixtures instead of subclassing MockPackagesTest
      
      * optional_deps.py: uses fixtures instead of subclassing MockPackagesTest
      
      optional_deps.py: uses fixtures instead of subclassing MockPackagesTest
      
      * packages.py: uses fixtures instead of subclassing MockPackagesTest
      
      * provider_index.py: uses fixtures instead of subclassing MockPackagesTest
      
      * spec_yaml.py: uses fixtures instead of subclassing MockPackagesTest
      
      * multimethod.py: uses fixtures instead of subclassing MockPackagesTest
      
      * install.py: now uses mock_archive_url
      
      * git_fetch.py: uses fixtures instead of subclassing MockPackagesTest
      
      * hg_fetch.py: uses fixtures instead of subclassing MockPackagesTest
      
      * svn_fetch.py, mirror.py: uses fixtures instead of subclassing MockPackagesTest
      repo.py: deleted
      
      * test_compiler_cmd.py: uses fixtures instead of subclassing MockPackagesTest
      
      * cmd/module.py, cmd/uninstall.py: uses fixtures instead of subclassing MockDatabase
      
      * database.py: uses fixtures instead of subclassing MockDatabase, removed mock/database
      
      * pytest: uncluttering fixture implementations
      
      * database: changing the scope to 'module'
      
      * config.py: uses fixtures instead of subclassing MockPackagesTest
      
      * spec_dag.py, spec_semantics.py: uses fixtures instead of subclassing MockPackagesTest
      
      * stage.py: uses fixtures instead of subclassing MockPackagesTest. Removed mock directory
      
      * pytest: added docstrings to all the fixtures
      
      * pytest: final cleanup
      
      * build_system_guess.py: fixed naming and docstrings as suggested by @scheibelp
      
      * spec_syntax.py: added expected failure on parsing multiple specs closes #1976
      
      * Add pytest and pytest-cov to Spack externals.
      
      * Make `spack flake8` ignore externals.
      
      * run-unit-tests runs spack test and not pytest.
      
      * Remove all the special stuff for `spack test`
      
      - Remove `conftest.py` magic and all the special case stuff in `bin/spack`
      
      - Spack commands can optionally take unknown arguments, if they want to
        handle them.
      
      - `spack test` is now a command like the others.
      
      - `spack test` now just delegates its arguments to `pytest`, but it does
        it by receiving unknown arguments and NOT taking an explicit
        help argument.
      
      * Fix error in fixtures.
      
      * Improve `spack test` command a bit.
      
      - Now supports an approximation of the old simple interface
      - Also supports full pytest options if you want them.
      
      * Use external coverage instead of pytest-cov
      
      * Make coverage use parallel-mode.
      
      * change __init__.py docs to include pytest
      7ea10e76
  31. 31 Aug, 2016 4 commits
  32. 31 Jul, 2016 1 commit