File tree 4 files changed +35
-0
lines changed
4 files changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ var constants = require ( './util/constants' ) ;
1
2
var common = require ( './util/common' ) ;
2
3
var containerCommands = require ( './util/container_commands' ) ;
3
4
5
+ var msg = [
6
+ 'Generating baseline image(s) using build/plotly.js from' ,
7
+ common . getTimeLastModified ( constants . pathToPlotlyBuild ) ,
8
+ '\n'
9
+ ] . join ( ' ' ) ;
10
+
4
11
var cmd = containerCommands . getRunCmd (
5
12
process . env . CIRCLECI ,
6
13
'node test/image/make_baseline.js ' + process . argv . slice ( 2 ) . join ( ' ' )
7
14
) ;
8
15
16
+ console . log ( msg ) ;
9
17
common . execCmd ( cmd ) ;
Original file line number Diff line number Diff line change
1
+ var constants = require ( './util/constants' ) ;
1
2
var common = require ( './util/common' ) ;
2
3
var containerCommands = require ( './util/container_commands' ) ;
3
4
5
+ var msg = [
6
+ 'Running image export tests using build/plotly.js from' ,
7
+ common . getTimeLastModified ( constants . pathToPlotlyBuild ) ,
8
+ '\n'
9
+ ] . join ( ' ' ) ;
10
+
4
11
var cmd = containerCommands . getRunCmd (
5
12
process . env . CIRCLECI ,
6
13
'node test/image/export_test.js ' + process . argv . slice ( 2 ) . join ( ' ' )
7
14
) ;
8
15
16
+ console . log ( msg ) ;
9
17
common . execCmd ( cmd ) ;
Original file line number Diff line number Diff line change
1
+ var constants = require ( './util/constants' ) ;
1
2
var common = require ( './util/common' ) ;
2
3
var containerCommands = require ( './util/container_commands' ) ;
3
4
5
+ var msg = [
6
+ 'Running image comparison tests using build/plotly.js from' ,
7
+ common . getTimeLastModified ( constants . pathToPlotlyBuild ) ,
8
+ '\n'
9
+ ] . join ( ' ' ) ;
10
+
4
11
var cmd = containerCommands . getRunCmd (
5
12
process . env . CIRCLECI ,
6
13
'node test/image/compare_pixels_test.js ' + process . argv . slice ( 2 ) . join ( ' ' )
7
14
) ;
8
15
16
+ console . log ( msg ) ;
9
17
common . execCmd ( cmd ) ;
Original file line number Diff line number Diff line change @@ -46,6 +46,17 @@ exports.formatTime = function(date) {
46
46
] . join ( ' ' ) ;
47
47
} ;
48
48
49
+ exports . getTimeLastModified = function ( filePath ) {
50
+ if ( ! exports . doesFileExist ( filePath ) ) {
51
+ throw new Error ( filePath + ' does not exist' ) ;
52
+ }
53
+
54
+ var stats = fs . statSync ( filePath ) ,
55
+ formattedTime = exports . formatTime ( stats . mtime ) ;
56
+
57
+ return formattedTime ;
58
+ } ;
59
+
49
60
exports . touch = function ( filePath ) {
50
61
fs . closeSync ( fs . openSync ( filePath , 'w' ) ) ;
51
62
} ;
You can’t perform that action at this time.
0 commit comments