diff --git a/dashboard/server.js b/dashboard/server.js index b1df376..d663a8d 100644 --- a/dashboard/server.js +++ b/dashboard/server.js @@ -1498,7 +1498,14 @@ function findDirectExecutable(command) { } function createExecutor({ command, packageRoot, buildInvocation }) { - return ({ repository, prompt, sessionId, resume, onOutput }) => { + return ({ + repository, + artifactDirectories = [], + prompt, + sessionId, + resume, + onOutput + }) => { const executable = findDirectExecutable(command); if (!executable) { throw new Error( @@ -1510,7 +1517,10 @@ function createExecutor({ command, packageRoot, buildInvocation }) { prompt, sessionId, resume, - additionalDirs: linkedDependencyDirectories(repository) + additionalDirs: [ + ...linkedDependencyDirectories(repository), + ...artifactDirectories + ] }); const child = spawn(executable, invocation.args, { cwd: repository, @@ -2512,6 +2522,7 @@ export function createDashboardServer({ job.lastActivityAt = new Date().toISOString(); handle = executor({ repository: resolvedRepository, + artifactDirectories: job.artifactDirectory ? [job.artifactDirectory] : [], prompt, sessionId: job.id, resume, diff --git a/test/dashboard-server.test.js b/test/dashboard-server.test.js index 4c75e86..cccd013 100644 --- a/test/dashboard-server.test.js +++ b/test/dashboard-server.test.js @@ -586,8 +586,10 @@ test("loads Azure DevOps intake and passes local screenshots without caching the }; let loaderInput; let receivedPrompt; - const executor = ({ prompt, onOutput }) => { + let receivedArtifactDirectories; + const executor = ({ prompt, artifactDirectories, onOutput }) => { receivedPrompt = prompt; + receivedArtifactDirectories = artifactDirectories; onOutput( "stdout", "FIXLAB_BUG|71|external|upstream-system|The upstream system owns the rejected request; no repository change is required.\n" @@ -658,6 +660,7 @@ test("loads Azure DevOps intake and passes local screenshots without caching the screenshotPath = pathLine?.slice(2); assert.ok(screenshotPath); assert.equal(existsSync(screenshotPath), true); + assert.deepEqual(receivedArtifactDirectories, [dirname(screenshotPath)]); assert.match(receivedPrompt, /Loaded Azure DevOps selection/); assert.match( receivedPrompt,