Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
crazygao committed Nov 30, 2023
1 parent 917654c commit 232957e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 37 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/promptflow-executor-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ jobs:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- 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
- name: checkout
uses: actions/checkout@v4
- name: Python Setup - ${{ matrix.os }} - Python Version 3.9
Expand Down
53 changes: 16 additions & 37 deletions .github/workflows/promptflow-executor-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: promptflow-executor-unit-test
on:
schedule:
- cron: "40 19 * * *" # Every day starting at 3:40 BJT
pull_request_target:
pull_request:
paths:
- src/promptflow/**
- scripts/building/**
Expand All @@ -14,28 +14,13 @@ env:
PYTHONPATH: ${{ github.workspace }}/src/promptflow
IS_IN_CI_PIPELINE: "true"
jobs:
authorize:
environment:
# forked prs from pull_request_target will be run in external environment, domain prs will be run in internal environment
${{ github.event_name == 'pull_request_target' &&
github.event.pull_request.head.repo.full_name != github.repository &&
'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: true
build:
needs: authorize
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
fetch-depth: 0
- name: merge main to current branch
uses: "./.github/actions/step_merge_main"
- name: Display and Set Environment Variables
run: |
env | sort >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -66,13 +51,10 @@ jobs:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- 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
- name: checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
fetch-depth: 0
- name: merge main to current branch
uses: "./.github/actions/step_merge_main"
- name: Display and Set Environment Variables
run: |
env | sort >> $GITHUB_OUTPUT
Expand All @@ -96,30 +78,32 @@ jobs:
gci ./promptflow -Recurse | % {if ($_.Name.Contains('.whl')) {python -m pip install "$($_.FullName)"}}
gci ./promptflow-tools -Recurse | % {if ($_.Name.Contains('.whl')) {python -m pip install $_.FullName}}
pip freeze
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Generate Configs
- name: Azure login (non pull_request workflow)
if: github.event_name != 'pull_request'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: generate live test resources (non pull_request workflow)
if: github.event_name != 'pull_request'
uses: "./.github/actions/step_generate_configs"
with:
targetFolder: ${{ env.testWorkingDirectory }}
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- name: generate live test resources (pull_request workflow)
if: github.event_name == 'pull_request'
shell: pwsh
working-directory: ${{ env.testWorkingDirectory }}
run: |
cp ${{ github.workspace }}/src/promptflow/dev-connections.json.example ${{ github.workspace }}/src/promptflow/connections.json
- name: Run Coverage Test
shell: pwsh
working-directory: ${{ github.workspace }}
run: |
gci env:* | sort-object name
az account show
pip install langchain
python scripts/building/run_coverage_tests.py `
-p ${{ env.testWorkingDirectory }}/promptflow `
-t ${{ env.testWorkingDirectory }}/tests/executor/unittests `
-l eastus `
-m "all" `
-n ${{ steps.cpu-cores.outputs.count }} `
--coverage-config ${{ env.testWorkingDirectory }}/tests/executor/.coveragerc `
--disable-cov-branch
- name: Upload Test Results
Expand All @@ -140,11 +124,6 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
fetch-depth: 0
- name: merge main to current branch
uses: "./.github/actions/step_merge_main"
- name: Publish Test Results
uses: "./.github/actions/step_publish_test_results"
with:
Expand Down

0 comments on commit 232957e

Please sign in to comment.