Skip to content

test(func-tests): add functional + live smoke harness for ci API commands#1362

Merged
mergify[bot] merged 1 commit into
mainfrom
devs/sileht/func-tests/add-functional-live-smoke-harness-ci-api-cmds--1ee94f6c
May 6, 2026
Merged

test(func-tests): add functional + live smoke harness for ci API commands#1362
mergify[bot] merged 1 commit into
mainfrom
devs/sileht/func-tests/add-functional-live-smoke-harness-ci-api-cmds--1ee94f6c

Conversation

@sileht
Copy link
Copy Markdown
Member

@sileht sileht commented May 5, 2026

Two new test layers parallel to compat-tests:

  • Mock-based functional tests under func-tests/ that drive the real
    mergify binary against pytest-httpserver and assert request /
    response shape for ci scopes-send (4 cases) and ci junit-process
    (5 cases). Wired into ci-gate via a new func-tests job in
    ci.yaml.

  • Live smoke tests (test_live_smoke.py, marked pytest.mark.live)
    that hit the real Mergify API at
    mergify-clients-testing/mergify-cli-repo PR build(deps): Bump rich from 10.2.0 to 10.2.1 #1. Skipped unless
    LIVE_TEST_MERGIFY_TOKEN is set; driven by a dedicated
    func-tests-live workflow on a nightly cron + manual dispatch, NOT
    wired into ci-gate. Catches the class of mock drift schema-level
    checks miss — real auth, real serialization, response shape.

The mock layer keeps the PR feedback loop fast and offline-safe; the
live layer is a canary for "the mock has lied about the wire
contract." The live workflow runs in a dedicated func-tests-live
GitHub Environment so the staging-tenant secret can be rotated and
audited independently.

Adds pytest-httpserver==1.1.3 to dev deps and a live pytest marker.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Copilot AI review requested due to automatic review settings May 5, 2026 13:44
@sileht
Copy link
Copy Markdown
Member Author

sileht commented May 5, 2026

This pull request is part of a Mergify stack:

# Pull Request Link
1 test(func-tests): add functional + live smoke harness for ci API commands #1362 👈

@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 5, 2026 13:45 Failure
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 5, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success=ci-gate

🟢 👀 Review Requirements

Wonderful, this rule succeeded.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?:

🟢 🔎 Reviews

Wonderful, this rule succeeded.
  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new functional-test harness that exercises the installed mergify binary end-to-end against a local mock HTTP server, plus a separate “live” smoke layer that hits the real Mergify API on a scheduled workflow to catch mock drift.

Changes:

  • Add func-tests/ suite using pytest-httpserver to validate ci scopes-send and ci junit-process wire behavior via subprocess execution of the real CLI binary.
  • Add a nightly/manual func-tests-live workflow running pytest -m live against the real API when a token is available; add a live pytest marker.
  • Wire functional tests into PR CI via a new func-tests job and add pytest-httpserver to dev dependencies / lockfiles.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
uv.lock Adds pytest-httpserver and its transitive deps (werkzeug, markupsafe) to the locked dev set.
pyproject.toml Adds pytest-httpserver dev dep, registers live marker, and ruff per-file ignores for func-tests/.
poe.toml Adds poe func-test and poe live-test task entry points.
func-tests/conftest.py Introduces subprocess-based CLI runner fixtures and environment scrubbing; adds live_token fixture.
func-tests/test_scopes_send.py Functional tests for Rust-native ci scopes-send against a mock HTTP server.
func-tests/test_junit_process.py Functional tests for ci junit-process/junit-upload via mock server expectations.
func-tests/test_live_smoke.py Live smoke tests (marked live) targeting real API endpoints.
func-tests/README.md Documents the new functional + live test layers and how to run them.
func-tests/fixtures/junit_pass.xml Passing JUnit fixture for functional/live runs.
func-tests/fixtures/junit_fail.xml Failing JUnit fixture for quarantine-path functional testing.
.github/workflows/func-tests-live.yaml Adds scheduled/manual workflow to run live smoke tests using an environment-scoped secret.
.github/workflows/ci.yaml Adds func-tests job to the PR CI gate.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread func-tests/test_junit_process.py Outdated
Comment thread func-tests/test_junit_process.py Outdated
Comment thread func-tests/conftest.py
Comment thread func-tests/test_junit_process.py Outdated
@sileht sileht force-pushed the devs/sileht/func-tests/add-functional-live-smoke-harness-ci-api-cmds--1ee94f6c branch from bf4ce3f to 949f0c2 Compare May 5, 2026 13:55
@sileht
Copy link
Copy Markdown
Member Author

sileht commented May 5, 2026

Revision history

# Type Changes Reason Date
1 initial bf4ce3f 2026-05-05 13:55 UTC
2 content bf4ce3f → 949f0c2 (raw) 2026-05-05 13:55 UTC
3 content 949f0c2 → e9507cf (raw) 2026-05-05 15:08 UTC
4 content e9507cf → 828db85 (raw) 2026-05-05 15:09 UTC
5 content 828db85 → ed1af72 (raw) 2026-05-05 17:23 UTC
6 content ed1af72 → e5975fa (raw) 2026-05-05 17:25 UTC

