Skip to content

Commit 6139d98

Browse files
Add example conformance report tool (#36913)
* Add example conformance report tool * Integrate report into app engine * Restyled by isort * fix lint errors * Add more targets * Restyled by isort * Add python build to startup script * Update readme for the compute_engine VM * fix spelling * spelling * Restyled by prettier-markdown * limit ninja_jobs to cpu_count() - 2 * Fix typo; group cmds in the script * Improved comments on find_executables(dirs) --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 84399bd commit 6139d98

File tree

4 files changed

+448
-29
lines changed

4 files changed

+448
-29
lines changed

integrations/appengine/webapp_config.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ handlers:
33
- url: /
44
static_files: html/index.html
55
upload: html/index.html
6+
- url: /conformance/
7+
static_files: html/conformance_report.html
8+
upload: html/conformance_report.html
69
- url: /(.*)
710
static_files: html/\1
811
upload: html/(.*)

integrations/compute_engine/README.md

+33-29
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,33 @@
1-
## Startup Script of Compute Engine
2-
3-
A startup script is a file that contains commands that run when a virtual
4-
machine instance boots. Compute Engine provides support for running startup
5-
scripts on Linux and Windows virtual machines.
6-
7-
### Create a virtual machine instance using startup script
8-
9-
The `startup-script.sh` could be used as the startup script of a virtual machine
10-
instance which run Matter coverage report and publish the result via an App
11-
Engine service.
12-
13-
You can create a virtual machine instance by using the gcloud compute instances
14-
create command with the `--metadata-from-file` flag.
15-
16-
```
17-
gcloud compute instances create VM_NAME \
18-
--image-project=PROJECT_NAME \
19-
--image-family=ubuntu-22.04 \
20-
--metadata-from-file=startup-script=FILE_PATH
21-
```
22-
23-
Replace the following:
24-
25-
`PROJECT_NAME`: the name of the project host the virtual machine instance
26-
27-
`VM_NAME`: the name of the virtual machine instance
28-
29-
`FILE_PATH`: the relative path to the startup script file
1+
## Google Cloud Compute Engine
2+
3+
We have setup a Virtual Machine on
4+
[Google Cloud](https://cloud.google.com/products/compute) to generate both the
5+
[Matter SDK coverage report](https://matter-build-automation.ue.r.appspot.com)
6+
and the
7+
[Matter SDK Conformance report](https://matter-build-automation.ue.r.appspot.com/conformance_report.html).
8+
9+
### The Matter SDK Virtual Machine and the "startup-script.sh"
10+
11+
We created a VM named `matter-build-coverage`. The machine configuration is
12+
located
13+
[here](https://pantheon.corp.google.com/compute/instancesDetail/zones/us-central1-a/instances/matter-build-coverage?inv=1&invt=AbnAfg&project=matter-build-automation).
14+
Reach out to Google team members if you need to make changes to this VM.
15+
16+
This virtual machine is scheduled to run daily, starting at 11:45PM and stopping
17+
at 2am. During boot, the machine runs the `startup-script.sh`.
18+
19+
The `startup-script.sh` script contains commands to checkout the SDK repository
20+
and create both the SDK coverage report and conformance report. The startup
21+
script uses `scripts/build_coverage.sh` to generate the coverage report and
22+
`scripts/examples/conformance_report.py` to generate the conformance report. The
23+
resulting HTML files are published via an App Engine service and available here
24+
([coverage report](https://matter-build-automation.ue.r.appspot.com/),
25+
[conformance report](https://matter-build-automation.ue.r.appspot.com/conformance_report.html)).
26+
27+
### Making Changes to "startup-script.sh"
28+
29+
If you make changes to `startup-script.sh`, make sure you go to the
30+
[VM configuration](https://pantheon.corp.google.com/compute/instancesDetail/zones/us-central1-a/instances/matter-build-coverage?inv=1&invt=AbnAfg&project=matter-build-automation),
31+
click `edit` and update the startup script in the `Automation` text box, to
32+
reflect your changes. The script in the Matter SDK repo is just a copy of the
33+
configuration in the VM.

integrations/compute_engine/startup-script.sh

+12
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,23 @@
1616
# limitations under the License.
1717
#
1818

19+
set -x
20+
1921
cd /tmp
2022
rm -rf connectedhomeip
2123
git clone --recurse-submodules https://github.com/project-chip/connectedhomeip.git
2224
cd connectedhomeip
25+
26+
# Generate Coverage Report
2327
./scripts/build_coverage.sh 2>&1 | tee /tmp/matter_build.log
28+
29+
# Generate Conformance Report
30+
source scripts/activate.sh
31+
./scripts/build_python.sh -i out/python_env
32+
python3 -u scripts/examples/conformance_report.py
33+
cp /tmp/conformance_report/conformance_report.html out/coverage/coverage/html
34+
35+
# Upload
2436
cd out/coverage/coverage
2537
gcloud app deploy webapp_config.yaml 2>&1 | tee /tmp/matter_publish.log
2638
versions=$(gcloud app versions list \

0 commit comments

Comments
 (0)