Skip to content

Commit

Permalink
Split test flags from map onto two lines and remove empty key string
Browse files Browse the repository at this point in the history
  • Loading branch information
langmm committed Feb 8, 2024
1 parent 66ab833 commit aa5b90f
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 62 deletions.
96 changes: 48 additions & 48 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ jobs:
run: echo "versions={\"ubuntu\":\"latest\", \"macos\":\"latest\", \"windows\":\"latest\"}"
>> $GITHUB_OUTPUT
- id: set-test-flags
run: echo "test-flags={\"\":\"\", \"basic\":\"--long-running --suites timing
run: echo "test-flags={\"empty\":\"\", \"basic\":\"--long-running --suites timing
demos top\", \"examples\":\"--suite=examples --extra-examples --mpi-script=run_mpi.sh
--mpi-nproc=3\", \"types-no-c\":\"--suite=types --skip-languages c cpp\",
\"types-c\":\"--suite=types --languages c cpp\", \"long\":\"--long-running\",
Expand Down Expand Up @@ -293,14 +293,13 @@ jobs:
runs-on: ${{ matrix.os-base }}-${{ fromJSON(needs.params.outputs.os-versions)[matrix.os-base]
}}
steps:
- name: Set test flags
run: 'echo "TEST_FLAGS1=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags1]
- name: Set test-flags1
run: echo "TEST_FLAGS1=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags1]
}}" >> $GITHUB_ENV
echo "TEST_FLAGS2=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags2]
shell: bash -l {0}
- name: Set test-flags2
run: echo "TEST_FLAGS2=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags2]
}}" >> $GITHUB_ENV
'
shell: bash -l {0}
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -535,7 +534,7 @@ jobs:
timeout-minutes: 180
- continue-on-error: true
id: test2
if: ${{ env.TEST_FLAGS2 != '' }}
if: ${{ env.test-flags2 != 'empty' }}
name: Run tests (2nd)
run: pytest --ci --cov-append ${{ env.TEST_FLAGS2 }}
timeout-minutes: 180
Expand All @@ -546,7 +545,8 @@ jobs:
timeout-minutes: 180
- continue-on-error: true
id: test2_script
if: ${{ env.TEST_FLAGS2 != '' && contains(env.TEST_FLAGS2, '--mpi-script') }}
if: ${{ env.test-flags2 != 'empty' && contains(env.TEST_FLAGS2, '--mpi-script')
}}
name: Run generated test script (2nd)
run: ./run_mpi.sh
timeout-minutes: 180
Expand Down Expand Up @@ -601,7 +601,7 @@ jobs:
os-base: ubuntu
python-version: 3.7
test-flags1: long
test-flags2: ''
test-flags2: empty
- install-c: true
install-method: conda
install-mpi: false
Expand All @@ -617,15 +617,15 @@ jobs:
os-base: ubuntu
python-version: '3.10'
test-flags1: long
test-flags2: ''
test-flags2: empty
- install-c: true
install-method: conda
install-mpi: false
install-sbml: false
os-base: ubuntu
python-version: '3.11'
test-flags1: long
test-flags2: ''
test-flags2: empty
- install-c: true
install-method: conda
install-mpi: false
Expand Down Expand Up @@ -661,14 +661,13 @@ jobs:
runs-on: ${{ matrix.os-base }}-${{ fromJSON(needs.params.outputs.os-versions)[matrix.os-base]
}}
steps:
- name: Set test flags
run: 'echo "TEST_FLAGS1=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags1]
- name: Set test-flags1
run: echo "TEST_FLAGS1=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags1]
}}" >> $GITHUB_ENV
echo "TEST_FLAGS2=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags2]
shell: bash -l {0}
- name: Set test-flags2
run: echo "TEST_FLAGS2=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags2]
}}" >> $GITHUB_ENV
'
shell: bash -l {0}
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -903,7 +902,7 @@ jobs:
timeout-minutes: 180
- continue-on-error: true
id: test2
if: ${{ env.TEST_FLAGS2 != '' }}
if: ${{ env.test-flags2 != 'empty' }}
name: Run tests (2nd)
run: pytest --ci --cov-append ${{ env.TEST_FLAGS2 }}
timeout-minutes: 180
Expand All @@ -914,7 +913,8 @@ jobs:
timeout-minutes: 180
- continue-on-error: true
id: test2_script
if: ${{ env.TEST_FLAGS2 != '' && contains(env.TEST_FLAGS2, '--mpi-script') }}
if: ${{ env.test-flags2 != 'empty' && contains(env.TEST_FLAGS2, '--mpi-script')
}}
name: Run generated test script (2nd)
run: ./run_mpi.sh
timeout-minutes: 180
Expand Down Expand Up @@ -969,7 +969,7 @@ jobs:
os-base: windows
python-version: 3.8
test-flags1: long
test-flags2: ''
test-flags2: empty
install-c:
- true
install-method:
Expand All @@ -990,7 +990,7 @@ jobs:
- types-no-c
- types-c
test-flags2:
- ''
- empty
max-parallel: 20
test_rmq_conda:
defaults:
Expand All @@ -1013,14 +1013,13 @@ jobs:
ports:
- 5672:5672
steps:
- name: Set test flags
run: 'echo "TEST_FLAGS1=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags1]
- name: Set test-flags1
run: echo "TEST_FLAGS1=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags1]
}}" >> $GITHUB_ENV
echo "TEST_FLAGS2=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags2]
shell: bash -l {0}
- name: Set test-flags2
run: echo "TEST_FLAGS2=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags2]
}}" >> $GITHUB_ENV
'
shell: bash -l {0}
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -1255,7 +1254,7 @@ jobs:
timeout-minutes: 180
- continue-on-error: true
id: test2
if: ${{ env.TEST_FLAGS2 != '' }}
if: ${{ env.test-flags2 != 'empty' }}
name: Run tests (2nd)
run: pytest --ci --cov-append ${{ env.TEST_FLAGS2 }}
timeout-minutes: 180
Expand All @@ -1266,7 +1265,8 @@ jobs:
timeout-minutes: 180
- continue-on-error: true
id: test2_script
if: ${{ env.TEST_FLAGS2 != '' && contains(env.TEST_FLAGS2, '--mpi-script') }}
if: ${{ env.test-flags2 != 'empty' && contains(env.TEST_FLAGS2, '--mpi-script')
}}
name: Run generated test script (2nd)
run: ./run_mpi.sh
timeout-minutes: 180
Expand Down Expand Up @@ -1348,14 +1348,13 @@ jobs:
ports:
- 5672:5672
steps:
- name: Set test flags
run: 'echo "TEST_FLAGS1=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags1]
- name: Set test-flags1
run: echo "TEST_FLAGS1=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags1]
}}" >> $GITHUB_ENV
echo "TEST_FLAGS2=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags2]
shell: bash -l {0}
- name: Set test-flags2
run: echo "TEST_FLAGS2=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags2]
}}" >> $GITHUB_ENV
'
shell: bash -l {0}
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -1590,7 +1589,7 @@ jobs:
timeout-minutes: 180
- continue-on-error: true
id: test2
if: ${{ env.TEST_FLAGS2 != '' }}
if: ${{ env.test-flags2 != 'empty' }}
name: Run tests (2nd)
run: pytest --ci --cov-append ${{ env.TEST_FLAGS2 }}
timeout-minutes: 180
Expand All @@ -1601,7 +1600,8 @@ jobs:
timeout-minutes: 180
- continue-on-error: true
id: test2_script
if: ${{ env.TEST_FLAGS2 != '' && contains(env.TEST_FLAGS2, '--mpi-script') }}
if: ${{ env.test-flags2 != 'empty' && contains(env.TEST_FLAGS2, '--mpi-script')
}}
name: Run generated test script (2nd)
run: ./run_mpi.sh
timeout-minutes: 180
Expand Down Expand Up @@ -1663,7 +1663,7 @@ jobs:
test-flags1:
- long-interp
test-flags2:
- ''
- empty
test_stripped:
env:
INSTALLC: 0
Expand All @@ -1682,14 +1682,13 @@ jobs:
runs-on: ${{ matrix.os-base }}-${{ fromJSON(needs.params.outputs.os-versions)[matrix.os-base]
}}
steps:
- name: Set test flags
run: 'echo "TEST_FLAGS1=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags1]
- name: Set test-flags1
run: echo "TEST_FLAGS1=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags1]
}}" >> $GITHUB_ENV
echo "TEST_FLAGS2=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags2]
shell: bash -l {0}
- name: Set test-flags2
run: echo "TEST_FLAGS2=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags2]
}}" >> $GITHUB_ENV
'
shell: bash -l {0}
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -1924,7 +1923,7 @@ jobs:
timeout-minutes: 180
- continue-on-error: true
id: test2
if: ${{ env.TEST_FLAGS2 != '' }}
if: ${{ env.test-flags2 != 'empty' }}
name: Run tests (2nd)
run: pytest --ci --cov-append ${{ env.TEST_FLAGS2 }}
timeout-minutes: 180
Expand All @@ -1935,7 +1934,8 @@ jobs:
timeout-minutes: 180
- continue-on-error: true
id: test2_script
if: ${{ env.TEST_FLAGS2 != '' && contains(env.TEST_FLAGS2, '--mpi-script') }}
if: ${{ env.test-flags2 != 'empty' && contains(env.TEST_FLAGS2, '--mpi-script')
}}
name: Run generated test script (2nd)
run: ./run_mpi.sh
timeout-minutes: 180
Expand Down Expand Up @@ -1999,7 +1999,7 @@ jobs:
test-flags1:
- long
test-flags2:
- ''
- empty
upload_sdist:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
name: Upload sdist
Expand Down
29 changes: 15 additions & 14 deletions utils/test-install-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- id: set-os-versions
run: echo "versions={\"ubuntu\":\"latest\", \"macos\":\"latest\", \"windows\":\"latest\"}" >> $GITHUB_OUTPUT
- id: set-test-flags
run: echo "test-flags={\"\":\"\", \"basic\":\"--long-running --suites timing demos top\", \"examples\":\"--suite=examples --extra-examples --mpi-script=run_mpi.sh --mpi-nproc=3\", \"types-no-c\":\"--suite=types --skip-languages c cpp\", \"types-c\":\"--suite=types --languages c cpp\", \"long\":\"--long-running\", \"long-mpi\":\"--long-running --mpi-script=run_mpi.sh\", \"examples-backwards\":\"--suite=examples --parametrize-example-name=backwards\", \"examples-sbml\":\"--suites examples --parametrize-language=sbml\", \"long-remote-service\":\"--long-running --remote-service\", \"examples-rpc-lesson3\":\"--suites examples top --parametrize-example-name=rpc_lesson3\", \"tools\":\"tests/test_tools.py\", \"long-interp\":\"--long-running --languages python R matlab\", \"services\":\"tests/test_services.py --nocapture\"}" >> $GITHUB_OUTPUT
run: echo "test-flags={\"empty\":\"\", \"basic\":\"--long-running --suites timing demos top\", \"examples\":\"--suite=examples --extra-examples --mpi-script=run_mpi.sh --mpi-nproc=3\", \"types-no-c\":\"--suite=types --skip-languages c cpp\", \"types-c\":\"--suite=types --languages c cpp\", \"long\":\"--long-running\", \"long-mpi\":\"--long-running --mpi-script=run_mpi.sh\", \"examples-backwards\":\"--suite=examples --parametrize-example-name=backwards\", \"examples-sbml\":\"--suites examples --parametrize-language=sbml\", \"long-remote-service\":\"--long-running --remote-service\", \"examples-rpc-lesson3\":\"--suites examples top --parametrize-example-name=rpc_lesson3\", \"tools\":\"tests/test_tools.py\", \"long-interp\":\"--long-running --languages python R matlab\", \"services\":\"tests/test_services.py --nocapture\"}" >> $GITHUB_OUTPUT
test_pip:
needs: params
name: Test (${{ matrix.python-version }}, ${{ matrix.os-base }}, ${{ matrix.install-method }}, ${{ matrix.test-flags1 }}, ${{ matrix.test-flags2 }}), Install C = ${{ matrix.install-c }}
Expand All @@ -57,7 +57,7 @@ jobs:
python-version: [3.8]
install-method: [pip]
test-flags1: [basic, examples, types-no-c, types-c]
test-flags2: [""]
test-flags2: [empty]
install-c: [true]
install-mpi: [true]
install-sbml: [false]
Expand All @@ -66,17 +66,18 @@ jobs:
python-version: 3.8
install-method: pip
test-flags1: long
test-flags2: ""
test-flags2: empty
install-c: false
install-mpi: false
install-sbml: false
fail-fast: false

