summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2020-10-23 22:17:02 +0200
committerTodd Gamblin <tgamblin@llnl.gov>2020-11-17 10:04:13 -0800
commit0a56b7cfd66e3d2604fb9fb0eaf1fd521604b0d4 (patch)
tree1474291d8021370d6f99471dcc52200dc315ab0d
parent7753d58e7e6ebb8dea08a5bb2c1618fd8c8036b1 (diff)
downloadspack-0a56b7cfd66e3d2604fb9fb0eaf1fd521604b0d4.tar.gz
spack-0a56b7cfd66e3d2604fb9fb0eaf1fd521604b0d4.tar.bz2
spack-0a56b7cfd66e3d2604fb9fb0eaf1fd521604b0d4.tar.xz
spack-0a56b7cfd66e3d2604fb9fb0eaf1fd521604b0d4.zip
Github actions: add CI for ASP based solver
-rw-r--r--.github/workflows/linux_unit_tests.yaml21
-rw-r--r--lib/spack/spack/test/cmd/buildcache.py4
-rw-r--r--lib/spack/spack/test/database.py8
-rw-r--r--lib/spack/spack/test/llnl/util/lock.py4
4 files changed, 37 insertions, 0 deletions
diff --git a/.github/workflows/linux_unit_tests.yaml b/.github/workflows/linux_unit_tests.yaml
index 5bd13c3390..c66d58c284 100644
--- a/.github/workflows/linux_unit_tests.yaml
+++ b/.github/workflows/linux_unit_tests.yaml
@@ -117,3 +117,24 @@ jobs:
git fetch origin ${{ github.ref }}:test-branch
git checkout test-branch
share/spack/qa/run-unit-tests
+ clingo:
+ # Test for the clingo based solver
+ runs-on: ubuntu-latest
+ container: spack/github-actions:clingo
+ steps:
+ - name: Run unit tests
+ run: |
+ whoami && echo PWD=$PWD && echo HOME=$HOME && echo SPACK_TEST_SOLVER=$SPACK_TEST_SOLVER
+ which clingo && clingo --version
+ git clone https://github.com/spack/spack.git && cd spack
+ git fetch origin ${{ github.ref }}:test-branch
+ git checkout test-branch
+ . share/spack/setup-env.sh
+ spack compiler find
+ spack solve mpileaks%gcc
+ coverage run $(which spack) test -v
+ coverage combine
+ coverage xml
+ - uses: codecov/codecov-action@v1
+ with:
+ flags: unittests,linux,clingo
diff --git a/lib/spack/spack/test/cmd/buildcache.py b/lib/spack/spack/test/cmd/buildcache.py
index 51d4c267ae..dcd9b822c0 100644
--- a/lib/spack/spack/test/cmd/buildcache.py
+++ b/lib/spack/spack/test/cmd/buildcache.py
@@ -125,6 +125,10 @@ def test_buildcache_create_fails_on_noargs(tmpdir):
buildcache('create', '-d', str(tmpdir), '--unsigned')
+@pytest.mark.skipif(
+ os.environ.get('SPACK_TEST_SOLVER') == 'clingo',
+ reason='Test for Clingo are run in a container with root permissions'
+)
def test_buildcache_create_fail_on_perm_denied(
install_mockery, mock_fetch, monkeypatch, tmpdir):
"""Ensure that buildcache create fails on permission denied error."""
diff --git a/lib/spack/spack/test/database.py b/lib/spack/spack/test/database.py
index 473573fa2e..4682c9850d 100644
--- a/lib/spack/spack/test/database.py
+++ b/lib/spack/spack/test/database.py
@@ -648,6 +648,10 @@ def test_090_non_root_ref_counts(mutable_database):
assert mpich_rec.ref_count == 0
+@pytest.mark.skipif(
+ os.environ.get('SPACK_TEST_SOLVER') == 'clingo',
+ reason='Test for Clingo are run in a container with root permissions'
+)
def test_100_no_write_with_exception_on_remove(database):
def fail_while_writing():
with database.write_transaction():
@@ -665,6 +669,10 @@ def test_100_no_write_with_exception_on_remove(database):
assert len(database.query('mpileaks ^zmpi', installed=any)) == 1
+@pytest.mark.skipif(
+ os.environ.get('SPACK_TEST_SOLVER') == 'clingo',
+ reason='Test for Clingo are run in a container with root permissions'
+)
def test_110_no_write_with_exception_on_install(database):
def fail_while_writing():
with database.write_transaction():
diff --git a/lib/spack/spack/test/llnl/util/lock.py b/lib/spack/spack/test/llnl/util/lock.py
index 800c9d63ad..d4b61929c2 100644
--- a/lib/spack/spack/test/llnl/util/lock.py
+++ b/lib/spack/spack/test/llnl/util/lock.py
@@ -661,6 +661,10 @@ def test_upgrade_read_to_write(private_lock_path):
assert lock._file is None
+@pytest.mark.skipif(
+ os.environ.get('SPACK_TEST_SOLVER') == 'clingo',
+ reason='Test for Clingo are run in a container with root permissions'
+)
def test_upgrade_read_to_write_fails_with_readonly_file(private_lock_path):
"""Test that read-only file can be read-locked but not write-locked."""
# ensure lock file exists the first time