Skip to content

ci(coverage): Add test coverage report#12607

Draft
lucasssvaz wants to merge 1 commit into
espressif:masterfrom
lucasssvaz:feat/test_coverage
Draft

ci(coverage): Add test coverage report#12607
lucasssvaz wants to merge 1 commit into
espressif:masterfrom
lucasssvaz:feat/test_coverage

Conversation

@lucasssvaz

Copy link
Copy Markdown
Member

Description of Change

This pull request introduces a new test suite for the conftest.py fixtures and expands and refactors the existing test suite for runtime_table_generator.py. The changes improve test coverage, add new test cases (especially for coverage badge logic), and enhance test robustness and maintainability. The most important changes are:

New Test Suite for conftest.py Fixtures:

  • Adds .github/scripts/ci_testing/test_conftest_fixtures.py, a comprehensive test module for the coverage_capture, gcov_dump_capture, save_perf_result, and related helpers from conftest.py. This suite mocks dependencies and tests fixture logic without requiring hardware or pytest-embedded.

Refactoring and Expansion of runtime_table_generator.py Tests:

  • Moves and renames the test file from .github/scripts/test_runtime_table_generator.py to .github/scripts/ci_testing/test_runtime_table_generator.py, updating all references and usage instructions accordingly.
  • Refactors the test runner logic to return both the cached and full saved test results, enabling more thorough assertions.
  • Updates all test cases to use the new return signature from run_generator, ensuring compatibility and clarity. [1] [2] [3] [4] [5] [6] [7] [8] [9]

New Coverage Badge Test Cases:

  • Adds new test case descriptions and logic to cover various coverage badge scenarios, including boundary values, rounding, and absence of coverage data. [1] [2] [3]

Path and Import Robustness Improvements:

  • Updates script path resolution to be more robust and compatible with the new directory structure.

These changes collectively improve the reliability and coverage of the CI test scripts and ensure that future changes to test fixtures and runtime table generation logic are well-tested.

Test Scenarios

Tested locally

Related links

Requires espressif/pytest-embedded#420

@lucasssvaz lucasssvaz self-assigned this May 20, 2026
@lucasssvaz lucasssvaz added the Type: CI & Testing Related to continuous integration, automated testing, or test infrastructure. label May 20, 2026
@github-actions

github-actions Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor
Messages
📖 This PR seems to be quite large (total lines of code: 2168), you might consider splitting it into smaller PRs

👋 Hello lucasssvaz, we appreciate your contribution to this project!


📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more.

🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project.

Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- Addressing info messages (📖) is strongly recommended; they're less critical but valuable.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against dfcb7ae

@lucasssvaz lucasssvaz force-pushed the feat/test_coverage branch from 0f62231 to 93ddd83 Compare May 20, 2026 18:51
if gcov_tool:
cmd += ["--gcov-tool", gcov_tool]
print(f"$ {' '.join(cmd)}", file=sys.stderr)
result = subprocess.run(cmd, capture_output=True, text=True)
merge_cmd += ["--add-tracefile", pf]
merge_cmd += ["--output-file", tracefile, "--ignore-errors", "empty"]
print(f"$ {' '.join(merge_cmd)}", file=sys.stderr)
subprocess.run(merge_cmd, check=True)

