add support for passing additional environment parameters to command runner
includes an example of passing environment variables to chktex
This commit is contained in:
@@ -47,6 +47,7 @@ describe "CompileManager", ->
|
||||
compiler: @compiler = "pdflatex"
|
||||
timeout: @timeout = 42000
|
||||
imageName: @image = "example.com/image"
|
||||
@env = {}
|
||||
@Settings.compileDir = "compiles"
|
||||
@compileDir = "#{@Settings.path.compilesDir}/#{@project_id}-#{@user_id}"
|
||||
@ResourceWriter.syncResourcesToDisk = sinon.stub().callsArg(3)
|
||||
@@ -72,6 +73,7 @@ describe "CompileManager", ->
|
||||
compiler: @compiler
|
||||
timeout: @timeout
|
||||
image: @image
|
||||
environment: @env
|
||||
})
|
||||
.should.equal true
|
||||
|
||||
|
||||
@@ -22,10 +22,11 @@ describe "LatexRunner", ->
|
||||
@image = "example.com/image"
|
||||
@callback = sinon.stub()
|
||||
@project_id = "project-id-123"
|
||||
@env = {'foo': '123'}
|
||||
|
||||
describe "runLatex", ->
|
||||
beforeEach ->
|
||||
@CommandRunner.run = sinon.stub().callsArg(5)
|
||||
@CommandRunner.run = sinon.stub().callsArg(6)
|
||||
|
||||
describe "normally", ->
|
||||
beforeEach ->
|
||||
@@ -35,11 +36,12 @@ describe "LatexRunner", ->
|
||||
compiler: @compiler
|
||||
timeout: @timeout = 42000
|
||||
image: @image
|
||||
environment: @env
|
||||
@callback
|
||||
|
||||
it "should run the latex command", ->
|
||||
@CommandRunner.run
|
||||
.calledWith(@project_id, sinon.match.any, @directory, @image, @timeout)
|
||||
.calledWith(@project_id, sinon.match.any, @directory, @image, @timeout, @env)
|
||||
.should.equal true
|
||||
|
||||
describe "with an .Rtex main file", ->
|
||||
|
||||
Reference in New Issue
Block a user