Commit f63f9e7d authored by Renato Figueiro Maia's avatar Renato Figueiro Maia
Browse files

Teste de parâmetros de job submetido.

[SOMA-6857]
parent a2d8fa32
......@@ -115,7 +115,11 @@ describe("Mocked SGA", function () {
let regMockup;
let sga;
const jobBody = utils.fillJobBody();
const jobBody = utils.fillJobBody("XPTO", {
param1: "one parameter",
param2: "other parameter",
param3: "another parameter",
});
const driverMockup = {
execute_command: `
expect(job.cmd_id == ${JSON.stringify(jobBody.cmd_id)})
......@@ -123,6 +127,24 @@ describe("Mocked SGA", function () {
expect(user_token == ${JSON.stringify(
jobBody.parameters.csbase_command_user_token
)})
expect(job.parameters.param1 == ${JSON.stringify(
jobBody.parameters.param1
)})
expect(job.parameters.param2 == ${JSON.stringify(
jobBody.parameters.param2
)})
expect(job.parameters.param3 == ${JSON.stringify(
jobBody.parameters.param3
)})
expect(job.sandboxes[1] == ${JSON.stringify(
jobBody.parameters["csbase_command_sandbox_paths.1"]
)})
expect(job.sandboxes[2] == ${JSON.stringify(
jobBody.parameters["csbase_command_sandbox_paths.2"]
)})
expect(job.sandboxes[3] == ${JSON.stringify(
jobBody.parameters["csbase_command_sandbox_paths.3"]
)})
expect(not self.jobDataRef)
self.jobDataRef = job.data
job.data.start = now()
......
......@@ -347,7 +347,7 @@ function fillJobBody(id = "XPTO", params = {}, sandboxCount = 3) {
params.csbase_command_path = `job ${id} path`;
params.csbase_command_output_path = `job ${id} output path`;
params.csbase_command_root_path = `job ${id} root path`;
for (let i = 0; i < sandboxCount; i++) {
for (let i = 1; i <= sandboxCount; i++) {
params[`csbase_command_sandbox_paths.${i}`] = `job ${id} sandbox path ${i}`;
}
return {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment