-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (55 loc) · 2.13 KB
/
pull-request-consumer-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
name: Pull request consumer contract tests on review app
on: # yamllint disable-line rule:truthy
pull_request:
branches:
- master
jobs:
functional-tests:
name: Pull request consumer contract tests
runs-on: ubuntu-latest
steps:
- name: Check out contract repo
uses: actions/checkout@v2
with:
repository: agilepathway/available-pets-consumer-contract
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install Prism
run: npm install -g @stoplight/prism-cli
- name: Install Gauge
uses: getgauge/setup-gauge@master
with:
gauge-version: master
gauge-plugins: python, html-report, screenshot
- name: Verify Review App status
id: review_app_status
uses: niteoweb/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Start Prism in validation proxy mode
run: prism proxy openapi.yaml ${{ steps.review_app_status.outputs.review_app_url }}/v2 --errors &
- name: Run contract specs against Prism validation proxy
env:
OPENAPI_HOST: http://127.0.0.1:4010
run: gauge run specs
- name: Run contract specs against provider
# It is not sufficient to just run the specs using Prism as a validation proxy, as Prism does not error
# when the server returns a 501 not implemented response (see https://github.com/stoplightio/prism/issues/1963)
env:
# Env var is temporary workaround for https://github.com/getgauge/gauge-python/issues/256
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python
OPENAPI_HOST: ${{ steps.review_app_status.outputs.review_app_url }}/v2
run: gauge run specs
- name: Upload Gauge test report
uses: actions/upload-artifact@v2
if: always()
with:
name: gauge-html-report
path: reports/html-report/