Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow to upload coverage report on pushes to main #2025

Merged
merged 2 commits into from
Jun 14, 2023

Conversation

Bravo555
Copy link
Contributor

@Bravo555 Bravo555 commented Jun 12, 2023

Proposed changes

Codecov guides suggest uploading coverage for push and pull_request events. pull-request-checks.yml only runs on PRs though, and when coverage upload only happens there, it has an effect of codecov patch reports not picking up the latest HEAD and displaying coverage changes that have already been made in previous PRs. To fix this, we upload report every time we push to main, which also happens when a PR gets merged.

Also, because coverage data that we get from llvm-cov is somewhat noisy and unrelated changes can randomly increase or decrease coverage, failing PR checks, we disable blocking checks for the time being. Once we tune codecov to a sufficient degree, we can reenable them.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (general improvements like code refactoring that doesn't explicitly fix a bug or add any new functionality)
  • Documentation Update (if none of the other choices apply)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Paste Link to the issue


Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA (in all commits with git commit -s)
  • I ran cargo fmt as mentioned in CODING_GUIDELINES
  • I used cargo clippy as mentioned in CODING_GUIDELINES
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

https://docs.codecov.com/docs/commit-status#informational

Coverage data that we get from llvm-cov is very noisy and unrelated
changes can randomly increase or decrease coverage, failing PR checks.

While this behaviour is investigated, blocking coverage-related PR
checks are disabled, but reports are still sent.

Signed-off-by: Marcel Guzik <marcel.guzik@inetum.com>
@Bravo555 Bravo555 temporarily deployed to Test Pull Request June 12, 2023 12:16 — with GitHub Actions Inactive
Signed-off-by: Marcel Guzik <marcel.guzik@inetum.com>
@github-actions
Copy link
Contributor

github-actions bot commented Jun 12, 2023

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass %
221 0 5 221 100

Passed Tests

Name ⏱️ Duration Suite
Define Child device 1 ID 0.011 s C8Y Child Alarms Rpi
Normal case when the child device does not exist on c8y cloud 3.944 s C8Y Child Alarms Rpi
Normal case when the child device already exists 0.654 s C8Y Child Alarms Rpi
Reconciliation when the new alarm message arrives, restart the mapper 1.185 s C8Y Child Alarms Rpi
Reconciliation when the alarm that is cleared 65.319 s C8Y Child Alarms Rpi
Prerequisite Parent 14.474 s Child Conf Mgmt Plugin
Prerequisite Child 0.37 s Child Conf Mgmt Plugin
Child device bootstrapping 14.785 s Child Conf Mgmt Plugin
Snapshot from device 61.316 s Child Conf Mgmt Plugin
Child device config update 62.603 s Child Conf Mgmt Plugin
Configuration types should be detected on file change (without restarting service) 47.306 s Inotify Crate
Check lock file existence in default folder 1.679 s Lock File
Check PID number in lock file 2.056 s Lock File
Check PID number in lock file after restarting the services 1.517 s Lock File
Check starting same service twice 0.705 s Lock File
Switch off lock file creation 1.451 s Lock File
Set configuration when file exists 7.032 s Configuration Operation
Set configuration when file does not exist 5.088 s Configuration Operation
Set configuration with broken url 5.774 s Configuration Operation
Get configuration 5.712 s Configuration Operation
Get non existent configuration file 4.777 s Configuration Operation
Get non existent configuration type 4.8309999999999995 s Configuration Operation
Update configuration plugin config via cloud 4.977 s Configuration Operation
Modify configuration plugin config via local filesystem modify inplace 2.782 s Configuration Operation
Modify configuration plugin config via local filesystem overwrite 4.415 s Configuration Operation
Update configuration plugin config via local filesystem copy 3.168 s Configuration Operation
Update configuration plugin config via local filesystem move (different directory) 4.854 s Configuration Operation
Update configuration plugin config via local filesystem move (same directory) 3.591 s Configuration Operation
Update the custom operation dynamically 52.838 s Dynamically Reload Operation
Custom operation successful 63.268 s Custom Operation
Custom operation fails 65.342 s Custom Operation
Successful firmware operation 61.338 s Firmware Operation
Install with empty firmware name 46.111 s Firmware Operation
Prerequisite Parent 17.424 s Firmware Operation Child Device
Prerequisite Child 8.014 s Firmware Operation Child Device
Child device firmware update 6.026 s Firmware Operation Child Device
Child device firmware update with cache 6.417 s Firmware Operation Child Device
Firmware plugin supports restart via service manager #1932 4.357 s Firmware Operation Child Device Retry
Update Inventory data via inventory.json 1.105 s Inventory Update
Inventory includes the agent fragment with version information 1.795 s Inventory Update
Retrieve a JWT tokens 36.131 s Jwt Request
Mapper recovers and processes output of ongoing software update request 15.621 s Recover And Publish Software Update Message
Check running collectd 0.911 s Monitor Device Collectd
Is collectd publishing MQTT messages? 0.714 s Monitor Device Collectd
Check thin-edge monitoring 3.519 s Monitor Device Collectd
Check grouping of measurements 8.917 s Monitor Device Collectd
Main device registration 1.471 s Device Registration
Child device registration 2.055 s Device Registration
Supports restarting the device 54.62 s Restart Device
Update tedge version from previous using Cumulocity 91.717 s Tedge Self Update
Test if all c8y services are up 41.848 s Service Monitoring
Test if all c8y services are down 108.721 s Service Monitoring
Test if all c8y services are using configured service type 115.851 s Service Monitoring
Test if all c8y services using default service type when service type configured as empty 86.326 s Service Monitoring
Check health status of tedge-mapper-c8y service on broker stop start 19.954 s Service Monitoring
Check health status of tedge-mapper-c8y service on broker restart 21.812 s Service Monitoring
Check health status of child device service 16.045 s Service Monitoring
Successful shell command with output 3.529 s Shell Operation
Check Successful shell command with literal double quotes output 3.187 s Shell Operation
Execute multiline shell command 3.152 s Shell Operation
Failed shell command 3.461 s Shell Operation
Software list should be populated during startup 40.298 s Software
Install software via Cumulocity 49.563 s Software
Software list should only show currently installed software and not candidates 43.07 s Software
Child devices support sending simple measurements 3.608 s Child Device Telemetry
Child devices support sending custom measurements 1.015 s Child Device Telemetry
Child devices support sending custom events 0.957 s Child Device Telemetry
Child devices support sending custom events overriding the type 1.002 s Child Device Telemetry
Child devices support sending custom alarms #1699 3.052 s Child Device Telemetry
Child devices support sending inventory data via c8y topic 0.857 s Child Device Telemetry
Child device supports sending custom child device measurements directly to c8y 1.42 s Child Device Telemetry
Check retained alarms 43.034 s Raise Alarms
Thin-edge devices support sending simple measurements 1.321 s Thin-Edge Device Telemetry
Thin-edge devices support sending simple measurements with custom type 1.208 s Thin-Edge Device Telemetry
Thin-edge devices support sending custom measurements 1.152 s Thin-Edge Device Telemetry
Thin-edge devices support sending custom events 1.32 s Thin-Edge Device Telemetry
Thin-edge devices support sending custom events overriding the type 1.357 s Thin-Edge Device Telemetry
Thin-edge devices support sending custom alarms #1699 3.223 s Thin-Edge Device Telemetry
Thin-edge device supports sending custom Thin-edge device measurements directly to c8y 1.448 s Thin-Edge Device Telemetry
Thin-edge device support sending inventory data via c8y topic 1.099 s Thin-Edge Device Telemetry
thin-edge components support a custom config-dir location via flags 26.666 s Config Dir
Validate updated data path used by tedge-agent 0.327 s Data Path Config
Validate updated data path used by c8y-firmware-plugin 10.309 s Data Path Config
Validate updated data path used by tedge-agent 0.59 s Log Path Config
Install thin-edge via apt 47.937 s Install Apt
Install latest via script (from current branch) 25.294 s Install Tedge
Install specific version via script (from current branch) 30.474 s Install Tedge
Install latest tedge via script (from main branch) 19.968 s Install Tedge
Install then uninstall latest tedge via script (from main branch) 68.163 s Install Tedge
Support starting and stopping services 35.366 s Service-Control
Supports a reconnect 58.012 s Test-Commands
Supports disconnect then connect 50.811 s Test-Commands
Update unknown setting 27.585 s Test-Commands
Update known setting 21.986 s Test-Commands
It checks MQTT messages using a pattern 67.247 s Test-Mqtt
Stop c8y-configuration-plugin 0.127 s Health C8Y-Configuration-Plugin
Update the service file 0.145 s Health C8Y-Configuration-Plugin
Reload systemd files 0.637 s Health C8Y-Configuration-Plugin
Start c8y-configuration-plugin 0.142 s Health C8Y-Configuration-Plugin
Start watchdog service 10.186 s Health C8Y-Configuration-Plugin
Check PID of c8y-configuration-plugin 0.334 s Health C8Y-Configuration-Plugin
Kill the PID 0.559 s Health C8Y-Configuration-Plugin
Recheck PID of c8y-configuration-plugin 6.575 s Health C8Y-Configuration-Plugin
Compare PID change 0.008 s Health C8Y-Configuration-Plugin
Stop watchdog service 0.322 s Health C8Y-Configuration-Plugin
Remove entry from service file 0.185 s Health C8Y-Configuration-Plugin
Stop c8y-log-plugin 0.145 s Health C8Y-Log-Plugin
Update the service file 0.103 s Health C8Y-Log-Plugin
Reload systemd files 0.572 s Health C8Y-Log-Plugin
Start c8y-log-plugin 0.182 s Health C8Y-Log-Plugin
Start watchdog service 10.33 s Health C8Y-Log-Plugin
Check PID of c8y-log-plugin 0.148 s Health C8Y-Log-Plugin
Kill the PID 0.198 s Health C8Y-Log-Plugin
Recheck PID of c8y-log-plugin 6.571 s Health C8Y-Log-Plugin
Compare PID change 0.001 s Health C8Y-Log-Plugin
Stop watchdog service 0.362 s Health C8Y-Log-Plugin
Remove entry from service file 0.235 s Health C8Y-Log-Plugin
Stop tedge-mapper 0.084 s Health Tedge Mapper C8Y
Update the service file 0.081 s Health Tedge Mapper C8Y
Reload systemd files 0.235 s Health Tedge Mapper C8Y
Start tedge-mapper 0.106 s Health Tedge Mapper C8Y
Start watchdog service 10.115 s Health Tedge Mapper C8Y
Check PID of tedge-mapper 0.235 s Health Tedge Mapper C8Y
Kill the PID 0.424 s Health Tedge Mapper C8Y
Recheck PID of tedge-mapper 6.582 s Health Tedge Mapper C8Y
Compare PID change 0.001 s Health Tedge Mapper C8Y
Stop watchdog service 0.136 s Health Tedge Mapper C8Y
Remove entry from service file 0.131 s Health Tedge Mapper C8Y
Stop tedge-agent 0.159 s Health Tedge-Agent
Update the service file 0.074 s Health Tedge-Agent
Reload systemd files 0.166 s Health Tedge-Agent
Start tedge-agent 0.061 s Health Tedge-Agent
Start watchdog service 10.088 s Health Tedge-Agent
Check PID of tedge-mapper 0.202 s Health Tedge-Agent
Kill the PID 0.4 s Health Tedge-Agent
Recheck PID of tedge-agent 6.842 s Health Tedge-Agent
Compare PID change 0.024 s Health Tedge-Agent
Stop watchdog service 0.285 s Health Tedge-Agent
Remove entry from service file 0.266 s Health Tedge-Agent
Stop tedge-mapper-az 0.206 s Health Tedge-Mapper-Az
Update the service file 0.188 s Health Tedge-Mapper-Az
Reload systemd files 0.528 s Health Tedge-Mapper-Az
Start tedge-mapper-az 0.349 s Health Tedge-Mapper-Az
Start watchdog service 10.261 s Health Tedge-Mapper-Az
Check PID of tedge-mapper-az 0.224 s Health Tedge-Mapper-Az
Kill the PID 0.441 s Health Tedge-Mapper-Az
Recheck PID of tedge-agent 6.7780000000000005 s Health Tedge-Mapper-Az
Compare PID change 0.001 s Health Tedge-Mapper-Az
Stop watchdog service 0.53 s Health Tedge-Mapper-Az
Remove entry from service file 0.185 s Health Tedge-Mapper-Az
Stop tedge-mapper-collectd 0.128 s Health Tedge-Mapper-Collectd
Update the service file 0.122 s Health Tedge-Mapper-Collectd
Reload systemd files 0.597 s Health Tedge-Mapper-Collectd
Start tedge-mapper-collectd 0.145 s Health Tedge-Mapper-Collectd
Start watchdog service 10.274000000000001 s Health Tedge-Mapper-Collectd
Check PID of tedge-mapper-collectd 0.154 s Health Tedge-Mapper-Collectd
Kill the PID 0.182 s Health Tedge-Mapper-Collectd
Recheck PID of tedge-mapper-collectd 6.45 s Health Tedge-Mapper-Collectd
Compare PID change 0.006 s Health Tedge-Mapper-Collectd
Stop watchdog service 0.314 s Health Tedge-Mapper-Collectd
Remove entry from service file 0.22 s Health Tedge-Mapper-Collectd
tedge-collectd-mapper health status 5.811 s Health Tedge-Mapper-Collectd
c8y-log-plugin health status 5.629 s MQTT health endpoints
c8y-configuration-plugin health status 5.673 s MQTT health endpoints
Publish on a local insecure broker 0.273 s Basic Pub Sub
Publish on a local secure broker 2.634 s Basic Pub Sub
Publish on a local secure broker with client authentication 3.734 s Basic Pub Sub
Check remote mqtt broker #1773 3.424 s Remote Mqtt Broker
Apply name filter 0.143 s Filter Packages List Output
Apply maintainer filter 0.158 s Filter Packages List Output
Apply both filters 0.247 s Filter Packages List Output
No filters 0.236 s Filter Packages List Output
Both filters but name filter as empty string 0.208 s Filter Packages List Output
Both filters but maintainer filter as empty string 0.182 s Filter Packages List Output
Both filters as empty string 0.222 s Filter Packages List Output
Wrong package name 0.191 s Improve Tedge Apt Plugin Error Messages
Wrong version 0.175 s Improve Tedge Apt Plugin Error Messages
Wrong type 0.32 s Improve Tedge Apt Plugin Error Messages
tedge_connect_test_positive 0.261 s Tedge Connect Test
tedge_connect_test_negative 0.919 s Tedge Connect Test
tedge_connect_test_sm_services 8.404 s Tedge Connect Test
tedge_disconnect_test_sm_services 1.202 s Tedge Connect Test
Install thin-edge.io 13.69 s Call Tedge
call tedge -V 0.095 s Call Tedge
call tedge -h 0.095 s Call Tedge
call tedge -h -V 0.088 s Call Tedge
call tedge help 0.119 s Call Tedge
tedge config list 0.051 s Call Tedge Config List
tedge config list --all 0.067 s Call Tedge Config List
set/unset device.type 0.257 s Call Tedge Config List
set/unset device.key_path 0.252 s Call Tedge Config List
set/unset device.cert_path 0.275 s Call Tedge Config List
set/unset c8y.root_cert_path 0.235 s Call Tedge Config List
set/unset c8y.smartrest.templates 0.251 s Call Tedge Config List
set/unset az.root_cert_path 0.255 s Call Tedge Config List
set/unset aws.url 0.358 s Call Tedge Config List
set/unset aws.root_cert_path 0.33 s Call Tedge Config List
set/unset aws.mapper.timestamp 0.353 s Call Tedge Config List
set/unset az.mapper.timestamp 0.353 s Call Tedge Config List
set/unset mqtt.bind.address 0.458 s Call Tedge Config List
set/unset mqtt.bind.port 0.576 s Call Tedge Config List
set/unset http.bind.port 0.517 s Call Tedge Config List
set/unset tmp.path 0.64 s Call Tedge Config List
set/unset logs.path 0.461 s Call Tedge Config List
set/unset run.path 0.694 s Call Tedge Config List
set/unset firmware.child.update.timeout 0.306 s Call Tedge Config List
set/unset c8y.url 0.301 s Call Tedge Config List
set/unset az.url 0.292 s Call Tedge Config List
set/unset mqtt.external.bind.port 0.321 s Call Tedge Config List
mqtt.external.bind.address 0.395 s Call Tedge Config List
mqtt.external.bind.interface 0.291 s Call Tedge Config List
set/unset mqtt.external.ca_path 0.304 s Call Tedge Config List
set/unset mqtt.external.cert_file 0.332 s Call Tedge Config List
set/unset mqtt.external.key_file 0.25 s Call Tedge Config List
set/unset software.plugin.default 0.213 s Call Tedge Config List
Get Put Delete 1.604 s Http File Transfer Api
Set keys should return value on stdout 0.17 s Tedge Config Get
Unset keys should not return anything on stdout and warnings on stderr 0.237 s Tedge Config Get
Invalid keys should not return anything on stdout and warnings on stderr 0.253 s Tedge Config Get
Set configuration via environment variables 1.061 s Tedge Config Get
Set unknown configuration via environment variables 0.15 s Tedge Config Get

@Bravo555 Bravo555 changed the title Disable code coverage PR blocks Add workflow to upload coverage report on pushes to main Jun 12, 2023
@Bravo555 Bravo555 temporarily deployed to Test Pull Request June 12, 2023 13:53 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented Jun 12, 2023

Codecov Report

Merging #2025 (d653f8c) into main (2d49b71) will increase coverage by 0.3%.
The diff coverage is 94.5%.

Additional details and impacted files
Impacted Files Coverage Δ
crates/core/plugin_sm/src/operation_logs.rs 84.0% <0.0%> (ø)
crates/core/c8y_api/src/smartrest/operations.rs 82.0% <85.1%> (+8.0%) ⬆️
crates/common/logged_command/src/logged_command.rs 81.5% <88.4%> (+0.5%) ⬆️
crates/extensions/c8y_mapper_ext/src/converter.rs 79.1% <96.2%> (+2.7%) ⬆️
crates/extensions/c8y_mapper_ext/src/tests.rs 93.5% <97.1%> (+1.1%) ⬆️

... and 6 files with indirect coverage changes

@Bravo555 Bravo555 added the github_actions Pull requests that update GitHub Actions code label Jun 12, 2023
@Bravo555
Copy link
Contributor Author

While this will probably fix the most obvious unrelated changes, there's still an upstream issue of .await not being marked as hit, for which AFAIK there's no easy workaround and introduces some variance that we'll have to live with. Other than that, I'd bet the rest of the unexpected changes could be attributed to flaky tests, and code coverage gives us a nice way of detecting them.

Copy link
Member

@rina23q rina23q left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine

@didier-wenzek didier-wenzek merged commit 5d0bf3a into thin-edge:main Jun 14, 2023
19 checks passed
@Bravo555 Bravo555 deleted the codecov-disable-pr-blocks branch October 19, 2023 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
github_actions Pull requests that update GitHub Actions code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants