Skip to content

ci: run integration tests against N, N-1, N-2 Dapr runtime versions#1091

Open
ashoksmore wants to merge 1 commit into
dapr:mainfrom
ashoksmore:feature/version-compat-matrix
Open

ci: run integration tests against N, N-1, N-2 Dapr runtime versions#1091
ashoksmore wants to merge 1 commit into
dapr:mainfrom
ashoksmore:feature/version-compat-matrix

Conversation

@ashoksmore

Copy link
Copy Markdown

Description

Updates run-tests.yaml to validate SDK compatibility against Dapr runtime versions N, N-1, and N-2 per the SDK compatibility policy.

Changes:

  • Adds a prepare job that reads the SDK VERSION and derives three runtime minors
  • Resolves the latest patch (or RC if stable is unavailable) for each minor from dapr/dapr releases
  • Expands the validate job matrix to run existing integration and example tests for each runtime × Python version (3.10-3.14)
  • Passes explicit version to setup-dapr-runtime instead of always using the latest runtime

The same workflow file should work on backported release branches without modification.

Issue reference

Fixes #1067

Checklist

  • Code compiles correctly: CI workflow change only; build.yaml lint/unit checks apply
  • Created/updated tests: Reuses existing tests/integration/ and tests/examples/ suites across runtime matrix (no new test files; coverage is via CI matrix)
  • Extended the documentation: Not required for this CI-only maintenance change

@ashoksmore ashoksmore requested review from a team as code owners June 13, 2026 06:30
Signed-off-by: Ashok More <ashoksmore7@gmail.com>
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.14%. Comparing base (bffb749) to head (dbaabad).
⚠️ Report is 146 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sicoyle sicoyle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 prepare job that computes a compatibility matrix (Python 3.10–3.14 × runtime patch versions for N/N-1/N-2).
  • Updates validate to consume the computed matrix and run integration + example test suites per runtime version.
  • Pins setup-dapr-runtime to 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.

Comment on lines 39 to 43
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
Comment on lines 134 to 138
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
Comment on lines +81 to +92
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
Comment on lines +95 to +110
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')
@acroca

acroca commented Jun 18, 2026

Copy link
Copy Markdown
Member

@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.
We could create a new action in https://github.com/dapr/.github/tree/main/.github/actions (this is the repo where we have hared actions and workflows for various dapr repos) that just returns the latest 3 dapr minor versions as an output.
This new action would be then used together with the setup-dapr-runtime like you did in this PR, something like this:

  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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add test coverage for sdk running with different runtime versions

4 participants