ci: run integration tests against N, N-1, N-2 Dapr runtime versions#1091
ci: run integration tests against N, N-1, N-2 Dapr runtime versions#1091ashoksmore wants to merge 1 commit into
Conversation
Signed-off-by: Ashok More <ashoksmore7@gmail.com>
b689805 to
dbaabad
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1091 +/- ##
==========================================
- Coverage 86.63% 82.14% -4.49%
==========================================
Files 84 116 +32
Lines 4473 9570 +5097
==========================================
+ Hits 3875 7861 +3986
- Misses 598 1709 +1111 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
sicoyle
left a comment
There was a problem hiding this comment.
this is amazing - thank you!!! could you pls mv the python script into its own py file that we can then test and run locally more easily?
There was a problem hiding this comment.
Pull request overview
Updates the CI workflow to validate the Python SDK against the Dapr runtime compatibility window (N, N-1, N-2) by dynamically computing a runtime-version test matrix from the SDK version and dapr/dapr GitHub releases.
Changes:
- Adds a
preparejob that computes a compatibility matrix (Python 3.10–3.14 × runtime patch versions for N/N-1/N-2). - Updates
validateto consume the computed matrix and run integration + example test suites per runtime version. - Pins
setup-dapr-runtimeto an explicit runtime version per matrix entry (instead of always using “latest”).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| run: | | ||
| if [ ${{ github.event.client_payload.command }} = "ok-to-test" ]; then | ||
| echo "CHECKOUT_REPO=${{ github.event.client_payload.pull_head_repo }}" >> $GITHUB_ENV | ||
| echo "CHECKOUT_REF=${{ github.event.client_payload.pull_head_ref }}" >> $GITHUB_ENV | ||
| fi |
| run: | | ||
| CLI_VERSION=$(curl -fsS -H "Authorization: Bearer $GITHUB_TOKEN" \ | ||
| "https://api.github.com/repos/dapr/cli/releases?per_page=10" | \ | ||
| jq -r 'map(select(.prerelease == false)) | sort_by(.created_at) | reverse | .[0].tag_name | ltrimstr("v")') | ||
| if [ -z "$CLI_VERSION" ] || [ "$CLI_VERSION" = "null" ]; then | ||
| echo "Failed to resolve Dapr CLI version" && exit 1 | ||
| if [ ${{ github.event.client_payload.command }} = "ok-to-test" ]; then | ||
| echo "CHECKOUT_REPO=${{ github.event.client_payload.pull_head_repo }}" >> $GITHUB_ENV | ||
| echo "CHECKOUT_REF=${{ github.event.client_payload.pull_head_ref }}" >> $GITHUB_ENV | ||
| fi |
| def latest_patch(runtime_minor: str) -> str | None: | ||
| prefix = f'{runtime_minor}.' | ||
| for prerelease in (False, True): | ||
| versions = [ | ||
| release['tag_name'].removeprefix('v') | ||
| for release in releases | ||
| if release.get('prerelease') == prerelease | ||
| and release['tag_name'].removeprefix('v').startswith(prefix) | ||
| ] | ||
| if versions: | ||
| return sorted(versions, key=version_key)[-1] | ||
| return None |
| matrix_include = [] | ||
| for runtime_minor in runtime_minors: | ||
| runtime_version = latest_patch(runtime_minor) | ||
| if runtime_version is None: | ||
| print(f'Warning: no Dapr runtime release found for {runtime_minor}, skipping') | ||
| continue | ||
| for python_version in python_versions: | ||
| matrix_include.append( | ||
| { | ||
| 'python_ver': python_version, | ||
| 'runtime_version': runtime_version, | ||
| } | ||
| ) | ||
|
|
||
| if not matrix_include: | ||
| raise SystemExit('No Dapr runtime releases found for compatibility matrix') |
|
@ashoksmore Great idea! I was thinking this is potentially useful for other dapr repos too, so I think it'd a good idea to make it reusable. jobs:
versions:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.v.outputs.versions }} # ["1.18.2","1.17.5","1.16.8"]
steps:
- id: v
uses: dapr/.github/.github/actions/dapr-versions@main
test:
needs: versions
strategy:
matrix:
version: ${{ fromJson(needs.versions.outputs.versions) }}
steps:
- uses: dapr/.github/.github/actions/setup-dapr-cli@main
with: { version: ${{ matrix.version }} }What do you think? |
Description
Updates
run-tests.yamlto validate SDK compatibility against Dapr runtime versions N, N-1, and N-2 per the SDK compatibility policy.Changes:
preparejob that reads the SDKVERSIONand derives three runtime minorsdapr/daprreleasesvalidatejob matrix to run existing integration and example tests for each runtime × Python version (3.10-3.14)versiontosetup-dapr-runtimeinstead of always using the latest runtimeThe same workflow file should work on backported release branches without modification.
Issue reference
Fixes #1067
Checklist
build.yamllint/unit checks applytests/integration/andtests/examples/suites across runtime matrix (no new test files; coverage is via CI matrix)