@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 5, 2026 13:55 Failure
@mergify mergify Bot requested a review from a team May 5, 2026 14:07
@sileht sileht marked this pull request as ready for review May 5, 2026 14:11
Comment thread .github/workflows/func-tests-live.yaml Outdated
@mergify mergify Bot requested a review from a team May 5, 2026 14:52
@sileht sileht force-pushed the devs/sileht/func-tests/add-functional-live-smoke-harness-ci-api-cmds--1ee94f6c branch from 949f0c2 to e9507cf Compare May 5, 2026 15:07
@sileht sileht had a problem deploying to func-tests-live May 5, 2026 15:08 — with GitHub Actions Failure
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 5, 2026 15:08 Failure
@sileht sileht force-pushed the devs/sileht/func-tests/add-functional-live-smoke-harness-ci-api-cmds--1ee94f6c branch from e9507cf to 828db85 Compare May 5, 2026 15:09
@sileht sileht had a problem deploying to func-tests-live May 5, 2026 15:09 — with GitHub Actions Failure
@sileht sileht had a problem deploying to func-tests-live May 5, 2026 15:09 — with GitHub Actions Failure
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 5, 2026 15:09 Failure
@sileht sileht had a problem deploying to func-tests-live May 5, 2026 16:02 — with GitHub Actions Failure
@sileht sileht had a problem deploying to func-tests-live May 5, 2026 17:16 — with GitHub Actions Failure
@sileht sileht force-pushed the devs/sileht/func-tests/add-functional-live-smoke-harness-ci-api-cmds--1ee94f6c branch from 828db85 to ed1af72 Compare May 5, 2026 17:23
@sileht sileht had a problem deploying to func-tests-live May 5, 2026 17:23 — with GitHub Actions Failure
@sileht sileht had a problem deploying to func-tests-live May 5, 2026 17:23 — with GitHub Actions Failure
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 5, 2026 17:23 Failure
Three smoke tests under func-tests/ that drive the real `mergify`
binary against the real Mergify API, gated on
LIVE_TEST_MERGIFY_TOKEN:

- `ci scopes-send` — POST /v1/repos/{owner}/{repo}/pulls/{n}/scopes
- `ci junit-process` — OTLP traces upload + quarantine check
- `config simulate` — POST /v1/repos/{owner}/{repo}/pulls/{n}/simulator

Each fires when the real API's URL, auth, or wire format diverges
from what the CLI expects. Asserts only "endpoint exists, accepts
our payload, returns 2xx" — never response content, since the
test tenant's state is not under test control.

Driven by `.github/workflows/func-tests-live.yaml` on a nightly
cron + manual dispatch against
mergify-clients-testing/mergify-cli-repo PR #1. Runs in a
dedicated `func-tests-live` GitHub Environment so the
LIVE_TEST_MERGIFY_TOKEN secret can be rotated and audited
independently. NOT wired into the PR ci-gate — an upstream blip
cannot block PRs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Change-Id: I1ee94f6c9e1d6ac7d4ad22fe07b98860ecec12e9
@sileht sileht force-pushed the devs/sileht/func-tests/add-functional-live-smoke-harness-ci-api-cmds--1ee94f6c branch from ed1af72 to e5975fa Compare May 5, 2026 17:25
@sileht sileht had a problem deploying to func-tests-live May 5, 2026 17:25 — with GitHub Actions Failure
@sileht sileht had a problem deploying to func-tests-live May 5, 2026 17:25 — with GitHub Actions Failure
@mergify mergify Bot deployed to Mergify Merge Protections May 5, 2026 17:25 Active
@sileht sileht had a problem deploying to func-tests-live May 5, 2026 18:26 — with GitHub Actions Failure
@sileht sileht temporarily deployed to func-tests-live May 5, 2026 18:34 — with GitHub Actions Inactive
@mergify mergify Bot requested a review from a team May 5, 2026 20:03
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 6, 2026

Merge Queue Status

This pull request spent 11 minutes 17 seconds in the queue, including 10 minutes 59 seconds running CI.

Waiting for:
  • check-success=ci-gate
All conditions

Reason

The merge conditions cannot be satisfied due to failing checks

Failing checks:

Hint

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

mergify Bot added a commit that referenced this pull request May 6, 2026
@sileht
Copy link
Copy Markdown
Member Author

sileht commented May 6, 2026

@Mergifyio queue

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 6, 2026

Merge Queue Status

This pull request spent 11 minutes 51 seconds in the queue, including 11 minutes 1 second running CI.

Required conditions to merge

@mergify mergify Bot added the queued label May 6, 2026
mergify Bot added a commit that referenced this pull request May 6, 2026
@mergify mergify Bot removed the dequeued label May 6, 2026
mergify Bot added a commit that referenced this pull request May 6, 2026
@mergify mergify Bot merged commit fa71a72 into main May 6, 2026
35 of 38 checks passed
@mergify mergify Bot deleted the devs/sileht/func-tests/add-functional-live-smoke-harness-ci-api-cmds--1ee94f6c branch May 6, 2026 08:39
@mergify mergify Bot removed the queued label May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants