From 8ea6b8d435dc26ba1a2c513c23540d42fdf952e4 Mon Sep 17 00:00:00 2001 From: Sergio Soares Date: Thu, 12 Dec 2024 23:02:42 -0500 Subject: [PATCH] Update Code Coverage Report and Fix webapp instructions (#36822) * Fix webapp config for code coverage tool This PR fixes the cloud deployment config so we can upload code coverage again. * Update readme with extra instructions * Restyled by prettier-markdown * Attempt to fix misspell CI error * Another attempt. Pyspelling CI checker doesn't like Yufeng's name. * Update title to "Matter SDK Coverage Report" and add SHA * Restyled by shfmt --------- Co-authored-by: Restyled.io --- integrations/appengine/README.md | 40 +++++++++++++++++++++-- integrations/appengine/webapp_config.yaml | 4 +-- scripts/build_coverage.sh | 2 +- 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/integrations/appengine/README.md b/integrations/appengine/README.md index 45ecbe50d585eb..2eea9c1dc21daf 100644 --- a/integrations/appengine/README.md +++ b/integrations/appengine/README.md @@ -1,4 +1,4 @@ -## Deploy Static Website on App Engine +## Deploy Static Website on App Engine for The Matter SDK Coverage Report ### Setup google cloud integration @@ -30,7 +30,43 @@ settings of your App Engine application. Directory `out/coverage/coverage` contains the coverage report files, such as HTML, CSS, images, and JavaScript. +Deploying your generated report: + ``` cd out/coverage/coverage -gcloud app deploy ../../../integrations/appengine/webapp_config.yaml +gcloud app deploy webapp_config.yaml --project matter-build-automation +``` + +The output should look like: + +``` +Services to deploy: + +descriptor: [/usr/local/google/home//connectedhomeip/out/coverage/coverage/webapp_config.yaml] +source: [/usr/local/google/home//connectedhomeip/out/coverage/coverage] +target project: [matter-build-automation] +target service: [default] +target version: [20241212t175429] +target url: [https://matter-build-automation.ue.r.appspot.com] +target service account: [matter-build-automation@appspot.gserviceaccount.com] + + +Do you want to continue (Y/n)? Y + +Beginning deployment of service [default]... +╔════════════════════════════════════════════════════════════╗ +╠═ Uploading 0 files to Google Cloud Storage ═╣ +╚════════════════════════════════════════════════════════════╝ +File upload done. +Updating service [default]...done. +Setting traffic split for service [default]...done. +Deployed service [default] to [https://matter-build-automation.ue.r.appspot.com] + +You can stream logs from the command line by running: + $ gcloud app logs tail -s default + +To view your application in the web browser run: + $ gcloud app browse --project=matter-build-automation ``` + +If you run into permission issues, reach out to a team member from Google. diff --git a/integrations/appengine/webapp_config.yaml b/integrations/appengine/webapp_config.yaml index 839b6aa94d671b..f27ad7d68b8663 100644 --- a/integrations/appengine/webapp_config.yaml +++ b/integrations/appengine/webapp_config.yaml @@ -1,6 +1,4 @@ -runtime: python27 -api_version: 1 -threadsafe: true +runtime: python39 handlers: - url: / static_files: html/index.html diff --git a/scripts/build_coverage.sh b/scripts/build_coverage.sh index 1bb68a2911c525..ef6e7b97051624 100755 --- a/scripts/build_coverage.sh +++ b/scripts/build_coverage.sh @@ -179,7 +179,7 @@ mkdir -p "$COVERAGE_ROOT" lcov --initial --capture --directory "$OUTPUT_ROOT/obj/src" --exclude="$PWD"/zzz_generated/* --exclude="$PWD"/third_party/* --exclude=/usr/include/* --output-file "$COVERAGE_ROOT/lcov_base.info" lcov --capture --directory "$OUTPUT_ROOT/obj/src" --exclude="$PWD"/zzz_generated/* --exclude="$PWD"/third_party/* --exclude=/usr/include/* --output-file "$COVERAGE_ROOT/lcov_test.info" lcov --add-tracefile "$COVERAGE_ROOT/lcov_base.info" --add-tracefile "$COVERAGE_ROOT/lcov_test.info" --output-file "$COVERAGE_ROOT/lcov_final.info" -genhtml "$COVERAGE_ROOT/lcov_final.info" --output-directory "$COVERAGE_ROOT/html" +genhtml "$COVERAGE_ROOT/lcov_final.info" --output-directory "$COVERAGE_ROOT/html" --title "SHA:$(git rev-parse HEAD)" --header-title "Matter SDK Coverage Report" # Copy webapp's YAML file to the coverage output directory cp "$CHIP_ROOT/integrations/appengine/webapp_config.yaml" "$COVERAGE_ROOT/webapp_config.yaml"