-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IngestionClient] Unit test coverage as part of the CI/CD pipeline (#…
…2515) * Adding job to upload the test coverage * updating failing test * adding coverlet msbuild package * Moved coverlet to 3rd party section * Dont run e2e tests in coverage * Bump version * New bicep version * Increase version * Using utcNow as a resourceid is non deterministic * az bicep upgrade seems to downgrade bicep * Install if not there, upgrade if it is * Pull Request comments --------- Co-authored-by: Komal Grover <[email protected]> Co-authored-by: Yulin Li <[email protected]>
- Loading branch information
1 parent
d97d53a
commit c808bef
Showing
7 changed files
with
85 additions
and
14 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 |
---|---|---|
|
@@ -4,6 +4,9 @@ on: | |
push: | ||
branches: ['main', 'master', '*'] | ||
paths: ['samples/ingestion/ingestion-client/**', '.github/workflows/ingestion_client.yaml'] | ||
pull_request: | ||
branches: ['main', 'master','*'] | ||
paths: ['samples/ingestion/ingestion-client/**', '.github/workflows/ingestion_client.yaml'] | ||
|
||
jobs: | ||
convert_bicep: | ||
|
@@ -18,8 +21,12 @@ jobs: | |
- name: Install Bicep CLI | ||
run: | | ||
az bicep install | ||
az bicep upgrade | ||
if ! command -v az bicep &> /dev/null; then | ||
az bicep install | ||
else | ||
az bicep upgrade | ||
fi | ||
az bicep version | ||
- name: Convert Bicep to ARM Template | ||
run: | | ||
|
@@ -31,8 +38,55 @@ jobs: | |
echo "Generated ARM template does not match the existing main.json. Please update main.json accordingly." >&2 | ||
exit 1 | ||
fi | ||
build: | ||
test: | ||
runs-on: ubuntu-latest | ||
needs: convert_bicep | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: '8.0.x' | ||
|
||
- name: Install coverlet | ||
run: dotnet tool install --global coverlet.console | ||
|
||
- name: Install reportgenerator | ||
run: dotnet tool install --global dotnet-reportgenerator-globaltool | ||
|
||
- name: Run Unit Tests and Collect Coverage | ||
run: | | ||
dotnet test ./samples/ingestion/ingestion-client/Tests --configuration Release --filter "TestCategory=UnitTest" /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura | ||
reportgenerator -reports:./samples/ingestion/ingestion-client/Tests/**/coverage.cobertura.xml -targetdir:coveragereport -reporttypes:MarkdownSummaryGithub | ||
env: | ||
PATH: $PATH:/home/runner/.dotnet/tools | ||
|
||
- name: Code Coverage Summary Report | ||
uses: irongut/[email protected] | ||
with: | ||
filename: ./samples/ingestion/ingestion-client/Tests/**/coverage.cobertura.xml | ||
badge: true | ||
format: 'markdown' | ||
output: 'both' | ||
|
||
# - name: Add Coverage PR Comment | ||
# uses: marocchino/sticky-pull-request-comment@v2 | ||
# if: github.event_name == 'pull_request' | ||
# with: | ||
# recreate: true | ||
# path: code-coverage-results.md | ||
|
||
- name: Write to Job Summary | ||
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY | ||
|
||
- name: Upload Coverage Report | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage-report | ||
path: coveragereport | ||
|
||
build: | ||
needs: [convert_bicep, test] | ||
runs-on: ubuntu-latest | ||
outputs: | ||
releaseversionoutput: ${{ steps.get_release_versions.outputs.version }} | ||
|
@@ -133,4 +187,4 @@ jobs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./FetchTranscription.zip | ||
asset_name: FetchTranscription.zip | ||
asset_content_type: application/zip | ||
asset_content_type: application/zip |
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 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