Simplify linux unit-tests, skip windows unit-tests on package PRs
This commit is contained in:
parent
31cb0bbc40
commit
3efa8b4d16
2
.github/workflows/ci.yaml
vendored
2
.github/workflows/ci.yaml
vendored
@ -102,6 +102,8 @@ jobs:
|
||||
if: ${{ github.repository == 'spack/spack' && needs.changes.outputs.core == 'true' }}
|
||||
needs: [ prechecks ]
|
||||
uses: ./.github/workflows/windows_python.yml
|
||||
with:
|
||||
core: ${{ needs.changes.outputs.core }}
|
||||
all:
|
||||
needs: [ windows, unit-tests, bootstrap, audit-ancient-python ]
|
||||
runs-on: ubuntu-latest
|
||||
|
45
.github/workflows/unit_tests.yaml
vendored
45
.github/workflows/unit_tests.yaml
vendored
@ -32,10 +32,10 @@ jobs:
|
||||
include:
|
||||
- python-version: 2.7
|
||||
concretizer: original
|
||||
on_develop: false
|
||||
on_develop: ${{ github.ref == 'refs/heads/develop' }}
|
||||
- python-version: '3.10'
|
||||
concretizer: original
|
||||
on_develop: false
|
||||
on_develop: ${{ github.ref == 'refs/heads/develop' }}
|
||||
exclude:
|
||||
- python-version: '3.7'
|
||||
concretizer: 'clingo'
|
||||
@ -87,7 +87,6 @@ jobs:
|
||||
spack bootstrap untrust spack-install
|
||||
spack -v solve zlib
|
||||
- name: Run unit tests (full suite with coverage)
|
||||
if: ${{ inputs.with_coverage == 'true' }}
|
||||
env:
|
||||
SPACK_PYTHON: python
|
||||
COVERAGE: true
|
||||
@ -96,16 +95,7 @@ jobs:
|
||||
share/spack/qa/run-unit-tests
|
||||
coverage combine
|
||||
coverage xml
|
||||
- name: Run unit tests (reduced suite without coverage)
|
||||
if: ${{ inputs.with_coverage == 'false' }}
|
||||
env:
|
||||
SPACK_PYTHON: python
|
||||
ONLY_PACKAGES: true
|
||||
SPACK_TEST_SOLVER: ${{ matrix.concretizer }}
|
||||
run: |
|
||||
share/spack/qa/run-unit-tests
|
||||
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # @v2.1.0
|
||||
if: ${{ inputs.with_coverage == 'true' }}
|
||||
with:
|
||||
flags: unittests,linux,${{ matrix.concretizer }}
|
||||
# Test shell integration
|
||||
@ -150,7 +140,7 @@ jobs:
|
||||
# only on PRs modifying core Spack
|
||||
rhel8-platform-python:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ inputs.with_coverage == 'true' }}
|
||||
if: ${{ inputs.with_coverage == 'false' }}
|
||||
container: registry.access.redhat.com/ubi8/ubi
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
@ -199,7 +189,6 @@ jobs:
|
||||
git --version
|
||||
. .github/workflows/setup_git.sh
|
||||
- name: Run unit tests (full suite with coverage)
|
||||
if: ${{ inputs.with_coverage == 'true' }}
|
||||
env:
|
||||
COVERAGE: true
|
||||
SPACK_TEST_SOLVER: clingo
|
||||
@ -207,15 +196,7 @@ jobs:
|
||||
share/spack/qa/run-unit-tests
|
||||
coverage combine
|
||||
coverage xml
|
||||
- name: Run unit tests (reduced suite without coverage)
|
||||
if: ${{ inputs.with_coverage == 'false' }}
|
||||
env:
|
||||
ONLY_PACKAGES: true
|
||||
SPACK_TEST_SOLVER: clingo
|
||||
run: |
|
||||
share/spack/qa/run-unit-tests
|
||||
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # @v2.1.0
|
||||
if: ${{ inputs.with_coverage == 'true' }}
|
||||
with:
|
||||
flags: unittests,linux,clingo
|
||||
# Run unit tests on MacOS
|
||||
@ -249,21 +230,13 @@ jobs:
|
||||
$(which spack) bootstrap untrust spack-install
|
||||
$(which spack) solve zlib
|
||||
common_args=(--dist loadfile --tx '4*popen//python=./bin/spack-tmpconfig python -u ./bin/spack python' -x)
|
||||
if [ "${{ inputs.with_coverage }}" == "true" ]
|
||||
then
|
||||
coverage run $(which spack) unit-test "${common_args[@]}"
|
||||
coverage combine
|
||||
coverage xml
|
||||
# Delete the symlink going from ./lib/spack/docs/_spack_root back to
|
||||
# the initial directory, since it causes ELOOP errors with codecov/actions@2
|
||||
rm lib/spack/docs/_spack_root
|
||||
else
|
||||
echo "ONLY PACKAGE RECIPES CHANGED [skipping coverage]"
|
||||
$(which spack) unit-test "${common_args[@]}" -m "not maybeslow" -k "test_all_virtual_packages_have_default_providers"
|
||||
fi
|
||||
coverage run $(which spack) unit-test "${common_args[@]}"
|
||||
coverage combine
|
||||
coverage xml
|
||||
# Delete the symlink going from ./lib/spack/docs/_spack_root back to
|
||||
# the initial directory, since it causes ELOOP errors with codecov/actions@2
|
||||
rm lib/spack/docs/_spack_root
|
||||
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # @v2.1.0
|
||||
if: ${{ inputs.with_coverage == 'true' }}
|
||||
with:
|
||||
files: ./coverage.xml
|
||||
flags: unittests,macos
|
||||
|
||||
|
8
.github/workflows/windows_python.yml
vendored
8
.github/workflows/windows_python.yml
vendored
@ -2,6 +2,10 @@ name: windows
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
core:
|
||||
type: string
|
||||
required: true
|
||||
|
||||
concurrency:
|
||||
group: windows-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}
|
||||
@ -13,6 +17,7 @@ defaults:
|
||||
powershell Invoke-Expression -Command ".\share\spack\qa\windows_test_setup.ps1"; {0}
|
||||
jobs:
|
||||
unit-tests:
|
||||
if: ${{ inputs.core == 'false' }}
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
@ -32,6 +37,7 @@ jobs:
|
||||
echo F|xcopy .\spack\share\spack\qa\configuration\windows_config.yaml $env:USERPROFILE\.spack\windows\config.yaml
|
||||
spack unit-test --verbose --ignore=lib/spack/spack/test/cmd
|
||||
unit-tests-cmd:
|
||||
if: ${{ inputs.core == 'false' }}
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
@ -70,6 +76,7 @@ jobs:
|
||||
spack external find ninja
|
||||
spack install abseil-cpp
|
||||
make-installer:
|
||||
if: ${{ inputs.core == 'false' }}
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Disable Windows Symlinks
|
||||
@ -105,6 +112,7 @@ jobs:
|
||||
name: Windows Spack Installer
|
||||
path: ${{ env.installer_root}}\pkg\Spack.msi
|
||||
execute-installer:
|
||||
if: ${{ inputs.core == 'false' }}
|
||||
needs: make-installer
|
||||
runs-on: windows-latest
|
||||
defaults:
|
||||
|
@ -46,10 +46,7 @@ $coverage_run $(which spack) python -c "import spack.pkg.builtin.mpileaks; repr(
|
||||
#-----------------------------------------------------------
|
||||
# Run unit tests with code coverage
|
||||
#-----------------------------------------------------------
|
||||
if [[ "$ONLY_PACKAGES" == "true" ]]; then
|
||||
echo "ONLY PACKAGE RECIPES CHANGED [running only package sanity]"
|
||||
export PYTEST_ADDOPTS='-k "test_all_virtual_packages_have_default_providers" -m "not maybeslow"'
|
||||
elif [[ "$SPACK_TEST_SOLVER" == "original" ]]; then
|
||||
if [[ "$SPACK_TEST_SOLVER" == "original" ]]; then
|
||||
echo "ORIGINAL CONCRETIZER [skipping slow unit tests]"
|
||||
export PYTEST_ADDOPTS='-m "not maybeslow"'
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user