Support running PolyScope X robot in remote control mode in CI - #553
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #553 +/- ##
==========================================
+ Coverage 78.85% 80.31% +1.45%
==========================================
Files 116 116
Lines 7633 6974 -659
Branches 3153 3083 -70
==========================================
- Hits 6019 5601 -418
+ Misses 1224 993 -231
+ Partials 390 380 -10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
This way we can delay taking the screenshot
There was a problem hiding this comment.
Pull request overview
Enables PolyScope X 10.13 CI tests to run in remote-control mode with failure diagnostics.
Changes:
- Adds Citadel persistence mounting and CI configuration.
- Replaces the compile-time remote-control flag with a runtime environment variable.
- Captures screenshots and URSim logs after failures.
Reviewed changes
Copilot reviewed 10 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/ci.yml |
Configures remote-control CI and artifacts. |
scripts/start_ursim.sh |
Adds Citadel volume mounting. |
tests/CMakeLists.txt |
Removes the compile-time flag. |
tests/test_start_ursim.bats |
Tests Citadel mount behavior. |
tests/test_dashboard_client_x.cpp |
Uses runtime configuration and captures screenshots. |
tests/resources/polyscopex_screenshot.py |
Implements Playwright screenshots. |
tests/resources/dockerursim/citadelDB/KEYREGISTRY |
Supplies persisted Citadel data. |
tests/resources/dockerursim/programs/polyscopex/10.13.0/ur7e/.allow-empty |
Preserves the generated program directory. |
tests/resources/dockerursim/programs/polyscopex/10.13.0/ur7e/.id-counters.json |
Stores generated program counters. |
tests/resources/dockerursim/programs/polyscopex/10.13.0/ur7e/blobs/4.blob |
Adds a generated program snapshot. |
tests/resources/dockerursim/programs/polyscopex/10.13.0/ur7e/blobs/5.blob |
Adds a generated program snapshot. |
Suppressed comments (1)
tests/test_dashboard_client_x.cpp:534
filenameand the robot URL are concatenated into a shell command without escaping. A screenshot directory containing spaces or shell metacharacters is split/interpreted by the shell, and|| truethen hides the failure, leaving no diagnostic artifact. Shell-quote each dynamic argument (or avoidstd::system).
std::string cmd = "python3 ../tests/resources/polyscopex_screenshot.py"
" http://" +
g_ROBOT_IP + " " + filename + " 5000 2>/dev/null || true";
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| std::string cmd = "python3 ../tests/resources/polyscopex_screenshot.py" | ||
| " http://" + | ||
| g_ROBOT_IP + " " + filename + " 5000 2>/dev/null || true"; | ||
| [[maybe_unused]] int ret = std::system(cmd.c_str()); |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 17 changed files in this pull request and generated no new comments.
Suppressed comments (2)
scripts/start_ursim.sh:508
-cis mounted for every PolyScope X version, although this volume is only supported from 10.13.0. On 10.7–10.12 the option therefore launches an unsupported container configuration instead of rejecting the request. Please validate the version before adding the mount (and cover the rejection in the Bats tests).
if [ -n "$CITADEL_DB_STORAGE_ARG" ]; then
mkdir -p "$CITADEL_DB_STORAGE_ARG"
CITADEL_DB_STORAGE=$(realpath "$CITADEL_DB_STORAGE_ARG")
docker_args+=(-v "${CITADEL_DB_STORAGE}:/citadelDB")
fi
tests/test_dashboard_client_x.cpp:565
- Screenshot failures are completely silent: the child’s stderr is discarded and its exit status is ignored. If Python, Playwright, browser startup, or navigation fails, CI produces no screenshot and the artifact step also ignores the empty directory, defeating this diagnostic. Preserve stderr and report fork/wait/nonzero-exit failures.
int devnull = open("/dev/null", O_WRONLY);
if (devnull >= 0)
{
dup2(devnull, STDERR_FILENO);
close(devnull);
}
execvp("python3", args.data());
_exit(1);
}
else if (pid > 0)
{
waitpid(pid, nullptr, 0);
232e406 to
1a92f65
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 1a92f65. Configure here.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 17 changed files in this pull request and generated no new comments.
Suppressed comments (2)
scripts/start_ursim.sh:54
- The new option is documented as enabling persistence for all PolyScope X releases, but the feature is only supported starting with 10.13.0. Since the script also accepts
-cfor older 10.x images, users can receive a successful startup while the setting is not preserved. Please state the minimum supported version here.
Only used for PolyScope X. Enables persisting settings such as
remote-control mode across container restarts.
tests/test_dashboard_client_x.cpp:565
- The screenshot subprocess status is discarded, while its stderr is redirected to
/dev/null. If Python, Playwright, Chromium, navigation, or file creation fails, CI silently uploads no screenshot, defeating this failure diagnostic. Check the child status (and fork failure) and emit an error so the missing artifact is actionable.
else if (pid > 0)
{
waitpid(pid, nullptr, 0);
}
|
Tick the box to add this pull request to the merge queue (same as
|

Since PolyScope X 10.13.0 we have the option to mount the citadel folder into the Docker container which preserves the setting for remote_control across boots. Thus, we can provision our CI container to start in remote control mode which allows executing tests that require remote_control mode.
In particular, this PR contains the following changes:
Note
Cursor Bugbot is generating a summary for commit 48347f3. Configure here.