-
Notifications
You must be signed in to change notification settings - Fork 97
72 lines (68 loc) · 2.45 KB
/
Copy pathintegration-tests-python.yml
File metadata and controls
72 lines (68 loc) · 2.45 KB
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
70
71
72
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Integration tests for Python
on:
workflow_dispatch:
inputs:
web_pubsub_connection_string:
description: 'Azure Web PubSub Connection String'
required: true
type: string
push:
branches: [ "main" ]
paths:
- 'tests/integration-tests/python/**'
pull_request:
branches: [ "main" ]
paths:
- 'tests/integration-tests/python/**'
permissions:
contents: read
jobs:
test:
name: Integration tests for Python
runs-on: ubuntu-latest
env:
WEB_PUBSUB_CONNECTION_STRING: ${{ github.event.inputs.web_pubsub_connection_string || secrets.WEB_PUBSUB_CONNECTION_STRING }}
strategy:
matrix:
# pytest 9 requires Python 3.10+, and 3.9 is end-of-life.
# Keep this in sync with chat-demo-tests.yml.
python-version: ['3.11']
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Run tests
run: |
cd tests/integration-tests/python
python -m pip install --upgrade pip
pip install -r requirements.txt
pytest
post-test:
runs-on: ubuntu-latest
needs: test
if: failure()
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Download test output
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: test-output
path: ./test-output
- name: Read test output
id: read-test-output
run: echo "TEST_OUTPUT=$(cat ./test-output/test-output.txt)" >> $GITHUB_ENV
- name: Fix error with deep prompt
run: |
node eng/copilot/fixErrorWithDeepPrompt.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
API_KEY: ${{ secrets.OPENAI_API_KEY }}
API_BASE: ${{ secrets.OPENAI_API_BASE }}
PR_ID: ${{ github.event.pull_request.number }}
TEST_OUTPUT: ${{ env.TEST_OUTPUT }}