|
14 | 14 | uses: actions/checkout@v4 |
15 | 15 |
|
16 | 16 | - name: Set up Python |
17 | | - uses: actions/setup-python@v4 |
| 17 | + uses: actions/setup-python@v5 |
18 | 18 | with: |
19 | 19 | python-version: '3.11' |
20 | 20 |
|
|
31 | 31 | run: | |
32 | 32 | echo "Testing responses-basic-aoai-v1.py script..." |
33 | 33 |
|
| 34 | + # Verify required environment variables are set |
| 35 | + if [ -z "$AZURE_OPENAI_API_KEY" ] || [ -z "$AZURE_OPENAI_V1_API_ENDPOINT" ] || [ -z "$AZURE_OPENAI_API_MODEL" ]; then |
| 36 | + echo "❌ Error: Required environment variables are not set" |
| 37 | + echo "AZURE_OPENAI_API_KEY: ${AZURE_OPENAI_API_KEY:+set}" |
| 38 | + echo "AZURE_OPENAI_V1_API_ENDPOINT: ${AZURE_OPENAI_V1_API_ENDPOINT:+set}" |
| 39 | + echo "AZURE_OPENAI_API_MODEL: ${AZURE_OPENAI_API_MODEL:+set}" |
| 40 | + exit 1 |
| 41 | + fi |
| 42 | +
|
| 43 | + # Verify jq is available |
| 44 | + if ! command -v jq > /dev/null; then |
| 45 | + echo "❌ Error: jq is not available" |
| 46 | + exit 1 |
| 47 | + fi |
| 48 | +
|
| 49 | + echo "✅ Environment check passed" |
| 50 | +
|
34 | 51 | # Create test results directory |
35 | 52 | mkdir -p test-results |
36 | 53 |
|
|
39 | 56 | echo "Test run timestamp: $timestamp" |
40 | 57 |
|
41 | 58 | # Run the script and capture output |
| 59 | + echo "Running Python script..." |
42 | 60 | python responses-basic-aoai-v1.py > output.txt 2>&1 |
43 | 61 | exit_code=$? |
44 | 62 |
|
@@ -94,6 +112,16 @@ jobs: |
94 | 112 | error_code: $error_code |
95 | 113 | }' > test-results/test-results.json |
96 | 114 |
|
| 115 | + # Also create a human-readable summary |
| 116 | + echo "Azure OpenAI Responses API Test Results" > test-results/test-summary.txt |
| 117 | + echo "========================================" >> test-results/test-summary.txt |
| 118 | + echo "Test Run Date: $timestamp" >> test-results/test-summary.txt |
| 119 | + echo "Result: $pass_fail" >> test-results/test-summary.txt |
| 120 | + echo "Error Code: $error_code" >> test-results/test-summary.txt |
| 121 | + echo "" >> test-results/test-summary.txt |
| 122 | + echo "Output:" >> test-results/test-summary.txt |
| 123 | + echo "$output_text" >> test-results/test-summary.txt |
| 124 | +
|
97 | 125 | # Display final results |
98 | 126 | echo "=== Test Results ===" |
99 | 127 | echo "Timestamp: $timestamp" |
|
0 commit comments