Skip to content

Conversation

@gabsuren
Copy link
Collaborator

@gabsuren gabsuren commented Nov 28, 2025

Note

Adds an Autobahn testsuite example and Linux CI to build/run it and upload reports, plus safer websocket transport error logging and minor linux_compat timer deps.

  • Examples:
    • Autobahn testsuite: New components/esp_websocket_client/examples/autobahn-testsuite with Docker configs, quick/full configs, scripts (run_tests.sh, monitor_serial.py, generate_summary.py, etc.), and a testee app to run all cases and generate reports.
  • CI:
    • Linux workflow (.github/workflows/autobahn__linux-test.yml): starts fuzzing server, builds Linux testee, runs tests, generates summary, uploads reports.
    • Target build workflow (.github/workflows/autobahn__target-test.yml): builds and merges ESP32 binaries for the testee (run-on-target job stubbed/commented).
  • WebSocket client (components/esp_websocket_client/esp_websocket_client.c): safer transport error logging using guarded esp_err_to_name() across write/read/connect/poll paths.
  • Linux compat timer:
    • Add esp_common requirement and include esp_err.h in esp_timer linux shim.

Written by Cursor Bugbot for commit fa1ef1a. This will update automatically on new commits. Configure here.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@gabsuren gabsuren force-pushed the test/autobah-testsuite-2 branch 10 times, most recently from 338e6c6 to 0b8ebbf Compare December 3, 2025 10:54
@gabsuren gabsuren force-pushed the test/autobah-testsuite-2 branch 2 times, most recently from c6f9902 to 20bbe35 Compare December 8, 2025 11:09
@gabsuren gabsuren marked this pull request as ready for review December 8, 2025 11:11
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on December 20

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@gabsuren gabsuren changed the title feat(examples): websocket autobahn test suit integration feat(examples): websocket autobahn test suit integration (IDF-14864) Dec 8, 2025
@gabsuren gabsuren force-pushed the test/autobah-testsuite-2 branch from 20bbe35 to 138574c Compare December 8, 2025 11:54
@gabsuren gabsuren self-assigned this Dec 8, 2025
@gabsuren gabsuren force-pushed the test/autobah-testsuite-2 branch from 138574c to 473ca9f Compare December 8, 2025 14:12
@gabsuren gabsuren force-pushed the test/autobah-testsuite-2 branch 3 times, most recently from 875d3b8 to 048b0c5 Compare December 9, 2025 16:00
if: github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'autobahn'))

env:
TEST_DIR: components/esp_websocket_client/examples/autobahn-testsuite
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should move this to a different place, as this isn't an example. Better to create a test folder.

- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
Copy link
Collaborator

Choose a reason for hiding this comment

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

Websocket client doesn't require the submodules, right?

docker logs fuzzing-server
exit 1
- name: Build testee (Linux target)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- name: Build testee (Linux target)
- name: Build test (Linux target)

jobs:
build_autobahn:
# Run on push to master or if PR has 'websocket' label
if: contains(github.event.pull_request.labels.*.name, 'autobahn') || github.event_name == 'push'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if: contains(github.event.pull_request.labels.*.name, 'autobahn') || github.event_name == 'push'
if: contains(github.event.pull_request.labels.*.name, 'websocket-autobahn') || github.event_name == 'push'

name: Build
strategy:
matrix:
#idf_ver: ["release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3", "latest"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should cover IDF versions that are currently in service period[5.5, latest], and we should at least have a manual run on older idf versions to identify potential fix to be added.

#define BUFFER_SIZE 16384 // Reduced from 32768 to free memory for accumulator buffer
#define START_CASE 1
#define END_CASE 300
// Configure test range here:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This comment is misplaced as it refers to the range above. We could have esp_console for this and have this as runtime option.

@@ -0,0 +1,10 @@
# Conditionally require components based on target
if(${IDF_TARGET} STREQUAL "linux")
Copy link
Collaborator

Choose a reason for hiding this comment

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

This could be simplified and more maintenable if we create a base list with common components and extend it with the specific and add that list to the requirements.

# COMPONENTS must be set before include() to limit component scanning
if(${IDF_TARGET} STREQUAL "linux")
set(common_component_dir ../../../../../common_components)
set(EXTRA_COMPONENT_DIRS
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should move this to be handled by component manager.

esp_websocket_client_error(client, "esp_transport_connect() failed with %d, "
"transport_error=%s, tls_error_code=%i, tls_flags=%i, esp_ws_handshake_status_code=%d, errno=%d",
result, esp_err_to_name(error_handle->last_error), error_handle->esp_tls_error_code,
result, error_name ? error_name : "UNKNOWN", error_handle->esp_tls_error_code,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this necessary? esp_err_to_name handles inexistent code and from quick code inspection always returns a valid pointer.

```
This generates a detailed console summary and an HTML summary at `reports/summary.html`.

**Option 3: Direct File Access**
Copy link
Collaborator

Choose a reason for hiding this comment

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

This are unnecessary instructions.

@gabsuren gabsuren force-pushed the test/autobah-testsuite-2 branch from 048b0c5 to fa1ef1a Compare December 18, 2025 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants