File tree Expand file tree Collapse file tree 5 files changed +40
-9
lines changed Expand file tree Collapse file tree 5 files changed +40
-9
lines changed Original file line number Diff line number Diff line change @@ -158,5 +158,5 @@ jobs:
158
158
run : |
159
159
podman run --user=2000:2000 --shm-size=1g \
160
160
-v `pwd`/test/rerun.robot:/opt/robotframework/tests/rerun.robot:Z \
161
- -e ROBOT_RERUN_FAILED=20 \
161
+ -e ROBOT_RERUN_FAILED=50 \
162
162
$IMAGE_NAME
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ ENV ROBOT_WORK_DIR /opt/robotframework/temp
18
18
# Set the maximum number of rounds to rerun failed tests
19
19
ENV ROBOT_RERUN_FAILED 0
20
20
21
+ # Options to the rebot command when rerunning failed tests
22
+ ENV ROBOT_RERUN_REBOT_OPTIONS ""
23
+
21
24
# Setup X Window Virtual Framebuffer
22
25
ENV SCREEN_COLOUR_DEPTH 24
23
26
ENV SCREEN_HEIGHT 1080
Original file line number Diff line number Diff line change 14
14
* [ Testing emails] ( #testing-emails )
15
15
* [ Dealing with Datetimes and Timezones] ( #dealing-with-datetimes-and-timezones )
16
16
* [ Installing additional dependencies] ( #installing-additional-dependencies )
17
+ * [ Rerunning tests] ( #rerunning-tests )
17
18
* [ Security consideration] ( #security-consideration )
18
19
* [ Continuous integration] ( #continuous-integration )
19
20
* [ Azure DevOps pipeline] ( #ci-azure-devops )
Original file line number Diff line number Diff line change 53
53
54
54
ROBOT_EXIT_CODE=$?
55
55
56
- if [[ ${ROBOT_EXIT_CODE} -gt 0 ] ]
56
+ if [ ${ROBOT_EXIT_CODE} -gt 0 ]
57
57
then
58
58
for (( i = 0 ; i < ${ROBOT_RERUN_FAILED} ; i++ ))
59
59
do
60
- echo " Rerunning failed tests, round ${i} ..."
60
+ echo " Rerunning failed tests, round $(( i+ 1 )) ..."
61
+
62
+ # Store previous run into a tarball as screenshots etc from the previous run are removed by rebot
63
+ (cd $ROBOT_REPORTS_FINAL_DIR && tar czf report_run_${i} .tar.gz browser * .html * .xml * .log * .png)
64
+
61
65
xvfb-run \
62
66
--server-args=" -screen 0 ${SCREEN_WIDTH} x${SCREEN_HEIGHT} x${SCREEN_COLOUR_DEPTH} -ac" \
63
67
robot \
68
72
$ROBOT_TESTS_DIR
69
73
70
74
ROBOT_EXIT_CODE=$?
71
-
75
+
72
76
rebot \
73
77
--outputDir $ROBOT_REPORTS_FINAL_DIR \
74
- --merge $ROBOT_REPORTS_FINAL_DIR /output_rerun.xml \
75
- $ROBOT_REPORTS_FINAL_DIR /output.xml
78
+ --output $ROBOT_REPORTS_FINAL_DIR /output.xml \
79
+ --merge $ROBOT_REPORTS_FINAL_DIR /output.xml \
80
+ ${ROBOT_RERUN_REBOT_OPTIONS} \
81
+ $ROBOT_REPORTS_FINAL_DIR /output_rerun.xml \
82
+ > /dev/null
83
+
84
+ rm $ROBOT_REPORTS_FINAL_DIR /output_rerun.xml
76
85
77
86
if [ ${ROBOT_EXIT_CODE} -eq 0 ]
78
87
then
Original file line number Diff line number Diff line change 1
1
*** Test Cases ***
2
2
3
- Randomly Fail Test
4
- ${rand } = Evaluate random.randint(0,3)
5
- IF ${rand } > 0
3
+ Roll Dice 1
4
+ ${rand } = Evaluate random.randint(1,6)
5
+ IF ${rand } > 1
6
+ Fail
7
+ END
8
+
9
+ Roll Dice 2
10
+ ${rand } = Evaluate random.randint(1,6)
11
+ IF ${rand } > 1
12
+ Fail
13
+ END
14
+
15
+ Roll Dice 3
16
+ ${rand } = Evaluate random.randint(1,6)
17
+ IF ${rand } > 1
18
+ Fail
19
+ END
20
+
21
+ Roll Dice 4
22
+ ${rand } = Evaluate random.randint(1,6)
23
+ IF ${rand } > 1
6
24
Fail
7
25
END
You can’t perform that action at this time.
0 commit comments