Skip to content

Commit

Permalink
reorganize tests, make devdeps testing optional, unpin latest Python …
Browse files Browse the repository at this point in the history
…testing, and prepare for possibility of data caching (#7910)

Co-authored-by: Howard Bushouse <bushouse@stsci.edu>
  • Loading branch information
zacharyburnett and hbushouse committed Dec 6, 2023
1 parent f77b5d6 commit c5d0144
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 75 deletions.
46 changes: 11 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: test

on:
push:
Expand All @@ -19,30 +19,6 @@ concurrency:
cancel-in-progress: true

jobs:
crds:
name: retrieve current CRDS context
runs-on: ubuntu-latest
env:
OBSERVATORY: jwst
CRDS_PATH: /tmp/crds_cache
CRDS_SERVER_URL: https://jwst-crds.stsci.edu
steps:
- id: context
run: >
echo "pmap=$(
curl -s -X POST -d '{"jsonrpc": "1.0", "method": "get_default_context", "params": ["${{ env.OBSERVATORY }}"], "id": 1}' ${{ env.CRDS_SERVER_URL }}/json/ |
python -c "import sys, json; print(json.load(sys.stdin)['result'])"
)" >> $GITHUB_OUTPUT
# Get default CRDS_CONTEXT without installing crds client
# See https://hst-crds.stsci.edu/static/users_guide/web_services.html#generic-request
- id: path
run: echo "path=${{ env.CRDS_PATH }}" >> $GITHUB_OUTPUT
- id: server
run: echo "url=${{ env.CRDS_SERVER_URL }}" >> $GITHUB_OUTPUT
outputs:
context: ${{ steps.context.outputs.pmap }}
path: ${{ steps.path.outputs.path }}
server: ${{ steps.server.outputs.url }}
check:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
with:
Expand All @@ -51,29 +27,29 @@ jobs:
- linux: check-style
- linux: check-security
- linux: check-dependencies
crds_contexts:
uses: spacetelescope/crds/.github/workflows/contexts.yml@master
test:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main
needs: [ crds ]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
needs: [ crds_contexts ]
with:
setenv: |
CRDS_PATH: ${{ needs.crds.outputs.path }}
CRDS_SERVER_URL: ${{ needs.crds.outputs.server }}
CRDS_PATH: /tmp/data/crds_cache
CRDS_SERVER_URL: https://jwst-crds.stsci.edu
CRDS_CLIENT_RETRY_COUNT: 3
CRDS_CLIENT_RETRY_DELAY_SECONDS: 20
cache-path: ${{ needs.crds.outputs.path }}
cache-key: crds-${{ needs.crds.outputs.context }}
cache-path: /tmp/data/crds_cache
cache-key: crds-${{ needs.crds_contexts.outputs.jwst }}
envs: |
- linux: py39-oldestdeps-xdist-cov
pytest-results-summary: true
- linux: py39-xdist
- linux: py39-sdpdeps-xdist
- linux: py310-xdist
- linux: py311-xdist
- linux: py312-xdist
pytest-results-summary: true
- macos: py311-xdist
pytest-results-summary: true
- linux: py311-stdevdeps-xdist
- linux: py312-devdeps-xdist
- linux: py311-xdist-cov
coverage: codecov
pytest-results-summary: true
- linux: py312-xdist
52 changes: 12 additions & 40 deletions .github/workflows/ci_cron.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: weekly tests
name: test on schedule

on:
schedule:
Expand All @@ -7,52 +7,24 @@ on:
workflow_dispatch:

