From b8b06e1bfd2d1f85a5038640da2c1ebed9d7d43e Mon Sep 17 00:00:00 2001 From: Daniil Gusev Date: Mon, 23 Nov 2026 13:02:10 +0100 Subject: [PATCH 1/2] ci: remove the daily Python integration run and Slack alerts The daily run is removed. Python integration tests now run only when a v release is published (release.yml). The Slack failure step is removed, with the notify-slack action and the pytest-json-report dev dependency that wrote its report. Nothing else used them. --- .github/actions/notify-slack/action.yml | 73 ------------------------- .github/workflows/daily.yml | 20 ------- .github/workflows/run_tests.yml | 22 +------- sdks/python/pyproject.toml | 2 +- uv.lock | 27 --------- 5 files changed, 3 insertions(+), 141 deletions(-) delete mode 100644 .github/actions/notify-slack/action.yml delete mode 100644 .github/workflows/daily.yml diff --git a/.github/actions/notify-slack/action.yml b/.github/actions/notify-slack/action.yml deleted file mode 100644 index bb14965f3c..0000000000 --- a/.github/actions/notify-slack/action.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Notify Slack on failure -description: Parse pytest JSON report and post failure notification to Slack -inputs: - workflow-name: - description: 'Display name of the workflow that failed.' - required: true - report-file: - description: 'Path to pytest JSON report file.' - required: false - default: '.report.json' - summary: - description: 'Short summary for the Slack notification.' - required: true - slack-webhook-url: - description: 'Slack incoming webhook URL.' - required: true -runs: - using: composite - steps: - - name: Build Slack payload - shell: bash - env: - SUMMARY: ${{ inputs.summary }} - WORKFLOW: ${{ inputs.workflow-name }} - REPO: ${{ github.repository }} - REF: ${{ github.head_ref || github.ref_name }} - EVENT: ${{ github.event_name }} - RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} - run: | - DETAILS=$(uv run --frozen dev.py parse-pytest-report --file ${{ inputs.report-file }}) - - jq -n \ - --arg details "$DETAILS" \ - --arg summary "$SUMMARY" \ - --arg workflow "$WORKFLOW" \ - --arg repo "$REPO" \ - --arg ref "$REF" \ - --arg event "$EVENT" \ - --arg run_url "$RUN_URL" \ - '{ - text: "[FAILED] \($workflow) in \($repo)", - blocks: [ - { - type: "section", - text: { - type: "mrkdwn", - text: "*GitHub Actions failure*\n*Workflow:* `\($workflow)`\n*Repository:* `\($repo)`\n*Ref:* `\($ref)`\n*Event:* `\($event)`\n*Summary:* \($summary)\n*Run:* \($run_url)" - } - }, - { - type: "section", - text: { - type: "mrkdwn", - text: "*Details:*\n\n\($details)" - } - }, - { - type: "context", - elements: [ - { - type: "mrkdwn", - text: ":link: <\($run_url)|View Run>" - } - ] - } - ] - }' > /tmp/slack-payload.json - - name: Post failure notification - uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1 - with: - webhook: ${{ inputs.slack-webhook-url }} - webhook-type: incoming-webhook - payload-file-path: /tmp/slack-payload.json diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml deleted file mode 100644 index d5fa59993b..0000000000 --- a/.github/workflows/daily.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Integration (daily) -on: - schedule: - # Runs at 03:00 UTC daily — adjust as needed - - cron: '0 3 * * *' - workflow_dispatch: { } - -permissions: - contents: read - -jobs: - integration: - uses: ./.github/workflows/run_tests.yml - with: - marker: 'integration' - pytest-params: "--json-report --json-report-file=.report.json" - notify-on-failure: true - # The provider keys and the Slack webhook live in this environment. - environment: integration - secrets: inherit diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 3652f85094..c0da4bc9af 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -6,16 +6,6 @@ on: description: 'pytest -m expression (e.g., `not integration` or `integration`)' required: true type: string - pytest-params: - description: 'additional pytest params' - required: false - default: "" - type: string - notify-on-failure: - description: 'Post to Slack on test failure' - required: false - default: false - type: boolean environment: description: 'Environment the test job runs in, for its provider keys; empty runs it in none' required: false @@ -144,14 +134,6 @@ jobs: # Unit tests spread over every core; integration tests stay serial so the providers' # rate limits see one caller. - name: Run core tests - run: uv run --no-sync pytest -m "${{ inputs.marker }}" ${{ inputs.marker != 'integration' && '-n auto --dist worksteal' || '' }} tests/ ${{ inputs.pytest-params }} + run: uv run --no-sync pytest -m "${{ inputs.marker }}" ${{ inputs.marker != 'integration' && '-n auto --dist worksteal' || '' }} tests/ - name: Run plugin tests - run: uv run --no-sync pytest -m "${{ inputs.marker }}" ${{ inputs.marker != 'integration' && '-n auto --dist worksteal' || '' }} plugins/*/tests/*.py ${{ inputs.pytest-params }} - - name: Notify Slack on failure - if: failure() && inputs.notify-on-failure - uses: ./.github/actions/notify-slack - with: - workflow-name: ${{ github.workflow }} - report-file: .report.json - summary: "${{ github.workflow }} failed" - slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + run: uv run --no-sync pytest -m "${{ inputs.marker }}" ${{ inputs.marker != 'integration' && '-n auto --dist worksteal' || '' }} plugins/*/tests/*.py diff --git a/sdks/python/pyproject.toml b/sdks/python/pyproject.toml index 6d59ad4f59..f1e305c8bf 100644 --- a/sdks/python/pyproject.toml +++ b/sdks/python/pyproject.toml @@ -48,7 +48,7 @@ Source = "https://github.com/GetStream/Vision-Agents" vision-agents = "vision_agents.cli.main:main" [project.optional-dependencies] -dev = ["pytest", "pytest-json-report", "mypy", "ruff"] +dev = ["pytest", "mypy", "ruff"] anthropic = ["vision-agents-plugins-anthropic"] cartesia = ["vision-agents-plugins-cartesia"] deepgram = ["vision-agents-plugins-deepgram"] diff --git a/uv.lock b/uv.lock index 81ba89c44f..c4da91d33c 100644 --- a/uv.lock +++ b/uv.lock @@ -4653,31 +4653,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/9d/7a/d968e294073affff457b041c2be9868a40c1c71f4a35fcc1e45e5493067b/pytest_cov-7.1.0-py3-none-any.whl", hash = "sha256:a0461110b7865f9a271aa1b51e516c9a95de9d696734a2f71e3e78f46e1d4678", size = 22876, upload-time = "2026-03-21T20:11:14.438Z" }, ] -[[package]] -name = "pytest-json-report" -version = "1.5.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "pytest" }, - { name = "pytest-metadata" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/4f/d3/765dae9712fcd68d820338908c1337e077d5fdadccd5cacf95b9b0bea278/pytest-json-report-1.5.0.tar.gz", hash = "sha256:2dde3c647851a19b5f3700729e8310a6e66efb2077d674f27ddea3d34dc615de", size = 21241, upload-time = "2022-03-15T21:03:10.2Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/81/35/d07400c715bf8a88aa0c1ee9c9eb6050ca7fe5b39981f0eea773feeb0681/pytest_json_report-1.5.0-py3-none-any.whl", hash = "sha256:9897b68c910b12a2e48dd849f9a284b2c79a732a8a9cb398452ddd23d3c8c325", size = 13222, upload-time = "2022-03-15T21:03:08.65Z" }, -] - -[[package]] -name = "pytest-metadata" -version = "3.1.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "pytest" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/a6/85/8c969f8bec4e559f8f2b958a15229a35495f5b4ce499f6b865eac54b878d/pytest_metadata-3.1.1.tar.gz", hash = "sha256:d2a29b0355fbc03f168aa96d41ff88b1a3b44a3b02acbe491801c98a048017c8", size = 9952, upload-time = "2024-02-12T19:38:44.887Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/3e/43/7e7b2ec865caa92f67b8f0e9231a798d102724ca4c0e1f414316be1c1ef2/pytest_metadata-3.1.1-py3-none-any.whl", hash = "sha256:c8e0844db684ee1c798cfa38908d20d67d0463ecb6137c72e91f418558dd5f4b", size = 11428, upload-time = "2024-02-12T19:38:42.531Z" }, -] - [[package]] name = "pytest-timeout" version = "2.4.0" @@ -6422,7 +6397,6 @@ deepgram = [ dev = [ { name = "mypy" }, { name = "pytest" }, - { name = "pytest-json-report" }, { name = "ruff" }, ] elevenlabs = [ @@ -6544,7 +6518,6 @@ requires-dist = [ { name = "pillow", specifier = ">=10.4.0" }, { name = "pydantic", specifier = ">=2.7" }, { name = "pytest", marker = "extra == 'dev'" }, - { name = "pytest-json-report", marker = "extra == 'dev'" }, { name = "python-dotenv", specifier = ">=1.1.1" }, { name = "redis", extras = ["hiredis"], marker = "extra == 'redis'", specifier = ">=5.0.0" }, { name = "ruff", marker = "extra == 'dev'" }, From 4cdbbe1e3d420b92593b39abf9a3f434fe7b8dee Mon Sep 17 00:00:00 2001 From: Daniil Gusev Date: Mon, 23 Nov 2026 13:09:56 +0100 Subject: [PATCH 2/2] ci: remove the pytest report parser left from the Slack alerts dev.py parse-pytest-report read the .report.json that only the removed Slack step used. The sample plugin comment no longer says integration tests run daily. --- .gitignore | 2 - dev.py | 89 ------------------- .../tests/test_example_plugin.py | 2 +- 3 files changed, 1 insertion(+), 92 deletions(-) diff --git a/.gitignore b/.gitignore index 14f305bacd..da0e047f91 100644 --- a/.gitignore +++ b/.gitignore @@ -123,8 +123,6 @@ profile.html .uv-cache/ -# pytest json report -.report.json .cursor/ # Code generators fetched on demand, not vendored. See sdks/swift/README.md. diff --git a/dev.py b/dev.py index f5ea0927e2..01972d80e2 100755 --- a/dev.py +++ b/dev.py @@ -4,8 +4,6 @@ Essential dev commands for testing, linting, and type checking """ -import datetime -import json import os import shlex import subprocess @@ -281,92 +279,5 @@ def check(): click.echo("\n✅ All checks passed!") -def _extract_first_failure( - tests: list[dict], -) -> tuple[str, str, str] | tuple[None, None, None]: - """ - Return (nodeid, phase, message) for first failed test, - checking setup → call → teardown. - """ - for t in tests: - if t.get("outcome") in ("failed", "error"): - nodeid = t.get("nodeid", "unknown test") - - for phase in ["setup", "call", "teardown"]: - phase_data = t.get(phase) - if phase_data and phase_data.get("outcome") == "failed": - longrepr = phase_data.get("longrepr", "") - if isinstance(longrepr, dict): - message = longrepr.get("reprcrash", {}).get( - "message", str(longrepr) - ) - else: - message = str(longrepr) - - return nodeid, phase, message - - return nodeid, "unknown", "No error details available" - - return None, None, None - - -@cli.command() -@click.option( - "--file", - "report_file", - default=".report.json", - type=click.File("r"), - show_default=True, - help="Path to pytest JSON report file", -) -def parse_pytest_report(report_file): - """Parse pytest JSON report and print summary for CI (GitHub Actions friendly).""" - report = json.load(report_file) - - summary = report.get("summary", {}) - duration = str(datetime.timedelta(seconds=report.get("duration", 0))) - exit_code = report.get("exitcode", 0) - - failed = summary.get("failed", 0) - error = summary.get("error", 0) - passed = summary.get("passed", 0) - skipped = summary.get("skipped", 0) - total = summary.get("total", 0) - - # Header - status = ( - "❌ Test Results - Failed" if failed or error else "✅ Test Results - Success" - ) - click.echo(f"*{status}*") - click.echo() - - # Duration - click.echo(f"*Duration:* {duration}") - click.echo() - - # Summary - click.echo("*Summary:*") - click.echo(f"* *Total:* {total}") - click.echo(f"* *Passed:* {passed}") - click.echo(f"* *Failed:* {failed}") - click.echo(f"* *Error:* {error}") - click.echo(f"* *Skipped:* {skipped}") - click.echo() - - # Failure details - if failed or error: - nodeid, phase, message = _extract_first_failure(report.get("tests", [])) - - click.echo("*Failure Details:*") - click.echo(f"* *Exit code:* `{exit_code}`") - - if nodeid: - click.echo(f"* *First failed test:* `{nodeid}`") - if phase: - click.echo(f"* *Phase:* `{phase}`") - if message: - click.echo(f"* *Error:*\n\n```\n{message}\n```") - - if __name__ == "__main__": cli() diff --git a/plugins/sample_plugin/tests/test_example_plugin.py b/plugins/sample_plugin/tests/test_example_plugin.py index ca7628cef0..c00a01081c 100644 --- a/plugins/sample_plugin/tests/test_example_plugin.py +++ b/plugins/sample_plugin/tests/test_example_plugin.py @@ -9,7 +9,7 @@ class TestExamplePlugin: def test_regular(self): assert True - # example integration test (run daily on CI) + # example integration test (run on CI when a release is published) @pytest.mark.integration async def test_simple(self): assert True