unit tests pass, acceptence fail

uncomment tests
This commit is contained in:
Henry Oswald
2018-03-01 13:55:55 +00:00
parent b8c22f4d74
commit 70f016af1f
19 changed files with 290 additions and 263 deletions

View File

@@ -5,9 +5,7 @@ logger.info "using standard command runner"
module.exports = CommandRunner =
run: (project_id, command, directory, image, timeout, environment, callback = (error) ->) ->
console.log("Command runner", directory)
command = (arg.replace('$COMPILE_DIR', directory) for arg in command)
console.log("Command runner 2", command)
logger.log project_id: project_id, command: command, directory: directory, "running command"
logger.warn "timeouts and sandboxing are not enabled with CommandRunner"

View File

@@ -41,8 +41,6 @@ module.exports = CompileManager =
doCompile: (request, callback = (error, outputFiles) ->) ->
compileDir = getCompileDir(request.project_id, request.user_id)
# console.log("doCompile", compileDir)
timer = new Metrics.Timer("write-to-disk")
logger.log project_id: request.project_id, user_id: request.user_id, "syncing resources to disk"
ResourceWriter.syncResourcesToDisk request, compileDir, (error, resourceList) ->
@@ -206,7 +204,7 @@ module.exports = CompileManager =
base_dir = Settings.path.synctexBaseDir(compileName)
file_path = base_dir + "/" + file_name
compileDir = getCompileDir(project_id, user_id)
synctex_path = "$COMPILE_DIR/output.pdf"
synctex_path = "#{base_dir}/output.pdf"
command = ["code", synctex_path, file_path, line, column]
CompileManager._runSynctex project_id, user_id, command, (error, stdout) ->
return callback(error) if error?
@@ -219,9 +217,9 @@ module.exports = CompileManager =
syncFromPdf: (project_id, user_id, page, h, v, callback = (error, filePositions) ->) ->
compileName = getCompileName(project_id, user_id)
base_dir = Settings.path.synctexBaseDir(compileName)
compileDir = getCompileDir(project_id, user_id)
synctex_path = "$COMPILE_DIR/output.pdf"
base_dir = Settings.path.synctexBaseDir(compileName)
synctex_path = "#{base_dir}/output.pdf"
command = ["pdf", synctex_path, page, h, v]
CompileManager._runSynctex project_id, user_id, command, (error, stdout) ->
return callback(error) if error?
@@ -245,19 +243,16 @@ module.exports = CompileManager =
_runSynctex: (project_id, user_id, command, callback = (error, stdout) ->) ->
seconds = 1000
#this is a hack, only works for docker runner
command.unshift("/opt/synctex")
directory = getCompileDir(project_id, user_id)
timeout = 10 * 1000
compileName = getCompileName(project_id, user_id)
console.log command, "_runSynctex"
CommandRunner.run compileName, command, directory, Settings.clsi.docker.image, timeout, {}, (error, stdout) ->
console.log("synctex run", stdout)
CommandRunner.run compileName, command, directory, Settings.clsi.docker.image, timeout, {}, (error, output) ->
if error?
logger.err err:error, command:command, "error running synctex"
return callback(error)
callback(null, stdout)
callback(null, output.stdout)
_parseSynctexFromCodeOutput: (output) ->
results = []

View File

@@ -8,7 +8,6 @@ ProcessTable = {} # table of currently running jobs (pids or docker container n
module.exports = LatexRunner =
runLatex: (project_id, options, callback = (error) ->) ->
console.log("LatexRunner", options.directory)
{directory, mainFile, compiler, timeout, image, environment} = options
compiler ||= "pdflatex"
timeout ||= 60000 # milliseconds

View File

@@ -109,7 +109,6 @@ module.exports = ResourceWriter =
callback()
_writeResourceToDisk: (project_id, resource, basePath, callback = (error) ->) ->
console.log("_writeResourceToDisk", basePath, resource.path)
ResourceWriter.checkPath basePath, resource.path, (error, path) ->
return callback(error) if error?
mkdirp Path.dirname(path), (error) ->