Skip to content

Commit

Permalink
Update Code Coverage Report and Fix webapp instructions (#36822)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
soares-sergio and restyled-commits authored Dec 13, 2024
1 parent 728e3e3 commit 8ea6b8d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 6 deletions.
40 changes: 38 additions & 2 deletions integrations/appengine/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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/<user>/connectedhomeip/out/coverage/coverage/webapp_config.yaml]
source: [/usr/local/google/home/<user>/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: [[email protected]]
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.
4 changes: 1 addition & 3 deletions integrations/appengine/webapp_config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
runtime: python27
api_version: 1
threadsafe: true
runtime: python39
handlers:
- url: /
static_files: html/index.html
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 8ea6b8d

Please sign in to comment.