From ee4a6e869ebd478df58f90657db5ed1d9edab6c3 Mon Sep 17 00:00:00 2001 From: James Allen Date: Wed, 2 Apr 2014 16:55:14 -0400 Subject: [PATCH] Fix up settings schema and acceptance tests --- services/clsi/.gitignore | 1 + services/clsi/Gruntfile.coffee | 24 +++--------- services/clsi/config/settings.testing.coffee | 37 ------------------- services/clsi/package.json | 8 ++-- .../coffee/ExampleDocumentTests.coffee | 4 ++ .../acceptance/coffee/helpers/Client.coffee | 4 +- 6 files changed, 17 insertions(+), 61 deletions(-) delete mode 100644 services/clsi/config/settings.testing.coffee diff --git a/services/clsi/.gitignore b/services/clsi/.gitignore index 30aa9829f9..43c4dd14aa 100644 --- a/services/clsi/.gitignore +++ b/services/clsi/.gitignore @@ -12,3 +12,4 @@ app.js cache .vagrant db.sqlite +config/* diff --git a/services/clsi/Gruntfile.coffee b/services/clsi/Gruntfile.coffee index e95b7be7a4..53532e164b 100644 --- a/services/clsi/Gruntfile.coffee +++ b/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'] diff --git a/services/clsi/config/settings.testing.coffee b/services/clsi/config/settings.testing.coffee deleted file mode 100644 index ff7b0087e6..0000000000 --- a/services/clsi/config/settings.testing.coffee +++ /dev/null @@ -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" - diff --git a/services/clsi/package.json b/services/clsi/package.json index 0fdc15ab57..875e6e8566 100644 --- a/services/clsi/package.json +++ b/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" } } diff --git a/services/clsi/test/acceptance/coffee/ExampleDocumentTests.coffee b/services/clsi/test/acceptance/coffee/ExampleDocumentTests.coffee index 448d22fa06..f7f82ac12c 100644 --- a/services/clsi/test/acceptance/coffee/ExampleDocumentTests.coffee +++ b/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", () -> diff --git a/services/clsi/test/acceptance/coffee/helpers/Client.coffee b/services/clsi/test/acceptance/coffee/helpers/Client.coffee index bb6ddc4087..7aa57c523e 100644 --- a/services/clsi/test/acceptance/coffee/helpers/Client.coffee +++ b/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)