File tree 4 files changed +26
-5
lines changed
4 files changed +26
-5
lines changed Original file line number Diff line number Diff line change @@ -17,10 +17,18 @@ jobs:
17
17
# Start the API in the background
18
18
- run : python apps/python/app.py &
19
19
20
- - name : TEST
20
+ - name : Default test
21
21
uses : ./
22
- continue-on-error : true
23
22
with :
24
23
schema : ' http://127.0.0.1:5001/openapi.json'
25
24
token : ${{ secrets.SCHEMATHESIS_TOKEN }}
26
25
args : ' -E success'
26
+
27
+ - name : Custom hooks
28
+ uses : ./
29
+ with :
30
+ schema : ' http://127.0.0.1:5001/openapi.json'
31
+ token : ${{ secrets.SCHEMATHESIS_TOKEN }}
32
+ version : ' 3.18.5'
33
+ hooks : ' apps.python.hooks'
34
+ args : ' -c custom_check -E success'
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Minimal:
11
11
- uses : schemathesis/action@v1
12
12
with :
13
13
# API schema location
14
- schema : ' http ://127.0.0.1:5001 /openapi.json'
14
+ schema : ' https ://example.schemathesis.io /openapi.json'
15
15
` ` `
16
16
17
17
All options:
@@ -20,11 +20,11 @@ All options:
20
20
- uses : schemathesis/action@v1
21
21
with :
22
22
# API schema location
23
- schema : ' http ://127.0.0.1:5001 /openapi.json'
23
+ schema : ' https ://example.schemathesis.io /openapi.json'
24
24
# OPTIONAL. URL that will be used as a prefix for all API operations.
25
25
# Required if the schema is provided as a file.
26
26
# Otherwise, inferred from the schema.
27
- base-url : ' http ://127.0.0.1:5001 /v2/'
27
+ base-url : ' https ://example.schemathesis.io /v2/'
28
28
# OPTIONAL. Your Schemathesis.io token
29
29
token : ${{ secrets.SCHEMATHESIS_TOKEN }}
30
30
# OPTIONAL. API name from Schemathesis.io
@@ -41,6 +41,8 @@ All options:
41
41
# OPTIONAL. Specify which version of Schemathesis should be used.
42
42
# Defaults to `latest`
43
43
version : ' latest'
44
+ # OPTIONAL. Schemathesis hooks module. Available for Schemathesis >= 3.18.5 only
45
+ hooks : ' tests.hooks'
44
46
# OPTIONAL. Extra arguments to pass to Schemathesis
45
47
args : ' -D negative'
46
48
` ` `
Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ inputs:
37
37
description : ' Specify which version of Schemathesis should be used. Defaults to `latest`'
38
38
required : false
39
39
default : " latest"
40
+ hooks :
41
+ description : ' Schemathesis hooks module'
42
+ required : false
40
43
args :
41
44
description : ' Extra arguments to pass to Schemathesis'
42
45
required : false
71
74
SCHEMATHESIS_REPORT: ${{ inputs.report }}
72
75
SCHEMATHESIS_WAIT_FOR_SCHEMA: ${{ inputs.wait-for-schema }}
73
76
SCHEMATHESIS_TOKEN: ${{ inputs.token }}
77
+ SCHEMATHESIS_HOOKS: ${{ inputs.hooks }}
74
78
SCHEMATHESIS_ACTION_REF: ${{ github.action_ref }}
Original file line number Diff line number Diff line change
1
+ import schemathesis
2
+
3
+
4
+ @schemathesis .check
5
+ def custom_check (response , case ):
6
+ # Always succeeds
7
+ return None
You can’t perform that action at this time.
0 commit comments