jobs:
crds:
name: retrieve current CRDS context
runs-on: ubuntu-latest
env:
OBSERVATORY: jwst
CRDS_PATH: /tmp/crds_cache
CRDS_SERVER_URL: https://jwst-crds.stsci.edu
steps:
- id: context
run: >
echo "pmap=$(
curl -s -X POST -d '{"jsonrpc": "1.0", "method": "get_default_context", "params": ["${{ env.OBSERVATORY }}"], "id": 1}' ${{ env.CRDS_SERVER_URL }}/json/ |
python -c "import sys, json; print(json.load(sys.stdin)['result'])"
)" >> $GITHUB_OUTPUT
# Get default CRDS_CONTEXT without installing crds client
# See https://hst-crds.stsci.edu/static/users_guide/web_services.html#generic-request
- id: path
run: echo "path=${{ env.CRDS_PATH }}" >> $GITHUB_OUTPUT
- id: server
run: echo "url=${{ env.CRDS_SERVER_URL }}" >> $GITHUB_OUTPUT
outputs:
context: ${{ steps.context.outputs.pmap }}
path: ${{ steps.path.outputs.path }}
server: ${{ steps.server.outputs.url }}
crds_contexts:
uses: spacetelescope/crds/.github/workflows/contexts.yml@master
test:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main
needs: [ crds ]
if: (github.repository == 'spacetelescope/jwst' && (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'run scheduled tests')))
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
needs: [ crds_contexts ]
with:
setenv: |
CRDS_PATH: ${{ needs.crds.outputs.path }}
CRDS_SERVER_URL: ${{ needs.crds.outputs.server }}
CRDS_PATH: /tmp/crds_cache
CRDS_SERVER_URL: https://jwst-crds.stsci.edu
CRDS_CLIENT_RETRY_COUNT: 3
CRDS_CLIENT_RETRY_DELAY_SECONDS: 20
cache-path: ${{ needs.crds.outputs.path }}
cache-key: crds-${{ needs.crds.outputs.context }}
cache-path: /tmp/crds_cache
cache-key: crds-${{ needs.crds_context.outputs.jwst }}
envs: |
- macos: py39-xdist
- macos: py39-sdpdeps-xdist
- macos: py310-xdist
- macos: py312-xdist
- windows: py311-xdist
pytest-results-summary: true
- linux: py311-pyargs-xdist
- linux: py312-devdeps-xdist
pytest-results-summary: true
- macos: py312-devdeps-xdist
pytest-results-summary: true
- windows: py312-devdeps-xdist
pytest-results-summary: true
- linux: py3-pyargs-xdist
57 changes: 57 additions & 0 deletions .github/workflows/tests_devdeps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: test with development versions

on:
push:
branches:
- master
- '*x'
tags:
- '*'
pull_request:
branches:
- master
schedule:
# Weekly Monday 9AM build
- cron: "0 9 * * 1"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
crds_contexts:
uses: spacetelescope/crds/.github/workflows/contexts.yml@master
test:
if: (github.repository == 'spacetelescope/jwst' && (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'run devdeps tests')))
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
needs: [ crds_contexts ]
with:
setenv: |
CRDS_PATH: /tmp/data/crds_cache
CRDS_SERVER_URL: https://jwst-crds.stsci.edu
CRDS_CLIENT_RETRY_COUNT: 3
CRDS_CLIENT_RETRY_DELAY_SECONDS: 20
cache-path: /tmp/data/crds_cache
cache-key: crds-${{ needs.crds_contexts.outputs.jwst }}
envs: |
- linux: py3-xdist
pytest-results-summary: true
- macos: py3-xdist
pytest-results-summary: true
- linux: py311-stdevdeps-xdist
pytest-results-summary: true
- macos: py311-stdevdeps-xdist
pytest-results-summary: true
- linux: py3-stdevdeps-xdist
pytest-results-summary: true
- macos: py3-stdevdeps-xdist
pytest-results-summary: true
- linux: py311-devdeps-xdist
pytest-results-summary: true
- macos: py311-devdeps-xdist
pytest-results-summary: true
- linux: py3-devdeps-xdist
pytest-results-summary: true
- macos: py3-devdeps-xdist
pytest-results-summary: true

0 comments on commit c5d0144

Please sign in to comment.