Skip to content

Require passing sandbox integration tests#112

Merged
teesofttech merged 1 commit into
masterfrom
ci/require-nightly-sandbox-tests
Jul 18, 2026
Merged

Require passing sandbox integration tests#112
teesofttech merged 1 commit into
masterfrom
ci/require-nightly-sandbox-tests

Conversation

@teesofttech

@teesofttech teesofttech commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a credential preflight that fails when the selected sandbox provider is not configured
  • make manual gateway selection an explicit choice and apply an exact provider test filter
  • parse TRX results, publish passed/failed/skipped/total counts by provider, and fail when zero tests pass
  • run the result-gate unit tests in pull-request CI and document integration-environment setup
  • reduce the unconfigured schedule from daily to weekly until sandbox credentials are stable

Root cause

The integration tests use runtime skips when credentials are absent. dotnet test therefore returned success for two skipped Peach Payments tests, and the reporting action was explicitly configured not to fail the workflow. The manual gateway input was also never applied to the test filter.

TDD

Tests were written and observed failing before implementation. The resulting 11-test suite covers unsupported selections, missing secrets, all selection, exact filtering, workflow wiring, TRX counts, xUnit's NotExecuted skip representation, failed tests, and zero-pass runs.

Validation

  • Python gate tests: 11 passed
  • real local skipped-only TRX: correctly summarized as 0 passed / 0 failed / 2 skipped and rejected
  • .NET 8 Release build: 0 warnings, 0 errors
  • .NET tests: 112 passed, 2 skipped sandbox tests, 0 failed
  • both workflow YAML files parsed successfully
  • git diff --check: clean

Repository configuration still required

The GitHub integration environment currently contains no secrets. Add PEACH_ENTITY_ID and PEACH_ACCESS_TOKEN, then manually run the peachpayments workflow and confirm a real create/verify flow before closing #58. Until then, scheduled runs will correctly fail rather than report a false success.

Refs #58

Summary by CodeRabbit

  • New Features

    • Added automated preflight checks for sandbox integration runs, including provider and credential validation.
    • Added integration result summaries with pass, failure, and skipped-test counts.
    • Added manual workflow selection for the available sandbox gateway.
    • Scheduled integration testing now runs weekly.
  • Documentation

    • Added guidance for configuring, running, and validating integration tests locally and in scheduled workflows.
  • Tests

    • Added coverage for provider selection, credential validation, result parsing, and workflow configuration.

Copilot AI review requested due to automatic review settings July 18, 2026 04:00
@teesofttech teesofttech added area: ci/cd GitHub Actions, release automation, and deployment priority: P0 Release blocker or urgent security/correctness risk area: testing Automated test architecture and coverage labels Jul 18, 2026
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a Python integration-test gate, wires provider preflight and TRX validation into GitHub Actions, documents sandbox testing behavior, and adds unit tests covering workflow wiring, provider selection, result parsing, and gating rules.

Changes

Sandbox integration test gating

Layer / File(s) Summary
Gate planning and result validation
scripts/integration_test_gate.py
Defines provider metadata, selects configured providers, parses TRX results, validates pass/fail conditions, writes workflow outputs, and supports plan and summarize commands.
Workflow preflight and result gate
.github/workflows/integration-tests.yml, docs/integration-testing.md
Adds provider dispatch options, weekly scheduling, preflight filtering, TRX artifact enforcement, result gating, and documentation for manual, scheduled, and local execution.
Gate coverage in CI
scripts/tests/test_integration_test_gate.py, .github/workflows/ci-tests.yml
Tests provider selection, secret validation, TRX aggregation, workflow wiring, and gate failure conditions; runs the test module in CI.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related issues

  • PayBridge issue 58 — Covers the integration-workflow preflight, provider filtering, result gating, and per-provider summaries implemented here.

Possibly related PRs

  • teesofttech/PayBridge#53 — Both changes update integration-test workflows and TRX reporting, while this PR adds a Python-based gating mechanism.

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: enforcing passing sandbox integration tests in CI.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/require-nightly-sandbox-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/integration-tests.yml (1)

71-95: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove if: always() to prevent cascading step failures.

