Sandbox integration testing¶
PayBridge's scheduled integration workflow must prove that at least one real sandbox test passed. Missing credentials, a missing result file, failed tests, or a result containing only skipped tests fail the job.
Currently implemented provider suite¶
| Provider input | Test class | Required integration environment secrets |
|---|---|---|
peachpayments |
PeachPaymentsIntegrationTests |
PEACH_ENTITY_ID, PEACH_ACCESS_TOKEN |
paystack (manual) |
PaystackIntegrationTests |
PAYSTACK_SECRET_KEY, PAYSTACK_SUCCESSFUL_TRANSACTION_REFERENCE |
Add the secrets for the selected provider under Settings → Environments → integration → Environment
secrets. They remain scoped to jobs that reference the integration
environment and are not passed to build, reporting, or artifact-upload steps.
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.
For a manual paystack run, use a Paystack test key and the reference of a
completed NGN sandbox payment. See the Paystack walkthrough.
Each run uploads the TRX file and writes a provider summary containing passed, failed, skipped, and total counts. The tested result gate, rather than the test reporting action, owns the final pass/fail decision.
Local gate tests¶
python3 -m unittest scripts/tests/test_integration_test_gate.py
Run the preflight locally without printing credential values:
PEACH_ENTITY_ID="<sandbox-entity>" \
PEACH_ACCESS_TOKEN="<sandbox-token>" \
python3 scripts/integration_test_gate.py plan --gateway peachpayments
Database provider integration¶
The Database Integration workflow runs the repository tests in disposable SQL Server 2022, PostgreSQL 17 and MySQL 8.4 containers. These tests use real connections and cover transaction writes and updates, money and timestamps, duplicate idempotency keys, and concurrent refund reservations.
| Provider | Repository registration | Schema exercised in CI |
|---|---|---|
| SQL Server | SqlServer or MSSQL |
Fresh migration, v1.2.0 upgrade and rollback |
| PostgreSQL | Npgsql, PostgreSQL or Postgres |
Fresh EF Core model |
| MySQL 8.0 or later | MySql |
Fresh EF Core model |
| SQLite | Design-time factory and unit tests | In-memory EF Core model |
The repository migration history targets SQL Server. A passing PostgreSQL or MySQL job confirms the repository works against a fresh schema. Upgrading an existing PostgreSQL or MySQL database requires a provider-specific migration plan. See Upgrade to v2 for backup and rollback guidance.
To reproduce a job locally, set PAYBRIDGE_TEST_DATABASE_PROVIDER and
PAYBRIDGE_TEST_DATABASE_CONNECTION to a disposable instance. Use master
as the SQL Server connection's initial catalog so the tests can create their
own databases. Use an empty database for PostgreSQL or MySQL.
dotnet test PayBridge.SDK.Test/PayBridge.SDK.Test.csproj --filter Category=DatabaseIntegration