Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add update for newly added tolerance field #103

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletions sources/reference/api/experiment.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,15 @@ property which MUST be a valid [JSON Path][jp]. In addition, the object MAY
have a `expect` property which is used to compare each value matched by the JSON
Path to that value. The `expect` property value MUST be a scalar. When the
`expect` property is not present, the `tolerance` succeeds if the JSON Path
matched at least one item.

When the `type` property is `"range"`, the object MUST have a `range`
matched at least one item. Sometimes the json payload values will be dynamic,
e.g. field `status` in response payload may provide any values (either `ok` or
`error` or `info`). Using `expect` field, we can mention only one value as
expected value but sometimes steady state can be met with one or more values.
e.g. you want to define two values either `ok` or `info` as expected value.
In these cases, you can use both `expect` and `expect_one_of` to define both
expected values.
Comment on lines +207 to +208
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still fuzzy about what having the two at the same time achieves. Wouldn't you want one only? Or if you have the two, does one have precedence?


When the `type` property is `"range"`, the object MUST have a `range`
property whuch MUST be a sequence of length two. The first entry of the
sequence MUST be the lower bound and the second entry MUST be the upper bound.
Both entries MUST be JSON numbers.
Expand Down Expand Up @@ -292,6 +298,17 @@ A jsonpath tolerance with an expected value to match:
}
```

A jsonpath tolerance with an one or two expected values to match:

```json
"tolerance": {
"type": "jsonpath",
"path": "$.foo[?(@.baz)].baz",
"expect": [["hello", "bonjour"]],
"expect_one_of": [["hello", "joe"]]
}
```

Two range tolerances:

```json
Expand Down Expand Up @@ -378,7 +395,7 @@ When declared fully, a Probe MUST declare:
* a `name` property
* a `provider` property

The `type` property MUST be the JSON string `"probe"`.
The `type` property MUST be the JSON string `"probe"`.

The `name` property is a free-form JSON string that MAY be considered as an
identifier within the experiment.
Expand Down Expand Up @@ -428,7 +445,7 @@ When declared fully, a Action MUST declare:
* a `provider` property
* a `controls` property

The `type` property MUST be the JSON string `"action"`.
The `type` property MUST be the JSON string `"action"`.

The `name` property is a free-form JSON string that MAY be considered as an
identifier within the experiment.
Expand Down Expand Up @@ -839,7 +856,7 @@ can be undefined and fallback to a default value for the experiment.

### Variable Substitution

Probes and Actions argument values MAY be dynamically resolved at runtime.
Probes and Actions argument values MAY be dynamically resolved at runtime.

Dynamic values MUST follow the syntax `${name}` where `name` is an identifier
declared in either the Configuration or Secrets sections. When `name` is
Expand Down