|
8 | 8 | jobs: |
9 | 9 | test: |
10 | 10 | runs-on: ubuntu-latest |
| 11 | + env: |
| 12 | + # Expose once at job level because forked PRs can't use secrets.* in `if:` conditions. |
| 13 | + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
| 14 | + |
11 | 15 | steps: |
12 | 16 | #---------------------------------------------- |
13 | 17 | # check-out repo and set-up python |
@@ -54,20 +58,46 @@ jobs: |
54 | 58 | #---------------------------------------------- |
55 | 59 | # run test suite |
56 | 60 | #---------------------------------------------- |
| 61 | + |
| 62 | + # Run tests (with secrets): full suite |
57 | 63 | - name: Run tests |
58 | | - env: |
59 | | - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
| 64 | + if: ${{ env.OPENAI_API_KEY != '' }} |
| 65 | + run: | |
| 66 | + poetry run pytest -vv -rA --maxfail=1 --capture=tee-sys \ |
| 67 | + tests/test_core/ \ |
| 68 | + --ignore=tests/test_core/test_synthesizer/ \ |
| 69 | + --ignore=tests/test_core/test_datasets/ |
| 70 | +
|
| 71 | + # Run tests (no secrets): skip e2e that require API keys |
| 72 | + - name: Run tests (no secrets) |
| 73 | + if: ${{ env.OPENAI_API_KEY == '' }} |
60 | 74 | run: | |
61 | | - poetry run pytest -vv -rA --maxfail=1 --capture=tee-sys tests/test_core/ --ignore=tests/test_core/test_synthesizer/ --ignore=tests/test_core/test_datasets/ --ignore=tests/test_core/test_tracing/test_dataset_iterator.py |
| 75 | + poetry run pytest -vv -rA --maxfail=1 --capture=tee-sys tests/test_core/ \ |
| 76 | + --ignore=tests/test_core/test_synthesizer/ \ |
| 77 | + --ignore=tests/test_core/test_datasets/ \ |
| 78 | + --ignore=tests/test_core/test_tracing/test_dataset_iterator.py \ |
| 79 | + --ignore=tests/test_core/test_evaluation/test_end_to_end/test_configs.py |
62 | 80 |
|
63 | 81 | #---------------------------------------------- |
64 | 82 | # install dev dependencies (including chromadb) and run synthesizer tests |
65 | 83 | #---------------------------------------------- |
66 | 84 | - name: Install dev dependencies |
67 | 85 | run: poetry install --no-interaction --with dev |
68 | 86 |
|
69 | | - - name: Run core tests with dev dependencies |
70 | | - env: |
71 | | - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
| 87 | + # Dev tests (with secrets) |
| 88 | + - name: Run dev tests |
| 89 | + if: ${{ env.OPENAI_API_KEY != '' }} |
| 90 | + run: | |
| 91 | + poetry run pytest -vv -rA --maxfail=1 --capture=tee-sys -o faulthandler_timeout=300 \ |
| 92 | + tests/test_core/test_synthesizer/ tests/test_core/test_datasets/ |
| 93 | +
|
| 94 | + # Dev tests (no secrets) |
| 95 | + - name: Run dev tests (no secrets) |
| 96 | + if: ${{ env.OPENAI_API_KEY == '' }} |
72 | 97 | run: | |
73 | | - poetry run pytest -vv -rA --maxfail=1 --capture=tee-sys tests/test_core/test_synthesizer/ tests/test_core/test_datasets/ --ignore=tests/test_core/test_tracing/test_dataset_iterator.py |
| 98 | + poetry run pytest -vv -rA --maxfail=1 --capture=tee-sys tests/test_core/test_synthesizer/ tests/test_core/test_datasets/ \ |
| 99 | + --ignore=tests/test_core/test_tracing/test_dataset_iterator.py \ |
| 100 | + --ignore=tests/test_core/test_synthesizer/test_context_generator.py \ |
| 101 | + --ignore=tests/test_core/test_synthesizer/test_conversation_simulator.py \ |
| 102 | + --ignore=tests/test_core/test_synthesizer/test_generate_from_goldens.py \ |
| 103 | + --ignore=tests/test_core/test_synthesizer/test_synthesizer.py |
0 commit comments