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