steps: &steps
- name: Set test flags
run: |
echo "TEST_FLAGS1=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags1] }}" >> $GITHUB_ENV
echo "TEST_FLAGS2=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags2] }}" >> $GITHUB_ENV
- name: Set test-flags1
run: echo "TEST_FLAGS1=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags1] }}" >> $GITHUB_ENV
shell: bash -l {0}
- name: Set test-flags2
run: echo "TEST_FLAGS2=${{ fromJSON(needs.params.outputs.test-flags)[matrix.test-flags2] }}" >> $GITHUB_ENV
shell: bash -l {0}
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -312,7 +313,7 @@ jobs:

- name: Run tests (2nd)
timeout-minutes: 180
if: ${{ env.TEST_FLAGS2 != '' }}
if: ${{ env.test-flags2 != 'empty' }}
id: test2
run: pytest --ci --cov-append ${{ env.TEST_FLAGS2 }}
continue-on-error: true
Expand All @@ -323,7 +324,7 @@ jobs:

- name: Run generated test script (2nd)
timeout-minutes: 180
if: ${{ env.TEST_FLAGS2 != '' && contains(env.TEST_FLAGS2, '--mpi-script') }}
if: ${{ env.test-flags2 != 'empty' && contains(env.TEST_FLAGS2, '--mpi-script') }}
id: test2_script
run: ./run_mpi.sh
continue-on-error: true
Expand Down Expand Up @@ -391,7 +392,7 @@ jobs:
python-version: 3.7
install-method: conda
test-flags1: long
test-flags2: ""
test-flags2: empty
install-c: true
install-mpi: false
install-sbml: false
Expand All @@ -407,7 +408,7 @@ jobs:
python-version: "3.10"
install-method: conda
test-flags1: long
test-flags2: ""
test-flags2: empty
install-method: conda
install-c: true
install-mpi: false
Expand All @@ -416,7 +417,7 @@ jobs:
python-version: "3.11"
install-method: conda
test-flags1: long
test-flags2: ""
test-flags2: empty
install-c: true
install-mpi: false
install-sbml: false
Expand Down Expand Up @@ -449,7 +450,7 @@ jobs:
python-version: [3.8]
install-method: [pip]
test-flags1: [long-interp]
test-flags2: [""]
test-flags2: [empty]
install-c: [true]
install-mpi: [false]
install-sbml: [false]
Expand Down Expand Up @@ -508,7 +509,7 @@ jobs:
python-version: [3.8]
install-method: [pip]
test-flags1: [long]
test-flags2: [""]
test-flags2: [empty]
install-c: [false]
install-mpi: [false]
install-sbml: [false]
Expand Down

0 comments on commit aa5b90f

Please sign in to comment.