From 5dfe961d63dd4cb2c3a6d8fa952225d1f195b17e Mon Sep 17 00:00:00 2001 From: James Allen Date: Thu, 13 Feb 2014 09:33:39 +0000 Subject: [PATCH] Fix up smoke tests --- Gruntfile.coffee | 2 +- config/settings.testing.coffee | 20 ++++++++++---------- test/smoke/coffee/SmokeTests.coffee | 4 ++-- test/smoke/js/SmokeTests.js | 7 +++++-- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 37fa78f..e95b7be 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -80,7 +80,7 @@ module.exports = (grunt) -> grunt.loadNpmTasks 'grunt-mocha-test' grunt.loadNpmTasks 'grunt-shell' - grunt.registerTask 'compile:app', ['clean:app', 'coffee:app', 'coffee:app_src'] + grunt.registerTask 'compile:app', ['clean:app', 'coffee:app', 'coffee:app_src', 'coffee:smoke_tests'] grunt.registerTask 'run', ['compile:app', 'concurrent'] grunt.registerTask 'compile:unit_tests', ['clean:unit_tests', 'coffee:unit_tests'] diff --git a/config/settings.testing.coffee b/config/settings.testing.coffee index 9407a50..19874cd 100644 --- a/config/settings.testing.coffee +++ b/config/settings.testing.coffee @@ -14,20 +14,20 @@ module.exports = 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" + # 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: "" + host: "localhost" apis: clsi: diff --git a/test/smoke/coffee/SmokeTests.coffee b/test/smoke/coffee/SmokeTests.coffee index 4cc18ea..f560b0c 100644 --- a/test/smoke/coffee/SmokeTests.coffee +++ b/test/smoke/coffee/SmokeTests.coffee @@ -2,9 +2,9 @@ chai = require("chai") chai.should() expect = chai.expect request = require "request" -Settings = require "../../../app/js/Settings" +Settings = require "settings-sharelatex" -buildUrl = (path) -> "http://localhost:#{Settings.listen.port}/#{path}" +buildUrl = (path) -> "http://#{Settings.internal.clsi.host}:#{Settings.internal.clsi.port}/#{path}" describe "Running a compile", -> before (done) -> diff --git a/test/smoke/js/SmokeTests.js b/test/smoke/js/SmokeTests.js index c364c88..13b2fa4 100644 --- a/test/smoke/js/SmokeTests.js +++ b/test/smoke/js/SmokeTests.js @@ -9,10 +9,10 @@ request = require("request"); - Settings = require("../../../app/js/Settings"); + Settings = require("settings-sharelatex"); buildUrl = function(path) { - return "http://localhost:" + Settings.listen.port + "/" + path; + return "http://" + Settings.internal.clsi.host + ":" + Settings.internal.clsi.port + "/" + path; }; describe("Running a compile", function() { @@ -34,6 +34,9 @@ _this.error = error; _this.response = response; _this.body = body; + if (_this.error != null) { + throw _this.error; + } return done(); }); });