Skip to content

Commit 78755a4

Browse files
authored
Clarify Robot Window HTML Test (#6755)
* fix race condition * run test on all platforms * fix test message to reference correct controller * use non-snap firefox * copy previous commit to main CI script * define UBUNTU_VERSION * add sudo to scripts * use correct formatting in apt preferences * specify apt repo in command instead of preferences * debugging * clarify logic * revert firefox changes * revert test-suite change * Revert "debugging" This reverts commit eb14586. * clarify variable initializations * disable robot_window_html test in CI * reenable test on non-linux platforms * cleanup
1 parent 474fd9f commit 78755a4

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

tests/api/controllers/robot_window_html/robot_window_html.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,26 @@
77
#define TIME_STEP 32
88

99
int main(int argc, char **argv) {
10-
bool configured = false, received = false;
1110
ts_setup(argv[0]);
1211

13-
while (!configured) { // receive message sent by the robot window.
12+
for (;;) { // receive message sent by the robot window.
1413
wb_robot_step(TIME_STEP);
15-
const char *configure_message;
16-
while ((configure_message = wb_robot_wwi_receive_text())) {
14+
const char *configure_message = wb_robot_wwi_receive_text();
15+
if (configure_message) {
1716
if (strcmp(configure_message, "configure") == 0) {
18-
configured = true;
19-
wb_robot_wwi_send_text("test wwi functions from complete_test controller.");
17+
wb_robot_wwi_send_text("test wwi functions from robot_window_html controller.");
18+
break;
2019
} else
2120
ts_send_error_and_exit("Wrong configure message received from the HTML robot-window: %s", configure_message);
2221
}
2322
}
2423

25-
while (!received) { // receive message sent by Webots.
24+
for (;;) { // receive message sent by Webots.
2625
wb_robot_step(TIME_STEP);
27-
const char *test_message;
28-
while ((test_message = wb_robot_wwi_receive_text())) {
29-
if (strcmp(test_message, "Answer: test wwi functions from complete_test controller.") == 0)
30-
received = true;
26+
const char *test_message = wb_robot_wwi_receive_text();
27+
if (test_message) {
28+
if (strcmp(test_message, "Answer: test wwi functions from robot_window_html controller.") == 0)
29+
break;
3130
else
3231
ts_send_error_and_exit("Wrong test message received from the HTML robot-window: %s", test_message);
3332
}

tests/test_suite.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,17 +199,19 @@ def generateWorldsList(groupName):
199199
# to file
200200
for filename in filenames:
201201
# speaker test not working on github action because of missing sound drivers
202-
# robot window and movie recording test not working on BETA Ubuntu 22.04 GitHub Action environment
202+
# robot window test cannot open a browser for the robot window in a headless environment
203+
# on non-mac operating systems
204+
# movie recording test not working on BETA Ubuntu 22.04 GitHub Action environment
203205
# billboard test not working in macos GitHub Action environment
204206
# billboard and robot window not working on windows GitHub Action environment.
205207
if (not filename.endswith('_temp.wbt') and
206208
not ('GITHUB_ACTIONS' in os.environ and (
207209
filename.endswith('speaker.wbt') or
208210
filename.endswith('local_proto_with_texture.wbt') or
209-
(filename.endswith('robot_window_html.wbt') and is_ubuntu_22_04) or
210211
(filename.endswith('supervisor_start_stop_movie.wbt') and is_ubuntu_22_04) or
211212
(filename.endswith('billboard.wbt') and sys.platform == 'darwin') or
212213
(filename.endswith('billboard.wbt') and sys.platform == 'win32') or
214+
(filename.endswith('robot_window_html.wbt') and sys.platform == 'linux') or
213215
(filename.endswith('robot_window_html.wbt') and sys.platform == 'win32')
214216
))):
215217
worldsList.append(filename)

0 commit comments

Comments
 (0)