Skip to content

Support running PolyScope X robot in remote control mode in CI - #553

Merged
urfeex merged 14 commits into
UniversalRobots:masterfrom
urfeex:feat/polyscope-x-remote-control-runtime-flag
Aug 20, 2026
Merged

Support running PolyScope X robot in remote control mode in CI#553
urfeex merged 14 commits into
UniversalRobots:masterfrom
urfeex:feat/polyscope-x-remote-control-runtime-flag

Conversation

@urfeex

@urfeex urfeex commented Aug 18, 2026

Copy link
Copy Markdown
Member

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:

  • Add a preconditioned citadel folder that can be mounted in the CI container
  • Add a command line option to start_ursim.sh to mount a citadel folder (plus tests for that flag)
  • Change check for remote control tests to a runtime flag rather than a CMake variable. This allows using the same build for all matrix entries.
  • Take screenshots of the PolyScope UI in case a dashboard client test fails. This could potentially be moved to all tests, but for the scope of this PR it's left there.

Note

Cursor Bugbot is generating a summary for commit 48347f3. Configure here.

@urfeex urfeex added the CI label Aug 18, 2026
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.31%. Comparing base (a854de9) to head (1a92f65).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
scripts/start_ursim.sh 96.66% 1 Missing ⚠️
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     
Flag Coverage Δ
check_version_ur10-3.15.8 11.75% <ø> (-0.97%) ⬇️
check_version_ur10e-10.11.0 11.50% <ø> (-0.11%) ⬇️
check_version_ur10e-5.15.2 11.50% <ø> (-1.20%) ⬇️
check_version_ur12e-10.12.1 11.50% <ø> (-0.11%) ⬇️
check_version_ur12e-5.25.1 11.70% <ø> (-0.01%) ⬇️
check_version_ur15-10.12.1 11.55% <ø> (-0.07%) ⬇️
check_version_ur15-5.25.1 11.50% <ø> (-0.21%) ⬇️
check_version_ur16e-10.12.1 11.50% <ø> (-0.11%) ⬇️
check_version_ur16e-5.25.1 11.50% <ø> (-0.46%) ⬇️
check_version_ur18-10.12.1 11.55% <ø> (+0.02%) ⬆️
check_version_ur18-5.25.1 11.50% <ø> (-0.25%) ⬇️
check_version_ur20-10.12.1 11.50% <ø> (-0.11%) ⬇️
check_version_ur20-5.25.1 11.50% <ø> (-0.76%) ⬇️
check_version_ur3-3.14.3 11.70% <ø> (-0.48%) ⬇️
check_version_ur30-10.12.1 11.50% <ø> (-0.11%) ⬇️
check_version_ur30-5.25.1 11.50% <ø> (-0.55%) ⬇️
check_version_ur3e-10.11.0 11.50% <ø> (-0.11%) ⬇️
check_version_ur3e-5.9.4 11.55% <ø> (-0.56%) ⬇️
check_version_ur5-3.15.8 10.91% <ø> (-1.02%) ⬇️
check_version_ur5e-10.11.0 11.50% <ø> (-0.07%) ⬇️
check_version_ur5e-5.12.8 11.70% <ø> (-0.40%) ⬇️
check_version_ur7e-10.11.0 11.50% <ø> (-0.07%) ⬇️
check_version_ur7e-5.22.2 11.70% <ø> (-0.09%) ⬇️
check_version_ur8long-10.12.1 11.55% <ø> (-0.07%) ⬇️
check_version_ur8long-5.25.1 11.70% <ø> (-0.56%) ⬇️
python_scripts 75.90% <ø> (ø)
start_ursim 85.52% <96.66%> (-0.86%) ⬇️
ur20-latest 75.46% <ø> (-0.13%) ⬇️
ur5-3.14.3 75.36% <ø> (-0.20%) ⬇️
ur5e-10.11.0 70.07% <ø> (+0.17%) ⬆️
ur5e-10.12.0 71.07% <ø> (-0.22%) ⬇️
ur5e-10.7.0 69.45% <ø> (+0.16%) ⬆️
ur5e-5.9.4 75.80% <ø> (-0.16%) ⬇️
ur7e-10.13.0 71.86% <ø> (+0.76%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

  • filename and 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 || true then hides the failure, leaving no diagnostic artifact. Shell-quote each dynamic argument (or avoid std::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.

Comment thread tests/test_dashboard_client_x.cpp
Comment thread scripts/start_ursim.sh Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 17 changed files in this pull request and generated 1 comment.

Comment thread tests/test_dashboard_client_x.cpp Outdated
Comment on lines +533 to +536
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());

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

  • -c is 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);

@urfeex
urfeex requested a review from a team August 20, 2026 09:45
@urfeex
urfeex marked this pull request as ready for review August 20, 2026 09:46
Comment thread .github/workflows/ci.yml
Copilot AI review requested due to automatic review settings August 20, 2026 10:03
Comment thread .github/workflows/ci.yml Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 17 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 20, 2026 10:24
Comment thread .github/workflows/ci.yml Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 17 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/ci.yml Outdated
Copilot AI review requested due to automatic review settings August 20, 2026 10:46
@urfeex
urfeex force-pushed the feat/polyscope-x-remote-control-runtime-flag branch from 232e406 to 1a92f65 Compare August 20, 2026 10:46

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 1a92f65. Configure here.

Comment thread .github/workflows/ci.yml

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 -c for 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);
    }

@mergify

mergify Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@urfeex
urfeex merged commit dde4869 into UniversalRobots:master Aug 20, 2026
91 of 98 checks passed
@urfeex
urfeex deleted the feat/polyscope-x-remote-control-runtime-flag branch August 20, 2026 13:26
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.

3 participants