Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix DashboardClient load program from subdir #269

Merged

Conversation

urfeex
Copy link
Member

@urfeex urfeex commented Feb 12, 2025

Fixes #268

Drop checking programState when loading a program

When loading a program from an absolute path or a subdirectory instead
of a file being directly in /programs (or /ursim/programs in the case of
URSim) the check "programState" will only return the filename without
the path while we compare it against the path that was requested to
load.

However, that second check should not be necessary, as the "load" call
will already make sure that the program is loading correctly.

When loading a program from an absolute path or a subdirectory instead
of a file being directly in /programs (or /ursim/programs in the case of
URSim) the check "programState" will only return the filename without
the path while we compare it against the path that was requested to
load.

However, that second check should not be necessary, as the "load" call
will already make sure that the program is loading correctly.
@urfeex urfeex requested a review from urrsk February 12, 2025 14:15
@urfeex urfeex changed the title Db client load program from subdir Fix DashboardClient load program from subdir Feb 12, 2025
@urfeex
Copy link
Member Author

urfeex commented Feb 13, 2025

The test failures indicate that not waiting for program state stopped can cause consecutive play requests to fail. I wasn't able to reproduce this locally, though.

We load the program, which will fail if the program is not found or the
requested file does  not contain a valid program. Afterwards, we wait
until the program state is stopped with a  program named the same as the
requested program. We cannot check the full file path here, but  the
important thing is that the program state is stopped.
Copy link

codecov bot commented Feb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.54%. Comparing base (97ad825) to head (3b9b521).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #269      +/-   ##
==========================================
+ Coverage   73.41%   73.54%   +0.13%     
==========================================
  Files          80       80              
  Lines        3182     3183       +1     
  Branches      398      398              
==========================================
+ Hits         2336     2341       +5     
+ Misses        628      623       -5     
- Partials      218      219       +1     
Flag Coverage Δ
ur20-latest 72.20% <100.00%> (+0.13%) ⬆️
ur5-3.14.3 72.96% <100.00%> (ø)
ur5e-5.9.4 72.71% <100.00%> (ø)

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

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

@urfeex urfeex requested a review from a team February 14, 2025 07:45
@urfeex urfeex merged commit 9890ba7 into UniversalRobots:master Feb 18, 2025
20 of 23 checks passed
@urfeex urfeex deleted the db_client_load_program_from_subdir branch February 18, 2025 07:59
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DashboardClient::commandLoad fails when loading program from a subdirectory
2 participants