Once the test flow is decided, the YAML test file can be created containing the relevant information. To understand how this works inside the compliance suite, a deep analysis is provided.
As shown in the previous sections, the YAML file consist of multiple endpoint modules to enable real world scenario replication. The YAML file schema and template (present in codebase) can be referred to create it.
Now, the user can run the compliance suite for specific tags. If the user-provided tags match the YAML test tags, the test will be executed.
To ensure the YAML file is valid and information can be parsed from it, two checks are implemented.
- YAML validation - This checks if the file is in proper YAML format and parseable.
- YAML schema validation - This compares the YAML file against the pre-define schema. It ensures that the
- necessary fields like server details, endpoint details, etc are present.
The job info is parsed from the YAML file and sent forward to execute it. It will send request to the server and return a response while storing necessary details in the auxiliary space.
The following checks are implemented on it.
-
If job contains a request body -
- JSON validation - This checks if the request body is in proper JSON format and parseable
- Request body schema validation - The request body is compared against the model to verify its conformance.
-
The response validation includes -
- Status validation - The response HTTP status is validated against the HTTP status defined in the YAML test file
- Logical response validation - The response body is compared against the model to verify its conformance.
- Functional response validation - The response is validated to assess the TES server functionality. It verifies that the cloud features such as S3 storage work as intended. (This feature is in works and will be completed soon)
-
Polling validations - While monitoring the task status in case of Create/Cancel task, the request is polled at the user-provided interval
- Task status validation - It verifies that the returned task status is appropriate depending on whether its Create/Cancel task.
- Timeout - If the polling timeout limit is exceeded, a Timeout Exception is thrown.
-
Filter validations (Optional) - The suite offers an API data validation based on specific API data path and filter conditions.
- The suite will extract the response value from the given data path and validate it against the provided filter conditions.
- If no filtered data is found, then
TestFailureException
is thrown. - Parameters like
type
,value
,regex
andsize
are available. Refer the test schema for details.
Example - The filter parameters are defined as follows in YAML test file.
filter:
- path: $response.name
type: string
value: test_name
size: 9
This response value will be successfully validated against the filter conditions.
{
"name": "test_name",
"id": "test_id"
}
This response value will fail when validated against the filter conditions.
{
"name": "wrong_test_name",
"id": "test_id"
}
After all the YAML tests are completed, the results are compiled. A summary is displayed over the console giving info about the test status and corresponding tests.
A JSON report is published at the end according to the ga4gh-testbed-lib
standards. It contains the phases, tests and cases details.