Skip to content

Shard gl jasmine tests #2933

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Aug 21, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
enforce @flaky tags on 'it' blocks only
  • Loading branch information
etpinard committed Aug 21, 2018
commit 6d8da960b733b7c7dd219f2925cfda8f90c5f78a
21 changes: 13 additions & 8 deletions tasks/test_syntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ assertES5();
function assertJasmineSuites() {
var BLACK_LIST = ['fdescribe', 'fit', 'xdescribe', 'xit'];
var TAGS = ['noCI', 'noCIdep', 'gl', 'flaky'];
var IT_ONLY_TAGS = ['gl', 'flaky'];
var logs = [];

var addTagPrefix = function(t) { return '@' + t; };

glob(combineGlobs([testGlob, bundleTestGlob]), function(err, files) {
files.forEach(function(file) {
var code = fs.readFileSync(file, 'utf-8');
Expand All @@ -58,7 +61,7 @@ function assertJasmineSuites() {
logs.push([
bn, lineInfo,
'contains an unrecognized tag,',
'not one of: ' + TAGS.map(function(t) { return '\@' + t; }).join(', ')
'not one of: ' + TAGS.map(addTagPrefix).join(', ')
].join(' '));
}
}
Expand All @@ -71,13 +74,15 @@ function assertJasmineSuites() {
}
}

if(isJasmineTestDescribe(node, 'gl')) {
logs.push([
bn, lineInfo,
'contains a @gl tag is a *describe* block,',
'@gl tags are allowed only in jasmine *it* blocks.'
].join(' '));
}
IT_ONLY_TAGS.forEach(function(t) {
if(isJasmineTestDescribe(node, t)) {
logs.push([
bn, lineInfo,
'contains a', addTagPrefix(t), 'tag is a *describe* block,',
addTagPrefix(t), 'tags are only allowed in jasmine *it* blocks.'
].join(' '));
}
});
});
});

Expand Down
56 changes: 28 additions & 28 deletions test/jasmine/tests/select_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ var BOXEVENTS = [1, 2, 1];
// assumes 5 points in the lasso path
var LASSOEVENTS = [4, 2, 1];

