forked from microsoft/promptflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testing matrix support for python version 3.9/3.10, linux/mac in ci p…
…ipeline (microsoft#197) # Description Testing matrix support for sdk cli tests, windows still need more time to pass. Bypass some mac tests on Heyi's suggestion. # All Promptflow Contribution checklist: - [x] **The pull request does not introduce [breaking changes]** - [ ] **CHANGELOG is updated for new features, bug fixes or other significant changes.** - [x] **I have read the [contribution guidelines](../CONTRIBUTING.md).** ## General Guidelines and Best Practices - [x] Title of the pull request is clear and informative. - [x] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, [see this page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md). ### Testing Guidelines - [x] Pull request includes test coverage for the included changes.
- Loading branch information
Showing
40 changed files
with
288 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
* @microsoft/prompt-flow-approvers | ||
* @microsoft/prompt-flow-approvers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: step_publish_test_results | ||
inputs: | ||
osVersion: | ||
required: false | ||
default: "ubuntu-latest" | ||
type: string | ||
pythonVersion: | ||
required: false | ||
default: "3.9" | ||
type: string | ||
coverageThreshold: | ||
required: false | ||
default: "0.3" | ||
type: string | ||
token: | ||
description: 'A Github PAT' | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: artifacts | ||
- name: Display and Set Environment Variables | ||
run: env | sort >> $GITHUB_OUTPUT | ||
shell: bash -el {0} | ||
id: display_env | ||
- name: Publish Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
with: | ||
check_name: "Executor Unit Test Result [${{ steps.display_env.outputs.GITHUB_HEAD_REF }}](https://github.com/microsoft/promptflow/actions/workflows/promptflow-executor-unit-test.yml?query=branch:${{ steps.display_env.outputs.GITHUB_HEAD_REF }}++)" | ||
comment_title: "Executor Unit Test Result [${{ steps.display_env.outputs.GITHUB_HEAD_REF }}](https://github.com/microsoft/promptflow/actions/workflows/promptflow-executor-unit-test.yml?query=branch:${{ steps.display_env.outputs.GITHUB_HEAD_REF }}++)" | ||
files: "artifacts/**/test-*.xml" | ||
- name: Generate Coverage Report | ||
uses: orgoro/[email protected] | ||
with: | ||
coverageFile: "artifacts/Test Results (Python ${{ inputs.pythonVersion }}) (OS ${{ inputs.osVersion }})/coverage.xml" | ||
token: ${{ inputs.token }} | ||
thresholdAll: ${{ inputs.coverageThreshold }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ promptflow-tools: | |
- src/promptflow-tools/** | ||
fundamental: | ||
- scripts/** | ||
- .github/** | ||
- .github/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
name: promptflow-executor-e2e-test | ||
on: | ||
schedule: | ||
- cron: "40 20 * * *" # Every day starting at 4:40 BJT | ||
pull_request: | ||
branches: [ main ] | ||
paths: | ||
|
@@ -15,20 +17,31 @@ env: | |
testWorkingDirectory: ${{ github.workspace }}/src/promptflow | ||
jobs: | ||
executor_e2e_tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
- name: Display and Set Environment Variables | ||
run: env | sort >> $GITHUB_OUTPUT | ||
shell: bash -el {0} | ||
run: | | ||
if [ "ubuntu-latest" == "${{ matrix.os }}" ]; then | ||
export pyVersion="3.9"; | ||
elif [ "macos-latest" == "${{ matrix.os }}" ]; then | ||
export pyVersion="3.10"; | ||
else | ||
echo "Unsupported OS: ${{ matrix.os }}"; | ||
exit 1; | ||
fi | ||
env | sort >> $GITHUB_OUTPUT | ||
id: display_env | ||
- name: Conda Setup | ||
shell: bash -el {0} | ||
- name: Conda Setup - ${{ matrix.os }} - Python Version ${{ steps.display_env.outputs.pyVersion }} | ||
uses: "./.github/actions/step_create_conda_environment" | ||
- run: | | ||
echo ${{ env.packageSetupType }} | ||
echo ${{ env.testWorkingDirectory }} | ||
shell: bash -l {0} | ||
with: | ||
pythonVersion: ${{ steps.display_env.outputs.pyVersion }} | ||
- name: Build wheel | ||
uses: "./.github/actions/step_sdk_setup" | ||
with: | ||
|
@@ -42,6 +55,9 @@ jobs: | |
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: Run Coverage Test | ||
shell: bash -l {0} | ||
working-directory: ${{ github.workspace }} | ||
|
@@ -57,29 +73,34 @@ jobs: | |
-t ${{ github.workspace }}/src/promptflow/tests/executor/e2etests \ | ||
-l eastus \ | ||
-m "all" \ | ||
-n 4 \ | ||
-n ${{ steps.cpu-cores.outputs.count }} \ | ||
--coverage-config ${{ github.workspace }}/src/promptflow/tests/executor/.coveragerc | ||
- name: Upload Test Results | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pytest-results | ||
name: Test Results (Python ${{ steps.display_env.outputs.pyVersion }}) (OS ${{ matrix.os }}) | ||
path: | | ||
${{ github.workspace }}/*.xml | ||
${{ github.workspace }}/htmlcov/ | ||
# Use always() to always run this step to publish test results when there are test failures | ||
publish-test-results: | ||
name: "Publish Tests Results" | ||
needs: executor_e2e_tests | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write | ||
pull-requests: write | ||
contents: read | ||
issues: read | ||
if: always() | ||
|
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
- name: Publish Test Results | ||
if: always() | ||
uses: EnricoMi/publish-unit-test-result-action/composite@v2 | ||
with: | ||
check_name: "Executor E2E Test Result [${{ steps.display_env.outputs.GITHUB_HEAD_REF }}](https://github.com/microsoft/promptflow/actions/workflows/promptflow-executor-e2e-test.yml?query=branch:${{ steps.display_env.outputs.GITHUB_HEAD_REF }}++)" | ||
comment_title: "Executor E2E Test Result [${{ steps.display_env.outputs.GITHUB_HEAD_REF }}](https://github.com/microsoft/promptflow/actions/workflows/promptflow-executor-e2e-test.yml?query=branch:${{ steps.display_env.outputs.GITHUB_HEAD_REF }}++)" | ||
files: | | ||
${{ github.workspace }}/test-results.xml | ||
- name: Generate Coverage Report | ||
if: (success() || failure()) | ||
uses: orgoro/[email protected] | ||
uses: "./.github/actions/step_publish_test_results" | ||
with: | ||
coverageFile: ${{ github.workspace }}/coverage.xml | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
thresholdAll: 0.55 | ||
osVersion: ubuntu-latest | ||
pythonVersion: 3.9 | ||
coverageThreshold: 0.55 | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
name: promptflow-executor-unit-test | ||
on: | ||
schedule: | ||
- cron: "40 19 * * *" # Every day starting at 3:40 BJT | ||
pull_request: | ||
branches: [ main ] | ||
paths: | ||
|
@@ -15,20 +17,31 @@ env: | |
testWorkingDirectory: ${{ github.workspace }}/src/promptflow | ||
jobs: | ||
executor_unit_tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
- name: Display and Set Environment Variables | ||
run: env | sort >> $GITHUB_OUTPUT | ||
shell: bash -el {0} | ||
run: | | ||
if [ "ubuntu-latest" == "${{ matrix.os }}" ]; then | ||
export pyVersion="3.9"; | ||
elif [ "macos-latest" == "${{ matrix.os }}" ]; then | ||
export pyVersion="3.10"; | ||
else | ||
echo "Unsupported OS: ${{ matrix.os }}"; | ||
exit 1; | ||
fi | ||
env | sort >> $GITHUB_OUTPUT | ||
id: display_env | ||
- name: Conda Setup | ||
shell: bash -el {0} | ||
- name: Conda Setup - ${{ matrix.os }} - Python Version ${{ steps.display_env.outputs.pyVersion }} | ||
uses: "./.github/actions/step_create_conda_environment" | ||
- run: | | ||
echo ${{ env.packageSetupType }} | ||
echo ${{ env.testWorkingDirectory }} | ||
shell: bash -l {0} | ||
with: | ||
pythonVersion: ${{ steps.display_env.outputs.pyVersion }} | ||
- name: Build wheel | ||
uses: "./.github/actions/step_sdk_setup" | ||
with: | ||
|
@@ -42,6 +55,9 @@ jobs: | |
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: Run Coverage Test | ||
shell: bash -l {0} | ||
working-directory: ${{ github.workspace }} | ||
|
@@ -56,29 +72,34 @@ jobs: | |
-t ${{ github.workspace }}/src/promptflow/tests/executor/unittests \ | ||
-l eastus \ | ||
-m "all" \ | ||
-n 4 \ | ||
-n ${{ steps.cpu-cores.outputs.count }} \ | ||
--coverage-config ${{ github.workspace }}/src/promptflow/tests/executor/.coveragerc | ||
- name: Upload Test Results | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pytest-results | ||
name: Test Results (Python ${{ steps.display_env.outputs.pyVersion }}) (OS ${{ matrix.os }}) | ||
path: | | ||
${{ github.workspace }}/*.xml | ||
${{ github.workspace }}/htmlcov/ | ||
# Use always() to always run this step to publish test results when there are test failures | ||
publish-test-results: | ||
name: "Publish Tests Results" | ||
needs: executor_unit_tests | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write | ||
pull-requests: write | ||
contents: read | ||
issues: read | ||
if: always() | ||
|
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
- name: Publish Test Results | ||
if: always() | ||
uses: EnricoMi/publish-unit-test-result-action/composite@v2 | ||
with: | ||
check_name: "Executor Unit Test Result [${{ steps.display_env.outputs.GITHUB_HEAD_REF }}](https://github.com/microsoft/promptflow/actions/workflows/promptflow-executor-unit-test.yml?query=branch:${{ steps.display_env.outputs.GITHUB_HEAD_REF }}++)" | ||
comment_title: "Executor Unit Test Result [${{ steps.display_env.outputs.GITHUB_HEAD_REF }}](https://github.com/microsoft/promptflow/actions/workflows/promptflow-executor-unit-test.yml?query=branch:${{ steps.display_env.outputs.GITHUB_HEAD_REF }}++)" | ||
files: | | ||
${{ github.workspace }}/test-results.xml | ||
- name: Generate Coverage Report | ||
if: (success() || failure()) | ||
uses: orgoro/[email protected] | ||
uses: "./.github/actions/step_publish_test_results" | ||
with: | ||
coverageFile: ${{ github.workspace }}/coverage.xml | ||
osVersion: ubuntu-latest | ||
pythonVersion: 3.9 | ||
coverageThreshold: 0.3 | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
thresholdAll: 0.3 |
Oops, something went wrong.