Skip to content

Commit

Permalink
Merge pull request #35 from wklken/fix_221218
Browse files Browse the repository at this point in the history
Fix 221218
  • Loading branch information
wklken authored Dec 18, 2022
2 parents d21b5c8 + 3454e8b commit 906e285
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 4 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: goreleaser

on:
push:
# run only against tags
tags:
- 'v*'

permissions:
contents: write
# packages: write
# issues: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
go-version: '>=1.19.4'
cache: true
# More assembly might be required: Docker logins, GPG, etc. It all depends
# on your needs.
- uses: goreleaser/goreleaser-action@v4
with:
# either 'goreleaser' (default) or 'goreleaser-pro':
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55 changes: 55 additions & 0 deletions docs/Usage/assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,57 @@ Some examples show how to assert the response.

---

## assert basic key-values

```yaml
request:
method: get
url: 'http://httpbin.org/get'
header:
hello: world
assert:
status: ok
status_in:
- ok
status_not_in:
- not found
statusCode: 200
statusCode_in:
- 400
- 500
statusCode_not_in:
- 200
- 400
statusCode_lt: 100
statusCode_lte: 100
statusCode_gt: 500
statusCode_gte: 500
contentLength: 18
contentLength_lt: 1
contentLength_lte: 1
contentLength_gt: 180
contentLength_gte: 180
contentType: abc
contentType_in:
- application/json
contentType_not_in:
- application/json
body: HTTPBIN is awesome
body_contains: awesome2
body_not_contains: awesome
body_startswith: A
body_endswith: a
body_not_startswith: '{'
body_not_endswith: '}'
latency_lt: 0
latency_lte: 0
latency_gt: 100
latency_gte: 100
proto: "HTTP/2.0"
protoMajor: 2
protoMinor: 0
```
## assert header
```yaml
Expand Down Expand Up @@ -204,4 +255,8 @@ request:
url: 'http://www.httpbin.org/get'
assert:
hasRedirect: false
redirectCount_lt: 10
redirectCount_lte: 10
redirectCount_gt: 0
redirectCount_gte: 0
```
2 changes: 1 addition & 1 deletion docs/Usage/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: default
title: Usage
has_children: true
permalink: /usage/
nav_order: 4
nav_order: 5

---

Expand Down
2 changes: 1 addition & 1 deletion docs/about.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: page
title: About
nav_order: 6
nav_order: 7
permalink: /about/
---

Expand Down
2 changes: 1 addition & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: page
title: CHANGELOG
nav_order: 5
nav_order: 6
permalink: /changelog/
---

Expand Down
10 changes: 10 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: page
title: Installation
nav_order: 4
permalink: /installation/
---

# Installation

TODO
46 changes: 46 additions & 0 deletions examples/assert_basic_key_values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
request:
method: get
url: 'http://httpbin.org/get'
header:
hello: world
assert:
status: ok
status_in:
- ok
status_not_in:
- not found
statusCode: 200
statusCode_in:
- 400
- 500
statusCode_not_in:
- 200
- 400
statusCode_lt: 100
statusCode_lte: 100
statusCode_gt: 500
statusCode_gte: 500
contentLength: 18
contentLength_lt: 1
contentLength_lte: 1
contentLength_gt: 180
contentLength_gte: 180
contentType: abc
contentType_in:
- application/json
contentType_not_in:
- application/json
body: HTTPBIN is awesome
body_contains: awesome2
body_not_contains: awesome
body_startswith: A
body_endswith: a
body_not_startswith: '{'
body_not_endswith: '}'
latency_lt: 0
latency_lte: 0
latency_gt: 100
latency_gte: 100
proto: "HTTP/2.0"
protoMajor: 2
protoMinor: 0
1 change: 0 additions & 1 deletion pkg/assertion/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ func DoKeysAssertion(
body []byte,
) (stats util.Stats) {
bodyStr := strings.TrimSuffix(string(body), "\n")
fmt.Println(allKeys.ToString(","))

// NOTE: the order
keyAsserts := []keyAssert{
Expand Down

0 comments on commit 906e285

Please sign in to comment.