Răsfoiți Sursa

Fix up settings schema and acceptance tests

James Allen 12 ani în urmă
părinte
comite
ee4a6e869e

+ 1 - 0
services/clsi/.gitignore

@@ -12,3 +12,4 @@ app.js
 cache
 .vagrant
 db.sqlite
+config/*

+ 6 - 18
services/clsi/Gruntfile.coffee

@@ -34,27 +34,16 @@ module.exports = (grunt) ->
 				dest: "test/smoke/js"
 				ext:  ".js"
 
-		watch:
-			app:
-				files: ['app/coffee/*.coffee']
-				tasks: ['coffee']
-
 		clean:
 			app: ["app/js/"]
 			unit_tests: ["test/unit/js"]
 			acceptance_tests: ["test/acceptance/js"]
 			smoke_tests: ["test/smoke/js"]
 
-		nodemon:
-			dev:
-				options:
-					file: 'app.js'
 
-		concurrent:
-			dev:
-				tasks: ['nodemon', 'watch']
-				options:
-					logConcurrentOutput: true
+		execute:
+			app:
+				src: "app.js"
 
 		mochaTest:
 			unit:
@@ -73,15 +62,14 @@ module.exports = (grunt) ->
 				src: ["test/smoke/js/**/*.js"]
 
 	grunt.loadNpmTasks 'grunt-contrib-coffee'
-	grunt.loadNpmTasks 'grunt-contrib-watch'
 	grunt.loadNpmTasks 'grunt-contrib-clean'
-	grunt.loadNpmTasks 'grunt-nodemon'
-	grunt.loadNpmTasks 'grunt-concurrent'
 	grunt.loadNpmTasks 'grunt-mocha-test'
 	grunt.loadNpmTasks 'grunt-shell'
+	grunt.loadNpmTasks 'grunt-execute'
+	grunt.loadNpmTasks 'grunt-bunyan'
 
 	grunt.registerTask 'compile:app', ['clean:app', 'coffee:app', 'coffee:app_src', 'coffee:smoke_tests']
-	grunt.registerTask 'run',         ['compile:app', 'concurrent']
+	grunt.registerTask 'run',         ['compile:app', 'bunyan', 'execute']
 
 	grunt.registerTask 'compile:unit_tests', ['clean:unit_tests', 'coffee:unit_tests']
 	grunt.registerTask 'test:unit',          ['compile:app', 'compile:unit_tests', 'mochaTest:unit']

+ 0 - 37
services/clsi/config/settings.testing.coffee

@@ -1,37 +0,0 @@
-Path = require "path"
-
-module.exports =
-	# Options are passed to Sequelize.
-	# See http://sequelizejs.com/documentation#usage-options for details
-	mysql:
-		clsi:
-			database: "clsi"
-			username: "clsi"
-			password: null
-			dialect: "sqlite"
-			storage: Path.resolve(__dirname + "/../db.sqlite")
-
-
-	path:
-		compilesDir:  Path.resolve(__dirname + "/../compiles")
-		clsiCacheDir: Path.resolve(__dirname + "/../cache")
-
-	# clsi:
-	# 	commandRunner: "docker-runner-sharelatex"
-	# 	docker:
-	# 		image: "quay.io/sharelatex/texlive-full"
-	# 		env:
-	# 			PATH: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/texlive/2013/bin/x86_64-linux/"
-	# 			HOME: "/tmp"
-	# 		socketPath: "/var/run/docker.sock"
-	# 		user: "tex"
-
-	internal:
-		clsi:
-			port: 3013
-			host: "localhost"
-
-	apis:
-		clsi:
-			url: "http://localhost:3013"
-

+ 4 - 4
services/clsi/package.json

@@ -24,13 +24,13 @@
     "sinon": "~1.7.3",
     "grunt": "~0.4.2",
     "grunt-contrib-coffee": "~0.7.0",
-    "grunt-contrib-watch": "~0.5.3",
-    "grunt-concurrent": "~0.4.2",
-    "grunt-nodemon": "~0.1.2",
     "grunt-contrib-clean": "~0.5.0",
     "grunt-shell": "~0.6.1",
     "grunt-mocha-test": "~0.8.1",
     "sandboxed-module": "~0.3.0",
-    "timekeeper": "0.0.4"
+    "timekeeper": "0.0.4",
+    "grunt-execute": "^0.1.5",
+    "bunyan": "^0.22.1",
+    "grunt-bunyan": "^0.5.0"
   }
 }

+ 4 - 0
services/clsi/test/acceptance/coffee/ExampleDocumentTests.coffee

@@ -6,6 +6,10 @@ ChildProcess = require "child_process"
 
 fixturePath = (path) -> __dirname + "/../fixtures/" + path
 
+try
+	fs.mkdirSync(fixturePath("tmp"))
+catch e
+
 convertToPng = (pdfPath, pngPath, callback = (error) ->) ->
 	convert = ChildProcess.exec "convert #{fixturePath(pdfPath)} #{fixturePath(pngPath)}"
 	convert.on "exit", () ->

+ 2 - 2
services/clsi/test/acceptance/coffee/helpers/Client.coffee

@@ -1,11 +1,11 @@
 request = require "request"
 fs = require "fs"
-Settings = require "../../../../app/js/Settings"
+Settings = require "settings-sharelatex"
 
 host = "localhost"
 
 module.exports = Client =
-	host: Settings.externalUrl
+	host: Settings.apis.clsi.url
 
 	randomId: () ->
 		Math.random().toString(16).slice(2)