Because the Run integration tests step uses continue-on-error: true, its failure will not prevent subsequent steps from running (the step conclusion is treated as success).

However, using if: always() on these post-test steps forces them to run even if an earlier critical step like preflight or Build solution fails. In those scenarios, no .trx files are generated, causing these steps to fail noisily and pollute the workflow logs with "TRX file not found" errors. Removing if: always() allows them to run naturally after test completion (whether tests passed or failed) but correctly skips them if the build or preflight crashed.

♻️ Proposed refactor
       - name: Validate and summarize integration results
-        if: always()
         run: |
           python3 scripts/integration_test_gate.py summarize \
             --provider "${{ steps.preflight.outputs.provider }}" \
             --trx ./TestResults/integration-test-results.trx \
             --github-summary "$GITHUB_STEP_SUMMARY"
 
       - name: Upload integration test results
         uses: actions/upload-artifact@v4
-        if: always()
         with:
           name: integration-test-results
           path: ./TestResults/*.trx
           if-no-files-found: error
 
       - name: Publish test results
         uses: dorny/test-reporter@v1
-        if: always()
         with:
           name: Integration Test Results
           path: ./TestResults/*.trx
           reporter: dotnet-trx
           fail-on-error: false   # the tested result gate above owns job failure
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/integration-tests.yml around lines 71 - 95, Remove the if:
always() conditions from the “Validate and summarize integration results,”
“Upload integration test results,” and “Publish test results” steps in the
workflow. Preserve their normal execution after the integration test step, while
allowing them to be skipped when earlier preflight or build steps fail and no
TRX files exist.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/integration-tests.yml:
- Around line 71-95: Remove the if: always() conditions from the “Validate and
summarize integration results,” “Upload integration test results,” and “Publish
test results” steps in the workflow. Preserve their normal execution after the
integration test step, while allowing them to be skipped when earlier preflight
or build steps fail and no TRX files exist.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ad9f1642-ffd6-4acb-8c43-6b00ac2fa4aa

📥 Commits

Reviewing files that changed from the base of the PR and between 5252bee and 5049bc9.

📒 Files selected for processing (5)
  • .github/workflows/ci-tests.yml
  • .github/workflows/integration-tests.yml
  • docs/integration-testing.md
  • scripts/integration_test_gate.py
  • scripts/tests/test_integration_test_gate.py

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

This PR hardens the scheduled sandbox integration workflow so it cannot report a false “success” when sandbox credentials are missing and all integration tests are skipped, by adding a Python-based preflight + TRX results gate and wiring it into GitHub Actions.

Changes:

  • Added a Python “integration test gate” to (1) validate provider selection and required secrets, and (2) parse TRX results, publish a provider summary, and fail when zero tests pass.
  • Updated the integration workflow to require explicit gateway selection, apply a provider-specific dotnet test filter, upload TRX artifacts reliably, and let the gate decide pass/fail.
  • Added unit tests for the gate and documented integration-environment setup; reduced scheduled frequency from daily to weekly until credentials are stable.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/tests/test_integration_test_gate.py Adds unit tests covering workflow wiring, preflight validation, TRX parsing, and failure conditions.
scripts/integration_test_gate.py Implements provider planning, TRX parsing, job summary generation, and pass/fail gating logic.
docs/integration-testing.md Documents provider suites, required environment secrets, and how to run the gate locally.
.github/workflows/integration-tests.yml Wires preflight + result gate into the scheduled/manual integration workflow and tightens dispatch input/options.
.github/workflows/ci-tests.yml Runs the Python gate unit tests in PR CI.

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

Comment on lines +78 to +79
passed = int(counters.get("passed", "0"))
failed = int(counters.get("failed", "0"))
Comment on lines +17 to +20
Manual runs expose only `all` and providers with implemented sandbox tests.
Selecting one provider applies an exact fully-qualified-name test filter. The
scheduled `all` run executes configured provider suites and fails during
preflight when none are configured.
@teesofttech
teesofttech merged commit a7782a5 into master Jul 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci/cd GitHub Actions, release automation, and deployment area: testing Automated test architecture and coverage priority: P0 Release blocker or urgent security/correctness risk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants