@@ -22,7 +22,6 @@ var source = require('vinyl-source-stream');
2222var buffer = require ( 'vinyl-buffer' ) ;
2323var gulp = require ( 'gulp' ) ;
2424var through = require ( 'through2' ) ;
25- var gulpif = require ( 'gulp-if' ) ;
2625var uglify = require ( 'gulp-uglify' ) ;
2726var concat = require ( 'gulp-concat' ) ;
2827var gutil = require ( 'gulp-util' ) ;
@@ -40,14 +39,14 @@ var decompress = require('gulp-decompress');
4039var fs = require ( "fs-extra" ) ;
4140var runSequence = require ( 'run-sequence' ) ;
4241var path = require ( 'path' ) ;
43- var childProcess = require ( "child_process" ) ;
4442var minimist = require ( 'minimist' ) ;
4543var cucumber = require ( 'gulp-cucumber' ) ;
4644var merge = require ( 'merge-stream' ) ;
4745var install = require ( "gulp-install" ) ;
4846var os = require ( 'os' ) ;
4947var file = require ( 'gulp-file' ) ;
5048var semver = require ( 'semver' ) ;
49+ var sharedNeo4j = require ( './test/internal/shared-neo4j' ) . default ;
5150
5251gulp . task ( 'default' , [ "test" ] ) ;
5352
@@ -232,43 +231,12 @@ gulp.task('set', function() {
232231} ) ;
233232
234233
235- var neo4jHome = path . resolve ( './build/neo4j' ) ;
236- var neorunPath = path . resolve ( './neokit/neorun.py' ) ;
237- var neorunStartArgsName = "--neorun.start.args" ; // use this args to provide additional args for running neorun.start
234+ var neo4jHome = path . resolve ( './build/neo4j' ) ;
238235
239- gulp . task ( 'start-neo4j' , function ( ) {
240-
241- var neorunStartArgs = '-p neo4j' ; // default args to neorun.start: change the default password to neo4j
242- process . argv . slice ( 2 ) . forEach ( function ( val ) {
243- if ( val . startsWith ( neorunStartArgsName ) )
244- {
245- neorunStartArgs = val . split ( "=" ) [ 1 ] ;
246- }
247- } ) ;
248-
249- neorunStartArgs = neorunStartArgs . match ( / \S + / g) || '' ;
250-
251- return runScript ( [
252- neorunPath , '--start=' + neo4jHome
253- ] . concat ( neorunStartArgs ) ) ;
236+ gulp . task ( 'start-neo4j' , function ( ) {
237+ sharedNeo4j . start ( neo4jHome , process . env . NEOCTRL_ARGS ) ;
254238} ) ;
255239
256- gulp . task ( 'stop-neo4j' , function ( ) {
257- return runScript ( [
258- neorunPath , '--stop=' + neo4jHome
259- ] ) ;
240+ gulp . task ( 'stop-neo4j' , function ( ) {
241+ sharedNeo4j . stop ( neo4jHome ) ;
260242} ) ;
261-
262- var runScript = function ( cmd ) {
263- var spawnSync = childProcess . spawnSync , child , code ;
264- child = spawnSync ( 'python' , cmd ) ;
265- console . log ( "Script Outputs:\n" + child . stdout . toString ( ) ) ;
266- var error = child . stderr . toString ( ) ;
267- if ( error . trim ( ) !== "" )
268- console . log ( "Script Errors:\n" + error ) ;
269- code = child . status ;
270- if ( code !== 0 )
271- {
272- throw "Script finished with code " + code
273- }
274- } ;
0 commit comments