Skip to content

Commit

Permalink
Add profile-based tags and add reserved tags section to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
johngrimes committed Aug 27, 2024
1 parent 53a45d9 commit 8af6717
Show file tree
Hide file tree
Showing 21 changed files with 165 additions and 153 deletions.
91 changes: 46 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,8 @@ components of a test case file are:
- **Title** (`title` attribute): A unique, descriptive title for the test object, differentiating
it from others in the same test case.
- **Tags** (`tags` attribute): A list of strings that categorize the test
case into relevant groups. This attribute helps in organizing and
filtering test cases based on their scope or focus. The reserved "core"
tag is considered to represent only required aspects of the
specification, other suites may be used for optional or experimental
aspects.
case into relevant groups. This attribute helps in organizing and
filtering test cases based on their scope or focus. See [Reserved Tags](#reserved-tags).
- **ViewDefinition** (`view` attribute): Specifies the [ViewDefinition][] being
tested. This attribute outlines the expected data view or transformation
applied to the input fixtures.
Expand All @@ -121,53 +118,57 @@ Below is an abstract representation of what a test case file might look like:

```json
{
"title": "title",
"description": "...",
"fhirVersion": [
"5.0.0",
"4.0.1"
],
"resources": [
{
"resourceType": "Patient",
"id": "pt-1"
},
{
"resourceType": "Patient",
"id": "pt-2"
}
],
"tests": [
{
"title": "title of test case",
"tags": [
"core"
],
"view": {
"select": [
{
"column": [
{
"name": "id",
"path": "id"
}
]
}
]
},
"expect": [
"title": "title",
"description": "...",
"fhirVersion": ["5.0.0", "4.0.1"],
"resources": [
{
"id": "pt-1"
"resourceType": "Patient",
"id": "pt-1"
},
{
"id": "pt-2"
"resourceType": "Patient",
"id": "pt-2"
}
]
}
]
],
"tests": [
{
"title": "title of test case",
"tags": ["shareable"],
"view": {
"select": [
{
"column": [
{
"name": "id",
"path": "id"
}
]
}
]
},
"expect": [
{
"id": "pt-1"
},
{
"id": "pt-2"
}
]
}
]
}
```

### Reserved Tags

The following tags are reserved for categorizing test cases based on their
applicability to profiles within the core specification:

- **shareable**: Test cases that validate conformance with the Shareable View Definition profile.
- **tabular**: Test cases that validate conformance with the Tabular View Definition profile.
- **experimental**: Test cases that cover experimental aspects of the specification.

## Implement Test Runner

To ensure comprehensive validation and interoperability, it is recommended for
Expand Down
22 changes: 11 additions & 11 deletions tests/basic.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"tests": [
{
"title": "basic attribute",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"status": "active",
Expand Down Expand Up @@ -61,7 +61,7 @@
},
{
"title": "boolean attribute with false",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"status": "active",
Expand Down Expand Up @@ -99,7 +99,7 @@
},
{
"title": "two columns",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"status": "active",
Expand Down Expand Up @@ -137,7 +137,7 @@
},
{
"title": "two selects with columns",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"status": "active",
Expand Down Expand Up @@ -179,7 +179,7 @@
},
{
"title": "where - 1",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"status": "active",
Expand Down Expand Up @@ -208,7 +208,7 @@
},
{
"title": "where - 2",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"status": "active",
Expand Down Expand Up @@ -237,7 +237,7 @@
},
{
"title": "where returns non-boolean for some cases",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"status": "active",
Expand Down Expand Up @@ -266,7 +266,7 @@
},
{
"title": "where as expr - 1",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"status": "active",
Expand Down Expand Up @@ -295,7 +295,7 @@
},
{
"title": "where as expr - 2",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"status": "active",
Expand Down Expand Up @@ -324,7 +324,7 @@
},
{
"title": "select & column",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"select": [
Expand Down Expand Up @@ -367,7 +367,7 @@
},
{
"title": "column ordering",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"select": [
Expand Down
10 changes: 5 additions & 5 deletions tests/collection.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "collection",
"tags": ["core"],
"tags": ["shareable"],
"description": "TBD",
"fhirVersion": ["5.0.0", "4.0.1", "3.0.2"],
"resources": [
Expand Down Expand Up @@ -47,7 +47,7 @@
"tests": [
{
"title": "fail when 'collection' is not true",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"status": "active",
Expand Down Expand Up @@ -79,7 +79,7 @@
},
{
"title": "collection = true",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"status": "active",
Expand Down Expand Up @@ -122,7 +122,7 @@
},
{
"title": "collection = false relative to forEach parent",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"status": "active",
Expand Down Expand Up @@ -182,7 +182,7 @@
},
{
"title": "collection = false relative to forEachOrNull parent",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"status": "active",
Expand Down
12 changes: 6 additions & 6 deletions tests/combinations.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"tests": [
{
"title": "select",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"select": [
Expand Down Expand Up @@ -52,7 +52,7 @@
},
{
"title": "column + select",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"select": [
Expand Down Expand Up @@ -95,7 +95,7 @@
},
{
"title": "sibling select",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"select": [
Expand Down Expand Up @@ -136,7 +136,7 @@
},
{
"title": "sibling select inside a select",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"select": [
Expand Down Expand Up @@ -181,7 +181,7 @@
},
{
"title": "column + select, with where",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"select": [
Expand Down Expand Up @@ -221,7 +221,7 @@
},
{
"title": "unionAll + forEach + column + select",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"select": [
Expand Down
16 changes: 8 additions & 8 deletions tests/constant.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"tests": [
{
"title": "constant in path",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"status": "active",
Expand Down Expand Up @@ -76,7 +76,7 @@
},
{
"title": "constant in forEach",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"status": "active",
Expand Down Expand Up @@ -107,7 +107,7 @@
},
{
"title": "constant in where element",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"status": "active",
Expand Down Expand Up @@ -142,7 +142,7 @@
},
{
"title": "constant in unionAll",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"status": "active",
Expand Down Expand Up @@ -197,7 +197,7 @@
},
{
"title": "integer constant",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"status": "active",
Expand Down Expand Up @@ -237,7 +237,7 @@
},
{
"title": "boolean constant",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"status": "active",
Expand Down Expand Up @@ -272,7 +272,7 @@
},
{
"title": "accessing an undefined constant",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"status": "active",
Expand All @@ -299,7 +299,7 @@
},
{
"title": "incorrect constant definition",
"tags": ["core"],
"tags": ["shareable"],
"view": {
"resource": "Patient",
"status": "active",
Expand Down
Loading

0 comments on commit 8af6717

Please sign in to comment.