diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml index b2cdbcf..6b403c9 100644 --- a/.github/workflows/build-test-lint.yml +++ b/.github/workflows/build-test-lint.yml @@ -43,9 +43,25 @@ jobs: run: python setup.py sdist working-directory: xero-python - # - name: Run Test - # run: | - # source venv/bin/activate - # pip install -r requirements/test.txt - # pytest -v - # working-directory: xero-python + - name: Set up Node environment + uses: actions/setup-node@v2 + with: + node-version: 20 + + - name: Install Prism + run: npm install -g @stoplight/prism-cli + + - name: Start PRISM Server + run: ./start-prism.sh & sleep 15 + working-directory: xero-python/tests/utils + + - name: Run Test + run: | + source venv/bin/activate + pytest -v + working-directory: xero-python + + - name: Stop PRISM + if: success() || failure() + run: pkill -f prism + working-directory: xero-python diff --git a/requirements.txt b/requirements.txt index 7be89c5..f1163e7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # make sure content of this file can be parsed by setup.load_requirements python-dateutil>=2.7 -urllib3>=2.2.3 +urllib3 certifi setuptools>=75.1.0 diff --git a/tests/utils/start-prism.sh b/tests/utils/start-prism.sh index 92b55f1..7a29b94 100755 --- a/tests/utils/start-prism.sh +++ b/tests/utils/start-prism.sh @@ -1,3 +1,5 @@ +#!/bin/bash + prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero_accounting.yaml --host 127.0.0.1 --port 4010 & prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-app-store.yaml --host 127.0.0.1 --port 4011 & prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero_assets.yaml --host 127.0.0.1 --port 4012 &