Skip to content

Commit 3918eb7

Browse files
Tavern 1.0.3 (#8)
Tavern 1.0.3
1 parent 6f9d04f commit 3918eb7

File tree

4 files changed

+74
-32
lines changed

4 files changed

+74
-32
lines changed

charts/tavern/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: tavern
33
description: "Unofficial Tavern Helm Chart"
44
type: application
5-
version: 0.1.1
5+
version: 0.1.2
66
appVersion: 1.0.3
77
home: "https://tavern.readthedocs.io/en/latest/"
88
icon: "https://tavern.readthedocs.io/en/latest/_static/icon.png"

charts/tavern/README.md

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Jira Software
1+
# Tavern
22

3-
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
4-
5-
The chart is under active development and may contain bugs/unfinished documentation. Any testing/contributions are welcome! :)
3+
![Version: 0.1.2](https://img.shields.io/badge/Version-0.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
64

75
Unofficial Tavern Helm Chart
86

7+
The chart is under active development and may contain bugs/unfinished documentation. Any testing/contributions are welcome! :)
8+
99
**Homepage:** <https://tavern.readthedocs.io/en/latest/>
1010

1111
## Maintainers
@@ -87,6 +87,8 @@ Tavern tests are implemented under the key `$.Values.tests`. Each element of thi
8787

8888
This chart provides the functionality to create templates, which can be rereferenced. The templates allow you to implement go sprig logic and therefor might dramatically improve your tavern test suites.
8989

90+
**NOTE**: While tavern statements use single `{ .. }` I had to replace the go sprig `\{\{ .. }}` as well with single `{ .. }` because of the documenting engine.
91+
9092
### Stage
9193

9294
Tavern Stage templates are defined under the `$.Values.stageTemplates` key. You can define as many templates as you want below this key, just use the following semantic:
@@ -193,23 +195,35 @@ Referencing in a tavern test suite:
193195
## Tavern Test Suites
194196
tests:
195197
196-
# Test Suite without Template
197-
- name: "Base Call"
198-
test:
199-
stages:
200-
request:
201-
method: POST
202-
json:
203-
extraData: "extraValue"
204-
205-
# Single Tavern Stage for Suite
206-
## Will be last stage to be executed
198+
# Single Tavern Stage for Suite using Template
207199
- name: "Product Suite"
200+
template: "testtplname"
208201
values:
209-
enable_base: false
202+
get_products: [ "Shirt", "Shorts", "Socks" ]
210203
test:
211204
stages:
212205
206+
# Overtwrites/Merges with "Base Call" stage from Suite Template
207+
# Merged Stages will be executed at the end of the suite eventhough
208+
# they are the first stage defined in the template
209+
- name: "Base Call"
210+
stage:
211+
request:
212+
method: POST
213+
json:
214+
extraData: "extraValue"
215+
216+
# Single Tavern Stage for Suite (Will be last stage to be executed)
217+
- name: "Test Admin User"
218+
template: "http_get"
219+
values:
220+
endpoint: "user?name=admin"
221+
stage:
222+
response:
223+
status_code:
224+
- 200
225+
- 301
226+
213227
```
214228

215229
# Tavern Concepts

charts/tavern/README.md.gotmpl

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Tavern tests are implemented under the key `$.Values.tests`. Each element of thi
4646

4747
This chart provides the functionality to create templates, which can be rereferenced. The templates allow you to implement go sprig logic and therefor might dramatically improve your tavern test suites.
4848

49-
**NOTE**: While tavern statements use single `{ .. }` I had to replace the go sprig `{{ .. }}` as well with single `{ .. }` because of the documenting engine.
49+
**NOTE**: While tavern statements use single `{ .. }` I had to replace the go sprig `\{\{ .. }}` as well with single `{ .. }` because of the documenting engine.
5050

5151
### Stage
5252

@@ -154,23 +154,35 @@ Referencing in a tavern test suite:
154154
## Tavern Test Suites
155155
tests:
156156

157-
# Test Suite without Template
158-
- name: "Base Call"
159-
test:
160-
stages:
161-
request:
162-
method: POST
163-
json:
164-
extraData: "extraValue"
165-
166-
# Single Tavern Stage for Suite
167-
## Will be last stage to be executed
157+
# Single Tavern Stage for Suite using Template
168158
- name: "Product Suite"
159+
template: "testtplname"
169160
values:
170-
enable_base: false
161+
get_products: [ "Shirt", "Shorts", "Socks" ]
171162
test:
172163
stages:
173164

165+
# Overtwrites/Merges with "Base Call" stage from Suite Template
166+
# Merged Stages will be executed at the end of the suite eventhough
167+
# they are the first stage defined in the template
168+
- name: "Base Call"
169+
stage:
170+
request:
171+
method: POST
172+
json:
173+
extraData: "extraValue"
174+
175+
# Single Tavern Stage for Suite (Will be last stage to be executed)
176+
- name: "Test Admin User"
177+
template: "http_get"
178+
values:
179+
endpoint: "user?name=admin"
180+
stage:
181+
response:
182+
status_code:
183+
- 200
184+
- 301
185+
174186
```
175187

176188
# Tavern Concepts

charts/tavern/examples/advanced.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,24 @@ testTemplates:
112112
## Tavern Test Suites
113113
tests:
114114

115-
# Single Tavern Stage for Suite
116-
## Will be last stage to be executed
115+
# Single Tavern Stage for Suite using Template
116+
- name: "Standalone Suite"
117+
test:
118+
stages:
119+
- name: "Standalone Stage"
120+
request:
121+
url: '{tavern.env_vars.HOST}/home'
122+
method: GET
123+
json:
124+
country: {{ $.Values.common.country }}
125+
headers:
126+
content-type: "application/json"
127+
response:
128+
verify_response_with:
129+
function: "testing_utils:message_says_hello"
130+
131+
132+
# Single Tavern Stage for Suite using Template
117133
- name: "Product Suite"
118134
template: "get_api"
119135
values:

0 commit comments

Comments
 (0)