Skip to content

Commit 42a7c77

Browse files
authored
Merge pull request #2373 from plotly/ci-retry
Auto-retry jasmine test on CI
2 parents 552e471 + e298acf commit 42a7c77

File tree

5 files changed

+27
-7
lines changed

5 files changed

+27
-7
lines changed

.circleci/test.sh

+23-3
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,37 @@ set +e
55
set +o pipefail
66

77
EXIT_STATE=0
8+
MAX_AUTO_RETRY=5
9+
10+
# inspired by https://unix.stackexchange.com/a/82602
11+
retry () {
12+
local n=0
13+
14+
until [ $n -ge $MAX_AUTO_RETRY ]; do
15+
"$@" && break
16+
n=$[$n+1]
17+
echo ''
18+
echo run $n of $MAX_AUTO_RETRY failed, trying again ...
19+
echo ''
20+
sleep 15
21+
done
22+
23+
if [ $n -eq $MAX_AUTO_RETRY ]; then
24+
EXIT_STATE=1
25+
fi
26+
}
827

928
case $1 in
1029

1130
jasmine)
12-
npm run test-jasmine -- --skip-tags=gl,noCI || EXIT_STATE=$?
31+
npm run test-jasmine -- --skip-tags=gl,noCI,flaky || EXIT_STATE=$?
1332
exit $EXIT_STATE
1433
;;
1534

1635
jasmine2)
17-
npm run test-jasmine -- --tags=gl --skip-tags=noCI || EXIT_STATE=$?
18-
npm run test-bundle || EXIT_STATE=$?
36+
npm run test-jasmine -- --tags=gl --skip-tags=noCI,flaky || EXIT_STATE=$?
37+
retry npm run test-jasmine -- --tags=flaky --skip-tags=noCI
38+
npm run test-bundle || EXIT_STATE=$?
1939
exit $EXIT_STATE
2040
;;
2141

test/jasmine/tests/animate_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ describe('Animating multiple axes', function() {
720720
destroyGraphDiv();
721721
});
722722

723-
it('updates ranges of secondary axes', function(done) {
723+
it('@flaky updates ranges of secondary axes', function(done) {
724724
Plotly.plot(gd, [
725725
{y: [1, 2, 3]},
726726
{y: [1, 2, 3], yaxis: 'y2'}

test/jasmine/tests/gl2d_plot_interact_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ describe('@gl Test gl2d plots', function() {
250250
});
251251
}
252252

253-
it('should respond to drag interactions', function(done) {
253+
it('@flaky should respond to drag interactions', function(done) {
254254
var _mock = Lib.extendDeep({}, mock);
255255

256256
var relayoutCallback = jasmine.createSpy('relayoutCallback');

test/jasmine/tests/parcoords_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ describe('@gl parcoords', function() {
774774

775775
});
776776

777-
it('Calling `Plotly.animate` with patches targeting `dimensions` attributes should do the right thing', function(done) {
777+
it('@flaky Calling `Plotly.animate` with patches targeting `dimensions` attributes should do the right thing', function(done) {
778778
Plotly.newPlot(gd, [{
779779
type: 'parcoords',
780780
line: {color: 'blue'},

test/jasmine/tests/select_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ var BOXEVENTS = [1, 2, 1];
107107
// assumes 5 points in the lasso path
108108
var LASSOEVENTS = [4, 2, 1];
109109

110-
describe('Test select box and lasso in general:', function() {
110+
describe('@flaky Test select box and lasso in general:', function() {
111111
var mock = require('@mocks/14.json');
112112
var selectPath = [[93, 193], [143, 193]];
113113
var lassoPath = [[316, 171], [318, 239], [335, 243], [328, 169]];

0 commit comments

Comments
 (0)