2222
2323jobs :
2424 openai-python-tests :
25- runs-on : [self-hosted, Linux, ubuntu-desktop]
25+ runs-on : ubuntu-20-04-openai-api-collection-test
2626 steps :
2727 - name : Getting the repo
2828 uses : actions/checkout@v4
@@ -35,35 +35,38 @@ jobs:
3535 with :
3636 node-version : 20
3737
38- - uses : actions/setup-python@v4
39- with :
40- python-version : " 3.10"
41-
42- - run : yarn install && yarn build
38+ - run : npm install -g yarn && yarn install && yarn build
4339 working-directory : ./cortex-js
4440
41+ - name : install python venv
42+ run : |
43+ sudo apt-get update
44+ sudo apt-get install python3-venv -y
45+ python3 -m venv /tmp/jan
46+
4547 - name : Run test
4648 run : |
4749 node cortex-js/dist/src/command.js serve --address 127.0.0.1 --port 4010 > cortex.log & cortex_pid=$!
4850 sleep 3
4951 wget --no-verbose -O api.json http://127.0.0.1:4010/api-json
5052 cat api.json
51-
53+ source /tmp/jan/bin/activate
5254 # Clone openai-api-python repo
5355 git clone https://github.com/openai/openai-python.git -b $OPENAI_API_PYTHON_TAG
5456 cd openai-python
5557
56- pip install -r requirements-dev.lock
57- pip install pytest-reportportal pytest-html
58+ pip3 install -r requirements-dev.lock
59+ pip3 install pytest-reportportal pytest-html
5860
59- mv ../coverage/conftest.py tests/conftest.py
60- mv ../coverage/endpoint_mapping.json tests/endpoints_mapping.json
61- mv ../coverage/pytest.ini pytest.ini
61+ cat ../coverage/conftest.py >> tests/conftest.py
62+ cat ../coverage/endpoint_mapping.json >> tests/endpoints_mapping.json
63+ cat ../coverage/pytest.ini >> pytest.ini
6264 echo "rp_api_key = ${{ secrets.RP_API_KEY }}" >> pytest.ini
6365 echo "rp_endpoint = ${{ secrets.RP_ENDPOINT }}" >> pytest.ini
6466
65- pytest --continue-on-collection-errors -- endpoint "$ENDPOINTS" --reportportal --html=report.html -v || true
67+ pytest --endpoint "$ENDPOINTS" --reportportal --html=report.html -v || true
6668 kill $cortex_pid
69+ deactivate
6770 env :
6871 ENDPOINTS : ${{ github.event.inputs.endpoints }}
6972
0 commit comments