RFC: tracking array API test suite compliance #462
Labels
Deployment
Specification deployment (e.g., to a website).
RFC
Request for comments. Feature requests and proposed changes.
This RFC is a follow-on proposal to #402 and seeks to propose a process for tracking array API test suite compliance.
Overview
Similar to the motivations for #402, currently, consumers of array libraries lack a centralized mechanism for determining whether any given array API passes the array API test suite.
While #402 seeks to statically record which libraries implement which API starting in which version, this proposal seeks to track behavioral compliance vis-a-vis the test suite and do so over time.
And similar to #402, the end goal is to provide a mechanism for publicly displaying test suite compliance so that users have a centralized resource for determining which libraries satisfy behavioral requirements as specified by the array API specification.
Proposal
This RFC proposes the following workflow:
Configure CI: individual projects should configure their CIs with necessary secrets/meta data for reporting their test results.
Test report generation: individual array libraries must run the array API test suite and use pytest-json-report to generate a JSON file containing test results (ref: JSON reporting array-api-tests#131).
Recommendation: run the test suite and generate the JSON output for each release. While array libraries are encouraged to continually test against the array API test suite, explicitly generating the JSON output and sending to the server endpoint on every commit and/or nightly is unnecessary.
Post Results: upon generating a JSON report, individual array libraries must POST the test results to a server hosted under
data-apis.org
(e.g.,dev.data-apis.org/test/results
).Similar to GitHub webhooks, array libraries must generate a hash signature using the unique secret provided to that library. This signature will be used to verify the request payload once received.
The following header fields must be set:
X-Hub-Signature: hash signature.
The JSON object must have the following fields:
numpy
).v1.22.1
).macOS-12.4-x86_64-i386-64bit
, etc)v3.9.9
)2022-06-09T12:47:28Z
).Server Endpoint: the server receiving test results must
If the server endpoint already has test results for a particular version, the server endpoint should discard the previous results and only keep the latest results.
Post-processing: test results must be regularly processed and transformed into a form suitable for public consumption.
The main goal is to have a post-processing step to filter and transform the "raw" test results into a high-level summary which can be consumed by a web application displaying the results.
Processed results could potentially be uploaded to a public repository, if this is deemed useful.
Public Consumption: summarized test results will be displayed on a web page accessible from the array API specification.
Schematically, the workflow is as follows:
Example Workflow
An example GitHub workflow which generates a test suite report for NumPy may be found below.
Considerations
Why do the individual array libraries need to be involved at all? Can't the consortium setup, maintain, and run CI jobs for tracking test suite compliance?
Individual array libraries should be responsible for generating and reporting test suite results because (1) the consortium cannot reasonably be expected to maintain and host CI infrastructure for all current and future array libraries and (2) many individual array libraries are likely to require specialized infrastructure, which they, and they alone, know how to configure, manage, and maintain. Accordingly, individual array libraries are best equipped to generate test results.
As can be observed in the example workflow above, generating and sending a JSON report imposes minimal requirements on individual array libraries which should already be testing against the array API test suite. This RFC proposes that array libraries (1) invoke
pytest
with a--json-report
flag and (2) POST results to an external endpoint.Questions
The text was updated successfully, but these errors were encountered: