Skip to content

Enhance tests TODO #1

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Enhance tests TODO #1

wants to merge 3 commits into from

Conversation

JakubAndrysek
Copy link
Owner

TODO

By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes

Checklist

  1. Please provide specific title of the PR describing the change, including the component name (eg. „Update of Documentation link on Readme.md“)
  2. Please provide related links (eg. Issue which will be closed by this Pull Request)
  3. Please update relevant Documentation if applicable
  4. Please check Contributing guide
  5. Please confirm option to "Allow edits and access to secrets by maintainers" when opening a Pull Request

This entire section above can be deleted if all items are checked.


Description of Change

Please describe your proposed Pull Request and it's impact.

Tests scenarios

Please describe on what Hardware and Software combinations you have tested this Pull Request and how.

(eg. I have tested my Pull Request on Arduino-esp32 core v2.0.2 with ESP32 and ESP32-S2 Board with this scenario)

Related links

Please provide links to related issue, PRs etc.

(eg. Closes #number of issue)

@JakubAndrysek JakubAndrysek marked this pull request as draft June 13, 2025 14:07
@JakubAndrysek JakubAndrysek requested a review from Copilot June 13, 2025 14:08
Copy link

github-actions bot commented Jun 13, 2025

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

👋 Hello JakubAndrysek, 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 d878e48

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the existing GPIO validation suite and introduces a new set of GPIO‐interrupt tests with matching scenarios, code, and board diagrams.

  • Adds comprehensive interrupt scenarios and Unity tests for attach/detach, edge, change, and argument callbacks.
  • Refactors basic GPIO tests into distinct read/write Unity cases and updates the Wokwi scenario to include pin expectations.
  • Supplies updated device diagrams and CI configuration for multiple ESP32 variants for both GPIO and GPIO‐interrupt tests.

Reviewed Changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/validation/gpio_interrupt/scenario.yaml New YAML scenarios covering attach/detach, rising/falling, change, and argument‐based tests.
tests/validation/gpio_interrupt/gpio_interrupt.ino Arduino Unity tests implementing all GPIO interrupt scenarios.
tests/validation/gpio_interrupt/ci.json Enables Wokwi‐only CI for interrupt tests.
tests/validation/gpio_interrupt/diagram.*.json Added Wokwi diagrams for ESP32, ESP32‐S2, S3, C3, C6, P4, H2 boards for interrupt tests.
tests/validation/gpio/scenario.yaml Updated basic GPIO read/write scenario with explicit expect‐pin steps.
tests/validation/gpio/gpio.ino Refactored from a single counter test into separate Unity tests for read and write.
tests/validation/gpio/test_gpio.py Simplified Python test to verify completion marker.
tests/validation/gpio/diagram.*.json Updated Wokwi diagrams for multiple ESP32 variants for basic GPIO tests.
Comments suppressed due to low confidence (3)

tests/validation/gpio/gpio.ino:2

  • Add #include <Arduino.h> before using pinMode and digitalRead to ensure the Arduino core APIs are available.
#include <unity.h>

tests/validation/gpio/scenario.yaml:3

  • [nitpick] Combine or reformat the author field into a single clear string (e.g., comma-separated or 'and') to keep the YAML clean and valid.
author: Jan Prochazka ([email protected]) + Jakub Andrysek ([email protected])

tests/validation/gpio/test_gpio.py:4

  • [nitpick] This test only checks the end marker; consider adding assertions for intermediate serial messages or pin state checks to improve coverage of the read/write behavior.
def test_gpio(dut):

}

void test_write_basic(void) {
Serial.println("GPIO write - basic test");
Copy link
Preview

Copilot AI Jun 13, 2025

Choose a reason for hiding this comment

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

This print message doesn’t match scenario.yaml, which expects "GPIO write - basic START". Update it to match the scenario.

Suggested change
Serial.println("GPIO write - basic test");
Serial.println("GPIO write - basic START");

Copilot uses AI. Check for mistakes.

Comment on lines +15 to +16
assert(digitalRead(BTN) == 1);
TEST_ASSERT_EQUAL(HIGH, digitalRead(BTN));
Copy link
Preview

Copilot AI Jun 13, 2025

Choose a reason for hiding this comment

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

[nitpick] Replace the raw C assert() with a Unity assertion macro (e.g., TEST_ASSERT_EQUAL) for consistent test reporting.

Suggested change
assert(digitalRead(BTN) == 1);
TEST_ASSERT_EQUAL(HIGH, digitalRead(BTN));
TEST_ASSERT_EQUAL(HIGH, digitalRead(BTN));
TEST_ASSERT_EQUAL(HIGH, digitalRead(BTN));

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant