Skip to content

Conversation

@JakubAndrysek
Copy link
Owner

@JakubAndrysek JakubAndrysek commented Dec 2, 2025

This pull request introduces a new filesystem validation test suite for ESP32, covering SPIFFS, FFat, and LittleFS implementations. It adds comprehensive documentation, configuration files, and a basic test runner to facilitate automated testing and highlight differences between the filesystems.

Test Suite and Documentation

  • Added a detailed README.md explaining the scope, test categories, and known filesystem-specific behaviours for SPIFFS, FFat, and LittleFS.

Test and Configuration Files

  • Added a partition table (partitions.csv) defining regions for each filesystem type to support the test suite.
  • Added a CI configuration file (ci.yml) specifying that QEMU is not used for these tests.
  • Added a test runner script (test_fs.py) that uses pytest_embedded and pytest_embedded_wokwi to execute the Unity-based tests on the DUT (Device Under Test).

Test scenarios

Tested in Wokwi:
esp32: SUCCESS
esp32c3: SUCCESS
esp32c6: SUCCESS
esp32h2: SUCCESS
esp32p4: SUCCESS
esp32s2: SUCCESS
esp32s3: SUCCESS

Also successfully tested on esp32 and esp32s3.

@github-actions
Copy link

github-actions bot commented Dec 2, 2025

Messages
📖 🎉 Good Job! All checks are passing!

👋 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.
- 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 b67360f

Copy link

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 adds a comprehensive filesystem validation test suite for ESP32, testing three filesystem implementations (SPIFFS, FFat, and LittleFS) through a unified test interface.

Key Changes:

  • Comprehensive test coverage for filesystem operations including basic I/O, directory operations, binary data handling, seek operations, and edge cases
  • Unified test abstraction layer using IFileSystem interface and WrappedFS template wrapper to test all three filesystem types with the same test suite
  • Custom partition table configured to allocate space for all three filesystems plus NVS and coredump partitions

Reviewed changes

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

Show a summary per file
File Description
tests/validation/fs/fs.ino Main test implementation with 760 lines covering 16 test cases across filesystem operations
tests/validation/fs/test_fs.py Python test runner using pytest-embedded framework to execute Unity test output
tests/validation/fs/partitions.csv Partition table defining storage allocation for NVS, app, and all three filesystem types
tests/validation/fs/ci.yml CI configuration disabling QEMU testing for this suite
tests/validation/fs/README.md Documentation describing test suite, filesystem types, and known filesystem-specific behaviors

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +172 to +177
String expectedPath = String(fileBasePath) + String("/file") + String(count) + String(".txt");
TEST_ASSERT_EQUAL_STRING_MESSAGE(expectedPath.c_str(), e.path(), "File path mismatch");
String content = e.readString();
String expectedContent = "data:" + String(count);
TEST_ASSERT_EQUAL_STRING_MESSAGE(expectedContent.c_str(), content.c_str(), "File content mismatch");
count++;
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

This test assumes files will be listed in creation order (file0.txt, file1.txt, etc.), but directory listing order is not guaranteed by all filesystem implementations. Some filesystems may return files in a different order (e.g., alphabetical, hash-based, or arbitrary). Consider either sorting the results before validation, or checking that all expected files exist without assuming order.

Copilot uses AI. Check for mistakes.
size_t initialUsed = gFS->usedBytes();
size_t total = gFS->totalBytes();
TEST_ASSERT_GREATER_THAN(0, (int)total);
TEST_ASSERT_LESS_OR_EQUAL_UINT32(total, (uint32_t)initialUsed);
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

Logic error: this assertion checks that total <= initialUsed, which would mean the used bytes is greater than or equal to total bytes. This should be TEST_ASSERT_LESS_OR_EQUAL_UINT32(initialUsed, (uint32_t)total) to verify that used bytes is less than or equal to total bytes.

Suggested change
TEST_ASSERT_LESS_OR_EQUAL_UINT32(total, (uint32_t)initialUsed);
TEST_ASSERT_LESS_OR_EQUAL_UINT32(initialUsed, (uint32_t)total);

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

github-actions bot commented Dec 2, 2025

Test Results

 83 files   83 suites   16m 24s ⏱️
 39 tests  38 ✅ 0 💤 0 ❌ 1 🔥
248 runs  241 ✅ 0 💤 0 ❌ 7 🔥

For more details on these errors, see this check.

Results for commit 0006d04.

♻️ This comment has been updated with latest results.

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.

2 participants