try:
result = subprocess.run(
[cxxfilt], input="\n".join(mangled),
next(gen) # run up to yield
try:
next(gen) # run teardown
except StopIteration:
if clean:
try:
decoded_parts.append(base64.b64decode(clean))
except Exception:
demangled = result.stdout.strip().splitlines()
if len(demangled) == len(mangled):
return dict(zip(mangled, demangled))
except (FileNotFoundError, subprocess.TimeoutExpired):
if core_root:
try:
display_path = os.path.relpath(sf, core_root)
except ValueError:
@github-actions

github-actions Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Test Results

  136 files    136 suites   34m 55s ⏱️
  236 tests   236 ✅ 0 💤 0 ❌
1 865 runs  1 865 ✅ 0 💤 0 ❌

Results for commit dfcb7ae.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Memory usage test (comparing PR against master branch)

The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.

MemoryFLASH [bytes]FLASH [%]RAM [bytes]RAM [%]
TargetDECINCDECINCDECINCDECINC
ESP32000.000.00000.000.00
ESP32C3000.000.00000.000.00
ESP32C5000.000.00000.000.00
ESP32C6000.000.00000.000.00
ESP32H2000.000.00000.000.00
ESP32P4000.000.00000.000.00
ESP32S2000.000.00000.000.00
ESP32S3000.000.00000.000.00
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32ESP32C3ESP32C5ESP32C6ESP32H2ESP32P4ESP32S2ESP32S3
ExampleFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAM
libraries/ArduinoOTA/examples00000000--000000
ArduinoOTA/examples (2)00000000--000000
libraries/AsyncUDP/examples00000000--000000
AsyncUDP/examples (2)00000000--000000
AsyncUDP/examples (3)00000000--000000
libraries/BLE/examples000000000000--00
BLE/examples (2)000000000000--00
BLE/examples (3)000000000000--00
BLE/examples (4)000000000000--00
BLE/examples (5)000000000000--00
BLE/examples (6)000000000000--00
BLE/examples (7)000000000000--00
BLE/examples (8)000000000000--00
BLE/examples (9)000000000000--00
BLE/examples (10)000000000000--00
BLE/examples (11)000000000000--00
BLE/examples (12)000000000000--00
BLE/examples (13)000000000000--00
BLE/examples (14)000000000000--00
BLE/examples (15)000000000000--00
BLE/examples (16)000000000000--00
BLE/examples (17)000000000000--00
libraries/BluetoothSerial/examples00--------------
BluetoothSerial/examples (2)00--------------
BluetoothSerial/examples (3)00--------------
BluetoothSerial/examples (4)00--------------
BluetoothSerial/examples (5)00--------------
BluetoothSerial/examples (6)00--------------
BluetoothSerial/examples (7)00--------------
BluetoothSerial/examples (8)00--------------
libraries/Console/examples0000000000000000
Console/examples (2)0000000000000000
Console/examples (3)0000000000000000
Console/examples (4)0000000000000000
Console/examples (5)0000000000000000
Console/examples (6)0000000000000000
Console/examples (7)0000000000000000
Console/examples (8)00000000--000000
libraries/DNSServer/examples00000000--000000
libraries/EEPROM/examples0000000000000000
EEPROM/examples (2)0000000000000000
EEPROM/examples (3)0000000000000000
libraries/ESP32/examples/AnalogOut0000000000000000
ESP32/examples/AnalogOut (2)0000000000000000
ESP32/examples/AnalogOut (3)0000000000000000
ESP32/examples/AnalogOut (4)0000000000000000
ESP32/examples/AnalogOut (5)0000000000000000
ESP32/examples/AnalogOut (6)0000000000000000
libraries/ESP32/examples0000000000000000
ESP32/examples (2)0000000000000000
ESP32/examples (3)0000000000000000
ESP32/examples (4)0000000000000000
libraries/ESP32/examples/CI0000000000000000
libraries/ESP32/examples/Camera00----------0000
ESP32/examples/Camera (2)00----------0000
libraries/ESP32/examples/ChipID0000000000000000
libraries/ESP32/examples/DeepSleep00000000--000000
ESP32/examples/DeepSleep (2)00--------000000
ESP32/examples/DeepSleep (3)00----------0000
ESP32/examples/DeepSleep (4)00--------------
libraries/ESP32/examples/FreeRTOS0000000000000000
ESP32/examples/FreeRTOS (2)0000000000000000
ESP32/examples/FreeRTOS (3)0000000000000000
ESP32/examples/FreeRTOS (4)0000000000000000
libraries/ESP32/examples/GPIO0000000000000000
ESP32/examples/GPIO (2)0000000000000000
ESP32/examples/GPIO (3)0000000000000000
ESP32/examples/GPIO (4)0000000000000000
ESP32/examples/GPIO (5)0000000000000000
ESP32/examples (5)000000000000--00
ESP32/examples (6)00--------------
libraries/ESP32/examples/MacAddress0000000000000000
libraries/ESP32/examples/RMT0000000000000000
ESP32/examples/RMT (2)0000000000000000
ESP32/examples/RMT (3)0000000000000000
ESP32/examples/RMT (4)0000000000000000
ESP32/examples/RMT (5)0000000000000000
ESP32/examples/RMT (6)0000000000000000
ESP32/examples/RMT (7)0000000000000000
ESP32/examples/RMT (8)0000000000000000
libraries/ESP32/examples/ResetReason0000000000000000
ESP32/examples/ResetReason (2)0000000000000000
libraries/ESP32/examples/Serial0000000000000000
ESP32/examples/Serial (2)0000000000000000
ESP32/examples/Serial (3)0000000000000000
ESP32/examples/Serial (4)0000000000000000
ESP32/examples/Serial (5)0000000000000000
ESP32/examples/Serial (6)0000000000000000
ESP32/examples/Serial (7)0000000000000000
ESP32/examples/Serial (8)0000000000000000
ESP32/examples/Serial (9)0000000000000000
ESP32/examples/Serial (10)0000000000000000
ESP32/examples/Serial (11)0000000000000000
ESP32/examples/Serial (12)0000000000000000
ESP32/examples/Serial (13)0000000000000000
libraries/ESP32/examples/TWAI0000--0000000000
ESP32/examples/TWAI (2)0000--0000000000
libraries/ESP32/examples/Template0000000000000000
libraries/ESP32/examples/Time00000000--000000
libraries/ESP32/examples/Timer0000000000000000
ESP32/examples/Timer (2)0000000000000000
libraries/ESP32/examples/Touch00--------000000
ESP32/examples/Touch (2)00--------000000
ESP32/examples/Touch (3)00--------000000
libraries/ESP_I2S/examples0000000000000000
ESP_I2S/examples (2)0000000000000000
ESP_I2S/examples (3)0000000000000000
ESP_I2S/examples (4)00--------00--00
libraries/ESP_NOW/examples00000000----0000
ESP_NOW/examples (2)00000000----0000
ESP_NOW/examples (3)00000000----0000
ESP_NOW/examples (4)00000000----0000
libraries/ESPmDNS/examples00000000--000000
ESPmDNS/examples (2)00000000--000000
libraries/Ethernet/examples0000000000000000
Ethernet/examples (2)0000000000000000
Ethernet/examples (3)00000000--000000
Ethernet/examples (4)00--------00----
Ethernet/examples (5)00--------------
libraries/FFat/examples0000000000000000
FFat/examples (2)00000000--000000
libraries/HTTPClient/examples00000000--000000
HTTPClient/examples (2)00000000--000000
HTTPClient/examples (3)00000000--000000
HTTPClient/examples (4)00000000--000000
HTTPClient/examples (5)00000000--000000
HTTPClient/examples (6)00000000--000000
HTTPClient/examples (7)00000000----0000
libraries/HTTPUpdate/examples00000000--000000
HTTPUpdate/examples (2)00000000--000000
HTTPUpdate/examples (3)00000000--000000
libraries/HTTPUpdateServer/examples00000000--000000
libraries/Hash/examples0000000000000000
Hash/examples (2)0000000000000000
Hash/examples (3)0000000000000000
Hash/examples (4)0000000000000000
Hash/examples (5)0000000000000000
Hash/examples (6)0000000000000000
Hash/examples (7)0000000000000000
libraries/Insights/examples00000000----0000
Insights/examples (2)00000000----0000
libraries/LittleFS/examples0000000000000000
LittleFS/examples (2)00000000--000000
libraries/Matter/examples0000000000--0000
Matter/examples (2)0000000000--0000
Matter/examples (3)0000000000--0000
Matter/examples (4)0000000000--0000
Matter/examples (5)0000000000--0000
Matter/examples (6)0000000000--0000
Matter/examples (7)0000000000--0000
Matter/examples (8)0000000000--0000
Matter/examples (9)0000000000--0000
Matter/examples (10)0000000000--0000
Matter/examples (11)0000000000--0000
Matter/examples (12)0000000000--0000
Matter/examples (13)0000000000--0000
Matter/examples (14)0000000000--0000
Matter/examples (15)0000000000--0000
Matter/examples (16)0000000000--0000
Matter/examples (17)0000000000--0000
Matter/examples (18)0000000000--0000
Matter/examples (19)0000000000--0000
Matter/examples (20)0000000000--0000
Matter/examples (21)0000000000--0000
Matter/examples (22)0000000000--0000
Matter/examples (23)0000000000--0000
Matter/examples (24)0000000000--0000
Matter/examples (25)0000000000--0000
Matter/examples (26)0000000000--0000
Matter/examples (27)0000000000--0000
Matter/examples (28)0000000000--0000
Matter/examples (29)0000000000--0000
Matter/examples (30)0000000000--0000
Matter/examples (31)0000000000--0000
libraries/NetBIOS/examples00000000--000000
libraries/NetworkClientSecure/examples00000000--000000
NetworkClientSecure/examples (2)00000000--000000
NetworkClientSecure/examples (3)00000000--000000
NetworkClientSecure/examples (4)00000000--000000
NetworkClientSecure/examples (5)00000000--000000
NetworkClientSecure/examples (6)00000000--000000
NetworkClientSecure/examples (7)00000000----0000
libraries/PPP/examples0000000000000000
PPP/examples (2)00000000--000000
libraries/Preferences/examples0000000000000000
Preferences/examples (2)0000000000000000
libraries/SD/examples0000000000000000
SD/examples (2)00000000--000000
libraries/SD_MMC/examples00--------00--00
SD_MMC/examples (2)00--------00--00
libraries/SPI/examples0000000000000000
libraries/SPIFFS/examples0000000000000000
SPIFFS/examples (2)00000000--000000
libraries/SimpleBLE/examples00--------------
libraries/Ticker/examples0000000000000000
Ticker/examples (2)0000000000000000
Ticker/examples (3)0000000000000000
libraries/Update/examples0000000000000000
Update/examples (2)00000000--000000
Update/examples (3)00000000--000000
Update/examples (4)00000000--000000
Update/examples (5)00000000--000000
Update/examples (6)00000000--000000
Update/examples (7)00000000--000000
libraries/WebServer/examples00000000--000000
WebServer/examples (2)00000000--000000
WebServer/examples (3)00000000--000000
WebServer/examples (4)00000000--000000
WebServer/examples (5)00000000--000000
WebServer/examples (6)00000000--000000
WebServer/examples (7)00000000--000000
WebServer/examples (8)00000000--000000
WebServer/examples (9)00000000--000000
WebServer/examples (10)00000000--000000
WebServer/examples (11)00000000--000000
WebServer/examples (12)00000000--000000
WebServer/examples (13)00000000--000000
WebServer/examples (14)00000000--000000
WebServer/examples (15)00000000--000000
WebServer/examples (16)00000000--000000
WebServer/examples (17)00000000--000000
WebServer/examples (18)00000000--000000
WebServer/examples (19)00000000----0000
libraries/WiFi/examples/FTM00000000--000000
WiFi/examples/FTM (2)00000000--000000
libraries/WiFi/examples00000000--000000
WiFi/examples (2)00000000--000000
WiFi/examples (3)00000000--000000
WiFi/examples (4)00000000--000000
WiFi/examples (5)00000000--000000
WiFi/examples (6)00000000--000000
WiFi/examples (7)00000000--000000
WiFi/examples (8)00000000--000000
WiFi/examples (9)00000000--000000
WiFi/examples (10)00000000--000000
WiFi/examples (11)00000000--000000
WiFi/examples (12)00000000--000000
WiFi/examples (13)00000000--000000
WiFi/examples (14)00000000--000000
WiFi/examples (15)00000000--000000
WiFi/examples (16)00000000--000000
WiFi/examples (17)00000000--000000
WiFi/examples (18)00000000--000000
WiFi/examples (19)00000000----0000
WiFi/examples (20)00000000----0000
WiFi/examples (21)00000000----0000
WiFi/examples (22)00000000------00
libraries/WiFiProv/examples00000000----0000
libraries/Wire/examples0000000000000000
Wire/examples (2)0000000000000000
Wire/examples (3)0000000000000000
Wire/examples (4)0000000000000000
libraries/Zigbee/examples0000000000--0000
Zigbee/examples (2)0000000000--0000
Zigbee/examples (3)0000000000--0000
Zigbee/examples (4)0000000000--0000
Zigbee/examples (5)0000000000--0000
Zigbee/examples (6)0000000000--0000
Zigbee/examples (7)0000000000--0000
Zigbee/examples (8)0000000000--0000
Zigbee/examples (9)0000000000--0000
Zigbee/examples (10)0000000000--0000
Zigbee/examples (11)0000000000--0000
Zigbee/examples (12)0000000000--0000
BLE/examples (18)--00000000----00
libraries/RainMaker/examples--000000----0000
RainMaker/examples (2)--000000----0000
RainMaker/examples (3)--000000----0000
RainMaker/examples (4)--000000----0000
ESP32/examples/AnalogOut (7)----00000000----
libraries/OpenThread/examples/CLI/COAP----000000------
OpenThread/examples/CLI/COAP (2)----000000------
libraries/OpenThread/examples/CLI----000000------
OpenThread/examples/CLI (2)----000000------
libraries/OpenThread/examples/CLI/SimpleThreadNetwork----000000------
OpenThread/examples/CLI/SimpleThreadNetwork (2)----000000------
OpenThread/examples/CLI/SimpleThreadNetwork (3)----000000------
OpenThread/examples/CLI (3)----000000------
OpenThread/examples/CLI (4)----000000------
libraries/OpenThread/examples/CLI/UDP----000000------
OpenThread/examples/CLI/UDP (2)----000000------
OpenThread/examples/CLI (5)----000000------
libraries/OpenThread/examples/Native/CoAP/CoAP_CRUD----000000------
OpenThread/examples/Native/CoAP/CoAP_CRUD (2)----000000------
libraries/OpenThread/examples/Native/CoAP/CoAP_Greenhouse----000000------
OpenThread/examples/Native/CoAP/CoAP_Greenhouse (2)----000000------
libraries/OpenThread/examples/Native/CoAP/CoAP_Light_Switch----000000------
OpenThread/examples/Native/CoAP/CoAP_Light_Switch (2)----000000------
libraries/OpenThread/examples/Native/CoAP/CoAP_Secure----000000------
OpenThread/examples/Native/CoAP/CoAP_Secure (2)----000000------
libraries/OpenThread/examples/Native/CoAP/CoAP_Sensor----000000------
OpenThread/examples/Native/CoAP/CoAP_Sensor (2)----000000------
libraries/OpenThread/examples/Native/CoAP/CoAP_SimpleGet----000000------
OpenThread/examples/Native/CoAP/CoAP_SimpleGet (2)----000000------
libraries/OpenThread/examples/Native/SimpleThreadNetwork----000000------
OpenThread/examples/Native/SimpleThreadNetwork (2)----000000------
libraries/OpenThread/examples/Native----000000------
libraries/OpenThread/examples/Native/ThreadCommissioning----000000------
OpenThread/examples/Native/ThreadCommissioning (2)----000000------
libraries/OpenThread/examples/Native/UDP/UDP_Light_Switch----000000------
OpenThread/examples/Native/UDP/UDP_Light_Switch (2)----000000------
libraries/OpenThread/examples/Native/UDP/UDP_SensorNetwork----000000------
OpenThread/examples/Native/UDP/UDP_SensorNetwork (2)----000000------
Zigbee/examples (13)----000000------
Zigbee/examples (14)----000000------
Zigbee/examples (15)----000000------
Zigbee/examples (16)----000000------
Zigbee/examples (17)----000000------
Zigbee/examples (18)----000000------
Zigbee/examples (19)----000000------
Zigbee/examples (20)----000000------
Zigbee/examples (21)----000000------
Zigbee/examples (22)----000000------
Zigbee/examples (23)----000000------
Zigbee/examples (24)----000000------
Zigbee/examples (25)----000000------
Zigbee/examples (26)----000000------
Zigbee/examples (27)----000000------
Zigbee/examples (28)----000000------
Zigbee/examples (29)----000000------
Zigbee/examples (30)----000000------
Zigbee/examples (31)----00----------
libraries/ESP_HostedOTA/examples----------00----
libraries/ESP_SR/examples----------00--00
SD_MMC/examples (3)----------00--00
libraries/USB/examples----------000000
USB/examples (2)----------000000
USB/examples (3)----------000000
USB/examples (4)----------000000
USB/examples (5)----------000000
USB/examples (6)----------000000
USB/examples (7)----------000000
libraries/USB/examples/Keyboard----------000000
USB/examples/Keyboard (2)----------000000
USB/examples/Keyboard (3)----------000000
USB/examples/Keyboard (4)----------000000
USB/examples (8)----------000000
libraries/USB/examples/MIDI----------000000
USB/examples/MIDI (2)----------000000
USB/examples/MIDI (3)----------000000
USB/examples/MIDI (4)----------000000
USB/examples/MIDI (5)----------000000
libraries/USB/examples/Mouse----------000000
USB/examples (9)----------000000
USB/examples (10)----------000000
USB/examples (11)----------000000
USB/examples (12)----------000000
ESP32/examples/Camera (3)--------------00

@lucasssvaz lucasssvaz added the Status: Blocked upstream 🛑 PR is waiting on upstream changes to be merged first label May 25, 2026
@lucasssvaz lucasssvaz force-pushed the feat/test_coverage branch from 93ddd83 to dfcb7ae Compare June 29, 2026 21:33

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Merge request must include a release note, or it needs to be processed first.

Details

Open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Blocked upstream 🛑 PR is waiting on upstream changes to be merged first Type: CI & Testing Related to continuous integration, automated testing, or test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants