-
-
Notifications
You must be signed in to change notification settings - Fork 117
Add Wokwi ESP32 simulator CI workflow with Playwright web interface testing #305
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
base: mdev
Are you sure you want to change the base?
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>
Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>
…compatibility Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>
|
@copilot why are we still getting errors for missing WOKWI_CLI_TOKEN when I have added as both environment secret and GitHub actions repository secret? |
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
The workflow was missing the The Wokwi CLI requires this token to authenticate. The workflow now references |
|
@copilot Error: wokwi.toml not found in /home/runner/work/WLED-MM/WLED-MM/test/wokwi/diagram.json. |
…json path Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
Fixed in commit 685c75d. The issue was that |
|
@copilot Wokwi CLI v0.19.1 (e0043c48bf15) |
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
Fixed in commit ae0b312. The token was set as an environment variable in the workflow step but wasn't being passed to the child process that runs |
|
@coderabbitai do you have any insight as to why we are seeing this error in the most recent run API Error: Unauthorized |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 4050 🏁 Script executed: Length of output: 934 🏁 Script executed: Length of output: 154 @netmindz The "Unauthorized" error from Wokwi CLI indicates the authentication token isn't being properly recognized. Based on the workflow configuration, here are the likely issues: Probable Causes
Verification StepsHow to Fix
Debug OptionTo confirm the token is being passed (without exposing it), you could temporarily add this to the workflow before the wokwi-cli call: This will help confirm whether the secret is reaching the script. 🏁 Script executed: Length of output: 2769 🏁 Script executed: Length of output: 33 @netmindz Based on the analysis, here's what's happening and how to fix it: Root CauseYour workflow cannot access environment secrets because it doesn't specify an Step-by-Step Fix1. Verify Current Secret ConfigurationVisit this URL (requires repository admin access): Check:
2. Add/Update Repository Secret
3. Get a Fresh Token (if needed)If you're unsure about your token's validity:
4. Add Debug Logging to WorkflowTo help diagnose this in the future, I recommend adding this debug step to your workflow. Add it right before the "Start Wokwi simulator in background" step: - name: Debug - Verify token is set
run: |
if [ -z "$WOKWI_CLI_TOKEN" ]; then
echo "❌ ERROR: WOKWI_CLI_TOKEN is not set"
echo "Please configure WOKWI_CLI_TOKEN as a repository secret"
exit 1
else
echo "✅ WOKWI_CLI_TOKEN is set (length: ${#WOKWI_CLI_TOKEN} characters)"
fi
env:
WOKWI_CLI_TOKEN: ${{ secrets.WOKWI_CLI_TOKEN }}This will fail fast with a clear error message if the secret isn't configured. Why This HappensGitHub Actions has two types of secrets:
Your workflow uses the default approach without an environment, so it needs a repository secret. Next StepsAfter configuring the repository secret:
Let me know if you still see the error after verifying the repository secret is properly configured! 🚀 |
|
@copilot please apply recommendation 4 |
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
Applied in commit 9c0bb96. Added the debug verification step that will check if |
Plan for Wokwi CI Integration
Implementation Summary
What Was Implemented
A complete CI workflow using Wokwi ESP32 simulator and Playwright for automated testing of WLED-MM's web interface. This addresses the issue of having reliable E2E testing without the complexity and compatibility issues of QEMU.
Latest Update (Commit: Add debug step)
Added a debug verification step before running the Wokwi simulator. This step checks if
WOKWI_CLI_TOKENis set and displays its length (without exposing the actual value). This will help quickly identify if the secret is properly configured as a repository secret.Core Components Created
Wokwi Configuration (
test/wokwi/):diagram.json: Defines ESP32 DevKit hardwarewokwi.toml: Configures firmware location and port forwarding (port 80 → localhost:8080)prepare-firmware.sh: Copies built firmware to test directoryrun-simulator.sh: Starts Wokwi CLI simulatorREADME.md: Complete documentation for local testingPlaywright Test Suite (
test/playwright/wokwi-basic.spec.js):GitHub Actions Workflow (
.github/workflows/wokwi-test.yml):mdevandcopilot/**branchesmdevnpm run buildesp32dev_compattargetConfiguration Updates:
package.jsonpackage-lock.jsonwith new dependenciestest:cdata,test:wokwi).gitignoreto exclude test artifactstools/cdata-test.jsfor build validationKey Features
Testing Approach
The implementation follows the issue requirements by:
Next Steps for Maintainers
WOKWI_CLI_TOKENwith token from https://wokwi.com/dashboard/ciOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.