chore: import upstream snapshot with attribution
tools_continuous_delivery / Private PyPI non-main branch release (push) Has been skipped
tools_continuous_delivery / Private PyPI main branch release (push) Failing after 2m42s
Publish Promptflow Doc / Build (push) Has been cancelled
Publish Promptflow Doc / Deploy (push) Has been cancelled
Flake8 Lint / flake8 (push) Has been cancelled
Spell check CI / Spell_Check (push) Has been cancelled
tools_continuous_delivery / Private PyPI non-main branch release (push) Has been skipped
tools_continuous_delivery / Private PyPI main branch release (push) Failing after 2m42s
Publish Promptflow Doc / Build (push) Has been cancelled
Publish Promptflow Doc / Deploy (push) Has been cancelled
Flake8 Lint / flake8 (push) Has been cancelled
Spell check CI / Spell_Check (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
name: promptflow-tracing-e2e-test
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "40 18 * * *" # 2:40 Beijing Time (GMT+8) every day
|
||||
pull_request:
|
||||
paths:
|
||||
- src/promptflow-tracing/**
|
||||
- .github/workflows/promptflow-tracing-e2e-test.yml
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
IS_IN_CI_PIPELINE: "true"
|
||||
PF_DISABLE_TRACING: "false"
|
||||
WORKING_DIRECTORY: ${{ github.workspace }}/src/promptflow-tracing
|
||||
RECORD_DIRECTORY: ${{ github.workspace }}/src/promptflow-recording
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: snok/install-poetry@v1
|
||||
- name: build
|
||||
run: poetry build
|
||||
working-directory: ${{ env.WORKING_DIRECTORY }}
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: promptflow-tracing
|
||||
path: ${{ env.WORKING_DIRECTORY }}/dist/promptflow_tracing-*.whl
|
||||
|
||||
tracing-e2e-test:
|
||||
needs: build
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-13]
|
||||
python-version: ['3.9', '3.10', '3.11']
|
||||
fail-fast: false
|
||||
# snok/install-poetry need this to support Windows
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: set test mode
|
||||
run: echo "PROMPT_FLOW_TEST_MODE=$(if [[ "${{ github.event_name }}" == "pull_request" ]]; then echo replay; else echo live; fi)" >> $GITHUB_ENV
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- uses: snok/install-poetry@v1
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: promptflow-tracing
|
||||
path: ${{ env.WORKING_DIRECTORY }}
|
||||
- name: install promptflow-tracing from wheel
|
||||
# wildcard expansion (*) does not work in Windows, so leverage python to find and install
|
||||
run: poetry run pip install $(python -c "import glob; print(glob.glob('promptflow_tracing-*.whl')[0])")
|
||||
working-directory: ${{ env.WORKING_DIRECTORY }}
|
||||
- name: install test dependency group
|
||||
run: poetry install --only test
|
||||
working-directory: ${{ env.WORKING_DIRECTORY }}
|
||||
- name: install recording
|
||||
run: poetry install
|
||||
working-directory: ${{ env.RECORD_DIRECTORY }}
|
||||
- name: generate end-to-end test config from secret
|
||||
run: echo '${{ secrets.PF_TRACING_E2E_TEST_CONFIG }}' >> connections.json
|
||||
working-directory: ${{ env.WORKING_DIRECTORY }}
|
||||
- name: run e2e tests
|
||||
run: poetry run pytest -m e2etest --cov=promptflow --cov-config=pyproject.toml --cov-report=term --cov-report=html --cov-report=xml --tb=short
|
||||
working-directory: ${{ env.WORKING_DIRECTORY }}
|
||||
- name: upload coverage report
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: report-${{ matrix.os }}-py${{ matrix.python-version }}
|
||||
path: |
|
||||
${{ env.WORKING_DIRECTORY }}/*.xml
|
||||
${{ env.WORKING_DIRECTORY }}/htmlcov/
|
||||
|
||||
report:
|
||||
needs: tracing-e2e-test
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
checks: write
|
||||
pull-requests: write
|
||||
contents: read
|
||||
issues: read
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: artifacts
|
||||
- uses: EnricoMi/publish-unit-test-result-action@v2
|
||||
with:
|
||||
check_name: promptflow-tracing test result
|
||||
comment_title: promptflow-tracing test result
|
||||
files: "artifacts/**/test-results.xml" # align with `--junit-xml` in pyproject.toml
|
||||
- uses: irongut/CodeCoverageSummary@v1.3.0
|
||||
with:
|
||||
filename: "artifacts/report-ubuntu-latest-py3.9/coverage.xml"
|
||||
badge: true
|
||||
fail_below_min: true
|
||||
format: markdown
|
||||
hide_complexity: true
|
||||
output: both
|
||||
thresholds: 40 80
|
||||
Reference in New Issue
Block a user