|
3 | 3 | The Reporting API is a beta, bespoke offering served ONLY from production |
4 | 4 | (connect.squareup.com/reporting) -- it is not routed on sandbox (which 404s), |
5 | 5 | and a sandbox token 401s against prod. Validating it live therefore needs a |
6 | | -production, reporting-provisioned ``TEST_SQUARE_TOKEN``. CI's token is |
7 | | -sandbox-only, so this suite is gated behind ``TEST_SQUARE_REPORTING`` and skips |
8 | | -by default, keeping CI green. The endpoints exercised are read-only (schema |
| 6 | +production, reporting-provisioned access token. CI's regular ``TEST_SQUARE_TOKEN`` |
| 7 | +is sandbox-only, so this suite is gated behind ``TEST_SQUARE_REPORTING`` -- which |
| 8 | +is itself the prod, reporting-provisioned token -- and skips by default when it is |
| 9 | +unset, keeping CI green. The endpoints exercised are read-only (schema |
9 | 10 | discovery + queries). The polling *logic* is covered without a live account in |
10 | 11 | ``test_reporting_helper.py``. |
11 | 12 |
|
12 | 13 | Run it against a real prod account: |
13 | 14 |
|
14 | | - TEST_SQUARE_REPORTING=1 TEST_SQUARE_TOKEN=<prod-access-token> \ |
| 15 | + TEST_SQUARE_REPORTING=<prod-reporting-token> \ |
15 | 16 | poetry run pytest tests/integration/test_reporting.py |
16 | 17 | # Override the host with TEST_SQUARE_BASE_URL=<url> if reporting moves. |
17 | 18 | """ |
|
26 | 27 |
|
27 | 28 | pytestmark = pytest.mark.skipif( |
28 | 29 | not os.getenv("TEST_SQUARE_REPORTING"), |
29 | | - reason="Set TEST_SQUARE_REPORTING to run the live Reporting API suite (needs a prod, reporting-provisioned token).", |
| 30 | + reason="Set TEST_SQUARE_REPORTING to a prod, reporting-provisioned token to run the live Reporting API suite.", |
30 | 31 | ) |
31 | 32 |
|
32 | 33 |
|
33 | 34 | def reporting_client() -> Square: |
34 | | - token = os.getenv("TEST_SQUARE_TOKEN") |
| 35 | + token = os.getenv("TEST_SQUARE_REPORTING") |
35 | 36 | if not token: |
36 | | - raise RuntimeError("TEST_SQUARE_TOKEN must be set to run the reporting integration suite.") |
| 37 | + raise RuntimeError("TEST_SQUARE_REPORTING must be set to a prod, reporting-provisioned token to run the reporting integration suite.") |
37 | 38 | # Reporting only exists on production; allow overriding the host via TEST_SQUARE_BASE_URL. |
38 | 39 | base_url = os.getenv("TEST_SQUARE_BASE_URL") |
39 | 40 | if base_url: |
|
0 commit comments