Validate network connectivity, protocol conformance and business results separately.
Validate network connectivity, protocol conformance and business results separately. Record the endpoint name and path, request ID, HTTP status, organization and date for each test. Do not log complete tokens or original user content.
End-to-end acceptance must also verify that model calls use the same external identity, the enterprise model enforces limits, statistics refresh publishes a new date, and pages, exports and member trends match enterprise data. Fixed examples from a mock provider do not prove actual metering or quota enforcement.
Return a non-200 HTTP status and JSON on failure. Do not hide business failures in error fields inside an HTTP 200 response.
retryable and Retry-After do not guarantee an immediate SDK retry. Background refresh and quota dispatch manage retries separately. Client pages receive errors mapped by the QwenWork service, which may differ from the original enterprise service code. Correlate service logs using the request ID.
A delivery-ready test record should include:
Eight-endpoint acceptance checklist
| Endpoint | Successful cases | Required boundary cases |
|---|---|---|
| Get latest statistics date | Complete data date and ds=null | Do not publish incomplete dates |
| Query organization usage overview | Five periods, organization totals and daily trends | Preserve null balances; detect incorrect organizations, dates and totals |
| Query member usage list | All pages, sorting, filtering and actual bound users | More than 200 members, empty results, tied sort values, duplicates and omissions |
| Query member daily usage trend | Consecutive daily values for the current user | days=1/30, encoded user IDs and expired dates |
| Query quota rules and period | Current period, minimum and maximum limits | Period boundaries and unknown upper limits; preserve the product minimum of 500 |
| Query member quotas | Applied, unconfigured and not-found states | Response order and count, null values and the actual applied revision |
| Set member limit | A 500-credit limit for one user with a complete acknowledgement | Duplicate requests, retry after a lost response and mismatched acknowledgement fields; do not add to the limit or reset usage |
| Query organization quota | Real-time organization total and usage | Usage exceeding the total, organization mismatch and an error for unknown quotas |
| Common behavior | Valid credentials, organization and JSON | 401/403, invalid parameters, timeout, non-JSON content, oversized responses and redirects |
Error handling
Return a non-200 HTTP status and JSON on failure. Do not hide business failures in error fields inside an HTTP 200 response.
| HTTP | Example code | What to check |
|---|---|---|
| 400 / 422 | invalid_argument / unsupported_period | Parameters, field types and period; correct the request first |
| 401 / 403 | unauthenticated / forbidden | Token and organization authorization; do not hide failures with empty data |
| 404 | member_not_found / snapshot_not_found | Whether the member or historical data exists and the endpoint is implemented |
| 409 | snapshot_not_ready | Whether the complete data is ready; QwenWork retains the previous snapshot |
| 429 | rate_limited | Rate-limit budget; Retry-After may be returned |
| 500 / 502 / 503 / 504 | upstream_unavailable | Enterprise dependencies, network and timeouts; recover within the host's existing retry budget |
Diagnose by symptom
| Symptom | Check first | Interpretation |
|---|---|---|
| Local curl succeeds but the console connectivity check fails | DNS, ports, certificates, routes and IP SAN from the Biz network | Local connectivity does not prove Biz connectivity |
| Connectivity succeeds but statistics still fail | Latest-date JSON, all five periods of organization and member usage, all pages and identity bindings | The check only verifies HTTP 200 from Get latest statistics date; it does not parse the response |
| Organization quota fails while other endpoints work | Whether Query organization quota is implemented and returns string amounts and the correct organization | A 404 from this endpoint does not mean the extension is disabled |
| HTTP 200 produces a protocol error | A data wrapper, nulls, dates, JSON types and required fields | HTTP success does not prove contract conformance |
| Quota appears off by a factor of 10000 | Quota amounts must be minor-unit strings; statistics must be credit numbers | "5000000" in a quota endpoint represents 500 credits |
| Setting a member limit keeps retrying | Exact match of user, binding, revision, amount, validity and period in the acknowledgement | Echoing desired_revision alone is insufficient |
| Statistics contain only the first 200 members or the whole batch fails | page_no, has_more, total, non-final page length and duplicate IDs | Read all pages with stable pagination |
| Organization and member totals differ | Five-period boundaries, totals across all pages, cycle_used_credits and period usage | Use the same measurement rules for one ds |
| Switching providers or changing sample data does not update the page | Whether the source date is later than the locally published date | Snapshots for the same date are immutable and are not overwritten |
| An unknown balance appears as 0 | Nullable balance or reset date replaced with a default | Use null for unknown statistics; return an error for an unknown organization quota |
| Reusing the old token after an address change fails | Whether the new service accepts the credential and organization authorization matches | The console permits reuse but does not guarantee that the new service accepts it |
Complete integration test record
A delivery-ready test record should include:
- QwenWork installation version, provider version, protocol version and test date.
- Results for all eight endpoints, related request IDs and response validation results.
- Test organization and user bindings, period boundaries, unit conversions and retry cases.
- Source ds and published QwenWork ds, with organization and member totals reconciled.
- Actual model consumption and quota enforcement results from the enterprise model.