Conformance testing is a way of specifying the set of behavior that Spin compliant runtimes must implement. While we refrain from any formal specification (as such an activity at this point would likely be much more work than is worthwhile), conformance testing is the start of the journey in the ultimate goal of clearly defining what a Spin compliant runtime is.
Conformance tests would include assertions on all behaviors that a Spin compliant runtime must exhibit from the perspective of the guest application. Conformance tests do not aim to verify the all around correctness of a runtime, nor do they seek to make assertions about all runtime semantics, but rather they seek to test behaviors that all runtimes must guarantee to a Spin application.
In other words, conformance tests answer the question: what behavior which is visible to a guest Spin application must a runtime provide?
At a high-level, this is a non-exhaustive list of the category of items a conformance test will want to test:
incoming-request
to the HTTP trigger must have a spin-path-info
header set)none
for a key from the key-value
store, then set that key with a value, and then get the key again, I should expect to see the value set.)At a high-level, this is a non-exhaustive list of the category of items a conformance test will not test:
Conformance tests seek to answer the question of what the guest application can rely on. In order to answer this question, a spin.toml must be provided as guest visible capabilities are defined in the spin.toml manifest.
Therefore conformance tests will be composed of the following:
For more information on the conformance test manifest, see the docs here.
The conformance test suite does not provide a way to run the tests by default. Each Spin compliant runtime is different enough in structure that providing a test suite runner that can handle all of them is likely not possible. At the very least, this is out of scope for the near term.
This means each runtime will have to provide their own test runner.
The crates found in the crates
directory provide functionality related to conformance testing:
conformance-tests
: helpers for downloading and running the conformance test suite.test-environment
: a framework for building a conformance test runner using a test environment