Skip to content

Commit 7a8f410

Browse files
authored
Merge pull request #163 from XeroAPI/PETOSS-585-Enable-Test-Step-in-Code-Gen-and-SDK-Repos
Petoss 585 enable test step in code gen and sdk repos
2 parents 06e3fa5 + b8eb6d8 commit 7a8f410

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

Diff for: .github/workflows/build-test-lint.yml

+22-6
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,25 @@ jobs:
4343
run: python setup.py sdist
4444
working-directory: xero-python
4545

46-
# - name: Run Test
47-
# run: |
48-
# source venv/bin/activate
49-
# pip install -r requirements/test.txt
50-
# pytest -v
51-
# working-directory: xero-python
46+
- name: Set up Node environment
47+
uses: actions/setup-node@v2
48+
with:
49+
node-version: 20
50+
51+
- name: Install Prism
52+
run: npm install -g @stoplight/prism-cli
53+
54+
- name: Start PRISM Server
55+
run: ./start-prism.sh & sleep 15
56+
working-directory: xero-python/tests/utils
57+
58+
- name: Run Test
59+
run: |
60+
source venv/bin/activate
61+
pytest -v
62+
working-directory: xero-python
63+
64+
- name: Stop PRISM
65+
if: success() || failure()
66+
run: pkill -f prism
67+
working-directory: xero-python

Diff for: requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# make sure content of this file can be parsed by setup.load_requirements
22
python-dateutil>=2.7
3-
urllib3>=2.2.3
3+
urllib3
44
certifi
55
setuptools>=75.1.0

Diff for: tests/utils/start-prism.sh

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/bin/bash
2+
13
prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero_accounting.yaml --host 127.0.0.1 --port 4010 &
24
prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-app-store.yaml --host 127.0.0.1 --port 4011 &
35
prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero_assets.yaml --host 127.0.0.1 --port 4012 &

0 commit comments

Comments
 (0)