describe('@flaky Test select box and lasso in general:', function() {
describe('Test select box and lasso in general:', function() {
var mock = require('@mocks/14.json');
var selectPath = [[93, 193], [143, 193]];
var lassoPath = [[316, 171], [318, 239], [335, 243], [328, 169]];
Expand Down Expand Up @@ -157,7 +157,7 @@ describe('@flaky Test select box and lasso in general:', function() {
.then(done);
});

it('should trigger selecting/selected/deselect events', function(done) {
it('@flaky should trigger selecting/selected/deselect events', function(done) {
resetEvents(gd);

drag(selectPath);
Expand Down Expand Up @@ -196,7 +196,7 @@ describe('@flaky Test select box and lasso in general:', function() {
.then(done);
});

it('should handle add/sub selection', function(done) {
it('@flaky should handle add/sub selection', function(done) {
resetEvents(gd);

drag(selectPath);
Expand Down Expand Up @@ -303,7 +303,7 @@ describe('@flaky Test select box and lasso in general:', function() {
.then(done);
});

it('should trigger selecting/selected/deselect events', function(done) {
it('@flaky should trigger selecting/selected/deselect events', function(done) {
resetEvents(gd);

drag(lassoPath);
Expand Down Expand Up @@ -342,7 +342,7 @@ describe('@flaky Test select box and lasso in general:', function() {
.then(done);
});

it('should set selected points in graph data', function(done) {
it('@flaky should set selected points in graph data', function(done) {
resetEvents(gd);

drag(lassoPath);
Expand All @@ -361,7 +361,7 @@ describe('@flaky Test select box and lasso in general:', function() {
.then(done);
});

it('should set selected points in full data', function(done) {
it('@flaky should set selected points in full data', function(done) {
resetEvents(gd);

drag(lassoPath);
Expand All @@ -380,7 +380,7 @@ describe('@flaky Test select box and lasso in general:', function() {
.then(done);
});

it('should trigger selecting/selected/deselect events for touches', function(done) {
it('@flaky should trigger selecting/selected/deselect events for touches', function(done) {
resetEvents(gd);

drag(lassoPath, {type: 'touch'});
Expand Down Expand Up @@ -415,7 +415,7 @@ describe('@flaky Test select box and lasso in general:', function() {
});
});

it('should skip over non-visible traces', function(done) {
it('@flaky should skip over non-visible traces', function(done) {
// note: this tests a mock with one or several invisible traces
// the invisible traces in the other tests test for multiple
// traces, with some visible and some not.
Expand Down Expand Up @@ -494,7 +494,7 @@ describe('@flaky Test select box and lasso in general:', function() {
.then(done);
});

it('should skip over BADNUM items', function(done) {
it('@flaky should skip over BADNUM items', function(done) {
var data = [{
mode: 'markers',
x: [null, undefined, NaN, 0, 'NA'],
Expand Down Expand Up @@ -533,7 +533,7 @@ describe('@flaky Test select box and lasso in general:', function() {
.then(done);
});

it('scroll zoom should clear selection regions', function(done) {
it('@flaky scroll zoom should clear selection regions', function(done) {
var gd = createGraphDiv();
var mockCopy = Lib.extendDeep({}, mock);
mockCopy.layout.dragmode = 'select';
Expand Down Expand Up @@ -566,7 +566,7 @@ describe('@flaky Test select box and lasso in general:', function() {
.then(done);
});

it('should select the right data with the corresponding select direction', function(done) {
it('@flaky should select the right data with the corresponding select direction', function(done) {

var gd = createGraphDiv();

Expand Down Expand Up @@ -627,7 +627,7 @@ describe('@flaky Test select box and lasso in general:', function() {
.then(done);
});

it('should clear selected points on double click only on pan/lasso modes', function(done) {
it('@flaky should clear selected points on double click only on pan/lasso modes', function(done) {
var gd = createGraphDiv();
var fig = Lib.extendDeep({}, require('@mocks/0.json'));
fig.data = [fig.data[0]];
Expand Down Expand Up @@ -735,7 +735,7 @@ describe('@flaky Test select box and lasso in general:', function() {
.then(done);
});

it('should remember selection polygons from previous select/lasso mode', function(done) {
it('@flaky should remember selection polygons from previous select/lasso mode', function(done) {
var gd = createGraphDiv();
var path1 = [[150, 150], [170, 170]];
var path2 = [[193, 193], [213, 193]];
Expand Down Expand Up @@ -872,7 +872,7 @@ describe('@flaky Test select box and lasso in general:', function() {
});
});

describe('@flaky Test select box and lasso per trace:', function() {
describe('Test select box and lasso per trace:', function() {
var gd;

beforeEach(function() {
Expand Down Expand Up @@ -999,7 +999,7 @@ describe('@flaky Test select box and lasso per trace:', function() {
});
}

it('should work on scatterternary traces', function(done) {
it('@flaky should work on scatterternary traces', function(done) {
var assertPoints = makeAssertPoints(['a', 'b', 'c']);
var assertSelectedPoints = makeAssertSelectedPoints();

Expand Down Expand Up @@ -1052,7 +1052,7 @@ describe('@flaky Test select box and lasso per trace:', function() {
.then(done);
});

it('should work on scattercarpet traces', function(done) {
it('@flaky should work on scattercarpet traces', function(done) {
var assertPoints = makeAssertPoints(['a', 'b']);
var assertSelectedPoints = makeAssertSelectedPoints();

Expand Down Expand Up @@ -1088,7 +1088,7 @@ describe('@flaky Test select box and lasso per trace:', function() {
.then(done);
});

it('@noCI should work on scattermapbox traces', function(done) {
it('@noCI @flaky should work on scattermapbox traces', function(done) {
var assertPoints = makeAssertPoints(['lon', 'lat']);
var assertRanges = makeAssertRanges('mapbox');
var assertLassoPoints = makeAssertLassoPoints('mapbox');
Expand Down Expand Up @@ -1145,7 +1145,7 @@ describe('@flaky Test select box and lasso per trace:', function() {
.then(done);
}, LONG_TIMEOUT_INTERVAL);

it('should work on scattergeo traces', function(done) {
it('@flaky should work on scattergeo traces', function(done) {
var assertPoints = makeAssertPoints(['lon', 'lat']);
var assertSelectedPoints = makeAssertSelectedPoints();
var assertRanges = makeAssertRanges('geo');
Expand Down Expand Up @@ -1244,7 +1244,7 @@ describe('@flaky Test select box and lasso per trace:', function() {
.then(done);
}, LONG_TIMEOUT_INTERVAL);

it('should work on scatterpolar traces', function(done) {
it('@flaky should work on scatterpolar traces', function(done) {
var assertPoints = makeAssertPoints(['r', 'theta']);
var assertSelectedPoints = makeAssertSelectedPoints();

Expand Down Expand Up @@ -1282,7 +1282,7 @@ describe('@flaky Test select box and lasso per trace:', function() {
.then(done);
});

it('should work on choropleth traces', function(done) {
it('@flaky should work on choropleth traces', function(done) {
var assertPoints = makeAssertPoints(['location', 'z']);
var assertSelectedPoints = makeAssertSelectedPoints();
var assertRanges = makeAssertRanges('geo', -0.5);
Expand Down Expand Up @@ -1345,7 +1345,7 @@ describe('@flaky Test select box and lasso per trace:', function() {
.then(done);
}, LONG_TIMEOUT_INTERVAL);

it('should work for bar traces', function(done) {
it('@flaky should work for bar traces', function(done) {
var assertPoints = makeAssertPoints(['curveNumber', 'x', 'y']);
var assertSelectedPoints = makeAssertSelectedPoints();
var assertRanges = makeAssertRanges();
Expand Down Expand Up @@ -1418,7 +1418,7 @@ describe('@flaky Test select box and lasso per trace:', function() {
.then(done);
});

it('should work for date/category traces', function(done) {
it('@flaky should work for date/category traces', function(done) {
var assertPoints = makeAssertPoints(['curveNumber', 'x', 'y']);
var assertSelectedPoints = makeAssertSelectedPoints();

Expand Down Expand Up @@ -1478,7 +1478,7 @@ describe('@flaky Test select box and lasso per trace:', function() {
.then(done);
});

it('should work for histogram traces', function(done) {
it('@flaky should work for histogram traces', function(done) {
var assertPoints = makeAssertPoints(['curveNumber', 'x', 'y', 'pointIndices']);
var assertSelectedPoints = makeAssertSelectedPoints();
var assertRanges = makeAssertRanges();
Expand Down Expand Up @@ -1527,7 +1527,7 @@ describe('@flaky Test select box and lasso per trace:', function() {
.then(done);
});

it('should work for box traces', function(done) {
it('@flaky should work for box traces', function(done) {
var assertPoints = makeAssertPoints(['curveNumber', 'y', 'x']);
var assertSelectedPoints = makeAssertSelectedPoints();
var assertRanges = makeAssertRanges();
Expand Down Expand Up @@ -1591,7 +1591,7 @@ describe('@flaky Test select box and lasso per trace:', function() {
.then(done);
});

it('should work for violin traces', function(done) {
it('@flaky should work for violin traces', function(done) {
var assertPoints = makeAssertPoints(['curveNumber', 'y', 'x']);
var assertSelectedPoints = makeAssertSelectedPoints();
var assertRanges = makeAssertRanges();
Expand Down Expand Up @@ -1655,7 +1655,7 @@ describe('@flaky Test select box and lasso per trace:', function() {
});

['ohlc', 'candlestick'].forEach(function(type) {
it('should work for ' + type + ' traces', function(done) {
it('@flaky should work for ' + type + ' traces', function(done) {
var assertPoints = makeAssertPoints(['curveNumber', 'x', 'open', 'high', 'low', 'close']);
var assertSelectedPoints = makeAssertSelectedPoints();
var assertRanges = makeAssertRanges();
Expand Down Expand Up @@ -1731,7 +1731,7 @@ describe('@flaky Test select box and lasso per trace:', function() {
});
});

it('should work on traces with enabled transforms', function(done) {
it('@flaky should work on traces with enabled transforms', function(done) {
var assertSelectedPoints = makeAssertSelectedPoints();

Plotly.plot(gd, [{
Expand Down Expand Up @@ -1774,7 +1774,7 @@ describe('@flaky Test select box and lasso per trace:', function() {
.then(done);
});

it('should work on scatter/bar traces with text nodes', function(done) {
it('@flaky should work on scatter/bar traces with text nodes', function(done) {
var assertSelectedPoints = makeAssertSelectedPoints();

function assertFillOpacity(exp) {
Expand Down
20 changes: 10 additions & 10 deletions test/jasmine/tests/shapes_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1072,9 +1072,9 @@ describe('A fixed size shape', function() {
// and (ii) line has a different resize behavior.
var shapeAndResizeTypes = combinations([{type: 'rect'}, {type: 'circle'}], resizeTypes);
shapeAndResizeTypes.forEach(function(testCase) {
describe('@flaky of type ' + testCase.type + ' can be ' + testCase.resizeDisplayName, function() {
describe('of type ' + testCase.type + ' can be ' + testCase.resizeDisplayName, function() {
resizeDirections.forEach(function(direction) {
it('over direction ' + direction, function(done) {
it('@flaky over direction ' + direction, function(done) {
layout.shapes[0].type = testCase.type;

Plotly.plot(gd, data, layout, {editable: true})
Expand Down Expand Up @@ -1102,14 +1102,14 @@ describe('A fixed size shape', function() {
});
});

describe('@flaky of type line', function() {
describe('of type line', function() {
beforeEach(function() {
layout.shapes[0].type = 'line';
layout.shapes[0].yanchor = 3;

});

it('can be moved by dragging the middle', function(done) {
it('@flaky can be moved by dragging the middle', function(done) {
Plotly.plot(gd, data, layout, {editable: true})
.then(function() {
var shapeNodeBeforeDrag = getFirstShapeNode();
Expand All @@ -1130,7 +1130,7 @@ describe('A fixed size shape', function() {
});
});

it('can be resized by dragging the start point', function(done) {
it('@flaky can be resized by dragging the start point', function(done) {
Plotly.plot(gd, data, layout, {editable: true})
.then(function() {
var shapeNodeBeforeDrag = getFirstShapeNode();
Expand All @@ -1153,7 +1153,7 @@ describe('A fixed size shape', function() {
});
});

it('can be resized by dragging the end point', function(done) {
it('@flaky can be resized by dragging the end point', function(done) {
Plotly.plot(gd, data, layout, {editable: true})
.then(function() {
var shapeNodeBeforeDrag = getFirstShapeNode();
Expand Down Expand Up @@ -1266,7 +1266,7 @@ describe('A fixed size shape', function() {
});
});

describe('@flaky Test shapes', function() {
describe('Test shapes', function() {
'use strict';

var gd, data, layout, config;
Expand Down Expand Up @@ -1308,7 +1308,7 @@ describe('@flaky Test shapes', function() {
];

testCases.forEach(function(testCase) {
it(testCase.title + ' should be draggable', function(done) {
it('@flaky ' + testCase.title + ' should be draggable', function(done) {
setupLayout(testCase, [{type: 'line'}, {type: 'rect'}, {type: 'circle'}, {type: 'path'}]);
testDragEachShape(done);
});
Expand All @@ -1319,7 +1319,7 @@ describe('@flaky Test shapes', function() {
var testTitle = testCase.title +
' should be resizeable over direction ' +
direction;
it(testTitle, function(done) {
it('@flaky ' + testTitle, function(done) {
// Exclude line because it has a different resize behavior
setupLayout(testCase, [{type: 'rect'}, {type: 'circle'}, {type: 'path'}]);
testResizeEachShape(direction, done);
Expand All @@ -1331,7 +1331,7 @@ describe('@flaky Test shapes', function() {
['start', 'end'].forEach(function(linePoint) {
var testTitle = 'Line shape ' + testCase.title +
' should be resizable by dragging the ' + linePoint + ' point';
it(testTitle, function(done) {
it('@flaky ' + testTitle, function(done) {
setupLayout(testCase, [{type: 'line'}]);
testLineResize(linePoint, done);
});
Expand Down