Commit graph

94 commits

Author SHA1 Message Date
Patrick Gartung
8c41173678
Buildcache: bindist test without invoking spack compiler wrappers. (#15687)
* Buildcache:
   * Try mocking an install of quux, corge and garply using prebuilt binaries
   * Put patchelf install after ccache restore
   * Add script to install patchelf from source so it can be used on Ubuntu:Trusty which does not have a patchelf pat package. The script will skip building on macOS
   * Remove mirror at end of bindist test
   * Add patchelf to Ubuntu build env
   * Revert mock patchelf package to allow other tests to run.
   * Remove depends_on('patchelf', type='build') relying instead on
   * Test fixture to ensure patchelf is available.

* Call g++ command to build libraries directly during test build

* Flake8

* Install patchelf in before_install stage using apt unless on Trusty where a build is done.

* Add some symbolic links between packages

* Flake8

* Flake8:

* Update mock packages to write their own source files

* Create the stage because spec search does not create it any longer

* updates after change of list command arguments

* cleanup after merge

* flake8
2020-07-08 15:05:58 -05:00
Todd Gamblin
11088df402 Remove references to master from CI
- [x] remove master from github actions
- [x] remove master from .travis.yml
- [x] make `develop` the default branch for `spack ci`
2020-07-06 11:39:19 -07:00
Massimiliano Culpo
a5eabfad91
Moved flake8, shell and documentation tests to Github Action (#17328)
* 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.
2020-07-01 11:58:53 -05:00
Johannes Blaschke
1d55adfd2b
Add fish shell support (#9279)
* share/spack/setup-env.fish file to setup environment in fish shell

* setup-env.fish testing script

* Update share/spack/setup-env.fish

Co-Authored-By: Elsa Gonsiorowski, PhD <gonsie@me.com>

* Update share/spack/qa/setup-env-test.fish

Co-Authored-By: Adam J. Stewart <ajstewart426@gmail.com>

* updates completions using `spack commands --update-completion`

* added stderr-nocaret warning

* added fish shell tests to CI system


Co-authored-by: becker33 <becker33@llnl.gov>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Co-authored-by: Elsa Gonsiorowski, PhD <gonsie@me.com>
2020-06-30 14:26:27 -05:00
Massimiliano Culpo
239b709f97
Added unit tests to Github Actions (#16610)
* Added unit tests to Github Actions

* Set user e-mail and name for git tests to succeed

* Simplify setup.sh logic

* Replicate Travis script on Github Actions

* Update flags since '.' is not allowed

* Added badge, simplified workflow

* Remove pinning of coverage

* Remove unit tests run on Github Actions from Travis
2020-06-23 08:24:02 -05:00
Massimiliano Culpo
11fa61665f
travis: use bionic as default for Linux (#16521)
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.
2020-05-12 13:56:01 -07:00
Massimiliano Culpo
43c9ad3421
Remove 'spack bootstrap' and associated docs (#15179)
fixes #15145

This commit removes the outdated `spack bootstrap`
command and any reference to it in the documentation
and unit tests.
2020-05-11 10:55:18 -07:00
Massimiliano Culpo
05203ec3fb
Add unit test on MacOS using Github Actions (#14220)
- Remove macos tests from travis
- Add macos tests in github actions.
2020-05-09 13:35:14 -07:00
Massimiliano Culpo
b06bc31029
Increase coverage of spack.relocate (#16475)
- add docstrings and make parameter names consistent in `relocate.py`
- Make `replace_prefix_*` and other functions private (as they are implementation details)
- remove unused function _replace_prefix_nullterm()

- Add unit tests for `relocate.py` functions
  - add patchelf to Travis and use it during tests
  - add hello_world fixture with a compiled binary, so we can test relocation
2020-05-09 10:41:50 -07:00
Massimiliano Culpo
50318e4ee3
travis: extend the list of e-mails being notified of failures (#16352) 2020-04-28 14:55:44 +02:00
Massimiliano Culpo
2aa8132afd Migrate build tests from Travis to Github Actions (#13967)
This PR moves build smoke tests from TravisCI and migrates them to Github Actions. The result is that build tests are performed in parallel with unit tests and they don't hog additional resources on Travis. The workflow will not run if a PR only changes packages in the built-in repository, but will always run on pushes to develop or master.

* Removed build tests from Travis and passed them to Github Actions
* Store ~/.ccache in Github Actions cache
* Add filters on paths and make sure this workflow don't run
* Use paths-ignore and exclude only files in the built-in repo
* Added a badge to README.md
2019-12-25 00:06:48 -08:00
Massimiliano Culpo
f80491826b
Travis exits at the first failing test, pin codecov at v4.5.4 (#14179)
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)
2019-12-16 10:56:54 +01:00
Axel Huebl
7a81c37bde
Package Index: Build in Dockerhub (#13810)
* Package Index: Build in Dockerhub

Prepare to build the package index service, packages.spack.io,
on Dockerhub.

Local build (in spack root dir):
```
docker build -t spack/packages.spack.io:latest -f share/spack/docker/package-index/Dockerfile .
```

Local test:
```
docker run -p 8080:80 spack/packages.spack.io:latest
```

* Travis-CI: Remove Docker

Remove leftover docker stages from Travis-CI.

* Simplify Split Call
2019-11-26 10:11:29 -07:00
Massimiliano Culpo
f53abbecd3
Remove mirrors from Travis cache (#13841) 2019-11-22 19:00:00 +01:00
Adam J. Stewart
536486f0e5
Travis CI: Test Python 3.8 (#13347)
* Travis CI: Test Python 3.8

* Fix use of deprecated cgi.escape method

* Fix version comparison

* Fix flake8 F811 change in Python 3.8

* Make flake8 happy

* Use Python 3.8 for all test categories
2019-10-31 14:20:46 -05:00
Todd Gamblin
a942d2dd3d
Disable macOS builds on PRs while we wait for Travis to catch up. (#13389)
Travis macOS builds are taking too long to run, so we'll only run them on
`develop` until they get faster.
2019-10-22 20:40:47 -07:00
Massimiliano Culpo
3d77ecd92e Bootstrap environment modules optimizing for generic architectures (#13105)
fixes #13073

Since #3206 was merged bootstrapping environment-modules was using the architecture of the current host or the best match supported by the default compiler. The former case is an issue since shell integration was looking for a spec targeted at the host microarchitecture.

1. Bootstrap an env modules targeted at generic architectures
2. Look for generic targets in shell integration scripts
3. Add a new entry in Travis to test shell integration
2019-10-21 11:20:05 -07:00
Massimiliano Culpo
1213aec7ed travis: bump python version for flake8 and build tests 2019-10-08 16:06:32 -07:00
Massimiliano Culpo
ae975c48ac Avoid sending empty reports to codecov (#12293)
Before this commit we were sending reports also for unit tests that
were not collecting coverage data.
2019-08-06 10:35:23 -07:00
cclauss
e8506994b1 travis: the sudo tag is now deprecated (#11933)
* Travis CI: The sudo tag is now deprecated in Travis

__sudo: required__ no longer is.

* Remove obsolete comment

__travis_wait__ can help with long-running processes.
* https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received
2019-07-05 22:25:25 -07:00
Todd Gamblin
47e9f7aac9 tests: add tests for setup-env.sh
- 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
2019-07-05 12:54:17 -07:00
Greg Becker
1ea3d29110 Ensure brew update is run before using brew in test environment (#11784)
All macos tests are failing because brew cannot install ccache
without updating brew. This ensures that brew update is run
before using brew in test environment.
2019-06-18 17:50:45 -07:00
Todd Gamblin
3c2e4b9558 tests: stop testing Python 3.4 2019-05-11 16:39:53 -07:00
Todd Gamblin
963eb98979 tests: require Python 2.6 tests to pass 2019-05-11 16:20:36 -07:00
Todd Gamblin
54920d100a enable coverage for python 2.6 unit tests 2019-05-10 13:13:44 -07:00
Todd Gamblin
3903658bfc coverage: only run coverage for subset of unit tests
- Codecov cannot handle as many coverage reports as we are generating

- as a result, our PR coverage pages have been broken for a while, and
  it's hard to tell people where to enhance their testing in PR reviews.

- Scale back to only running coverage for 3.7 and 2.7 unit tests

- This is *probably* better.  We run the build tests for good measure,
  but we do not need to evaluate them for coverage.  The coverage reports
  are about unit tests.
2019-05-11 02:23:22 +09:00
Todd Gamblin
8e5e36dc0b Fix spack flake8 to use Travis's target as base when needed 2019-05-01 04:44:02 +09:00
Massimiliano Culpo
263d8a818a Updated Sphinx configuration (#11165) 2019-04-11 14:38:52 -07:00
Massimiliano Culpo
e3af8ed454 Added a sub-command to show if packages are relocatable (#9199)
* Added the `spack buildcache preview` sub-command

This is similar to `spack spec -I` but highlights which nodes in a DAG
are relocatable and which are not.

spec.tree has been generalized a little to accept a status function,
instead of always showing the install status

The current implementation works only for ELF, and needs to be
generalized to other platforms.

* Added a test to check if an executable is relocatable or not

This test requires a few commands to be present in the environment.
Currently it will run only under python 3.7 (which uses Xenial instead
of Trusty).

* Added tests for the 'buildcache preview' command.

* Fixed codebase after rebase

* Fixed the list of apt addons for Python 3.7 in travis.yaml

* Only check ELF executables and shared libraries. Skip checking virtual or external packages. (#229)

* Fixed flake8 issues

* Add handling for macOS mach binaries (#231)
2019-02-28 15:36:47 -06:00
Todd Gamblin
365387e929 stopgap: allow travis to fail for Python 2.6 again
- Travis still fails on `spack spec` in Python 2.6.
- Allow the failure until we get to the bottom of it.
2018-12-30 00:19:08 -08:00
Todd Gamblin
19b7b15929 coverage: use kcov to get coverage for our cc script 2018-12-29 23:47:29 -08:00
Todd Gamblin
c92ac70c72
bugfix: add codecov upload back to travis.yml (#10220)
Codecov upload was accidentally removed in #9805
2018-12-29 12:09:42 -08:00
Todd Gamblin
d65c6ba9b2 Use homebrew addon instead of manually invoking brew (#10213) 2018-12-29 06:12:02 +01:00
Omar Padron
fcce8b8dc2 travis: fix pip install for docker stage (#10177) 2018-12-23 17:42:09 -08:00
Omar Padron
60298787e4 Fix docker builds (#9805)
* move docker test logic to share/spack/qa
* update Dockerfile for archlinux
2018-12-20 11:17:46 -08:00
Massimiliano Culpo
61239257f9
Store ccache directory explicitly in Travis. (#10119)
* Store ccache directory explicitly in Travis.

Despite we started using ccache on `develop`, it seems the cache itself
is not stored from one CI build to the next. This might be du to the
fact that our language on Travis is Python and not C nor C++.

Hence here we store the ccache directory explicitly.
2018-12-15 17:53:51 +01:00
Christoph Junghans
71a86bb840 .travis.yml: enable ccache (#6370) 2018-12-15 10:52:31 +01:00
Massimiliano Culpo
020a01b18f Updated the Travis environment to xenial (#10090)
* Updated the Travis environment to xenial.
* Python 2.6 needs to remain on Trusty (can't be installed from Xenial)
2018-12-14 08:43:58 -08:00
Todd Gamblin
88a3393462
travis: allow Python 2.6 to fail until we figure out why Travis hangs (#9776) 2018-11-09 09:29:13 -08:00
Todd Gamblin
daab8d9109
docker: allow docker build to fail until it's fixed (#9658) 2018-10-26 21:50:28 -07:00
Omar Padron
aa1c814c75 docker: unite Dockerfiles; auto-deploy images to DockerHub (#9329)
* Unite Dockerfiles - add build/run/push scripts
* update docker documentation
* update .travis.yml
* switch to using a preprocessor on Dockerfiles
* skip building docker images on pull requests
* update files with copyright info
* tweak when travis builds for docker files are done
2018-10-26 10:15:05 -07:00
Todd Gamblin
5aa05b8ef4
travis: require sudo in an attempt to avoid build timeouts (#9327)
- Many container builds are timing out frequently during Spack tests in
  Travis CI.

- Travis recommends to try `sudo: required` to see whether this is an
  infrastructure issue or something else.

- added `sudo: required` to all Linux builds.

- added --verbose to `spack test` invocation so that we can see more
  easily what tests it's timing out on.

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2018-09-24 14:55:36 -07:00
Todd Gamblin
940e35059e travis: bring back macOS test in unit test stage 2018-09-03 07:27:21 -07:00
Todd Gamblin
03542f2a07 travis: clean up .travis-ci.yml wrapping and indentation
- fix line wrapping in travis.yml to make parts more legible
- Travis can handle multi-line if statements if you use semicolos.
2018-09-03 07:27:21 -07:00
Todd Gamblin
e58c6e1b73 travis: fix macOS builds, avoid brew autoupdate 2018-09-03 07:27:21 -07:00
Todd Gamblin
82820efe37 Remove Python 3.3 from testing.
- Support for Python 3.3 isn't really needed, as nothing uses it as the
  default system Python, and nearly everyone will have a newer Python 3
  version installed.
2018-08-24 16:22:37 -07:00
Adam J. Stewart
2e8a820afd Even better Makefile target parsing (#8819)
#8223 replaced regex-based makefile target parsing with an invocation of
"make -q". #8818 discovered that "make -q" can result in an error for some
packages.

Also, the "make -q" strategy relied on interpreting the error code, which only
worked for GNU Make and not BSD Make (which was deemed acceptable at
the time). As an added bonus, this implementation ignores the exit code and
instead parses STDERR for any indications that the target does not exist; this
works for both GNU Make and BSD Make.

#8223 also updated ninja target detection to use "ninja -t targets". This does
not change that behavior but makes it more-explicit with "ninja -t targets all"

This also adds tests for detection of "make" and "ninja" targets.
2018-08-20 17:42:28 -04:00
Adam J. Stewart
7e0bd152b7 Generate coverage reports for all unit and build tests 2018-08-04 21:18:49 -07:00
Massimiliano Culpo
6ba1c82858 tests: Add python 3.7 to Travis CI (#8778)
* Test Spack on Python 3.7 as part of Travis CI
* Currently using xenial to pull-in python 3.7
    * As xenial is not officially supported yet, Travis tolerates failures on it.
2018-07-23 23:07:36 -07:00
Todd Gamblin
305c95b69f tests: move doc tests to the unit test stage
- Frequently, the documentation build will fail mysteriously in some
  spack command.

- The cause is some new bug introduced by the PR, but this is not
  apparent because the unit tests haven't run and the doc tests aren't
  targeted at code bugs.

- Users end up puzzled by doc failures when they're really code failures.

- Move the doc tests parallel with the code tests, so that we can more
  easily see bugs like this.
2018-07-23 07:27:48 -07:00