Skip to content

Commit

Permalink
Merge pull request #261 from katalon-studio/master
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
quidl authored Sep 9, 2024
2 parents c42f3fd + 82e7506 commit 1112678
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
5 changes: 4 additions & 1 deletion src/core/api/url-param.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ module.exports = {
},

getJob(jobId) {
return buildUrl({ fields: ['sensitiveData'] }, PATHS.JOB, jobId);
const params = {
fields: 'sensitiveData',
};
return buildUrl({ params }, PATHS.JOB, jobId);
},

updateJob() {
Expand Down
23 changes: 8 additions & 15 deletions src/service/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,6 @@ async function executeJob(jobInfo, keepFiles) {
// ignored
logger.debug('Error when removing tmp directory:', err);
}

// try {
// console.log('QQQQQQ1 tmpDirPath', tmpDirPath);
// console.log('QQQQQQ1 fs', fs);
// fs.rmSync(tmpDirPath, { recursive: true, force: true });
// console.log('QQQQQQ2 tmpDirPath', tmpDirPath);
// } catch (err1) {
// logger.error('Error 2 when removing tmp directory:', err1);
// }
}
}
}
Expand Down Expand Up @@ -398,20 +389,22 @@ class Agent {

// Read job configuration from file
const jobBody = fs.readJsonSync('job.json', { encoding: 'utf-8' });
const { id: jobId } = jobBody;
let parameter = jobBody.parameter;
let projectId = jobBody.testProject?.projectId;
const { id: jobId, testProject } = jobBody;
let { parameter } = jobBody;
let projectId = testProject ? testProject.projectId : undefined;

if (!parameter || !projectId) {
const requestJobResponse = await api.getJob(jobId);
if (!(requestJobResponse?.body?.parameter && requestJobResponse?.body?.testProject)) {
if (!(requestJobResponse && requestJobResponse.body &&
requestJobResponse.body.parameter && requestJobResponse.body.testProject)) {
// There is no job to execute
return;
}

if (parameter) {
parameter = { ...requestJobResponse.body.parameter, ...parameter }
parameter = { ...requestJobResponse.body.parameter, ...parameter };
} else {
parameter = requestJobResponse.body.parameter
parameter = requestJobResponse.body.parameter;
}
projectId = requestJobResponse.body.testProject.projectId;
}
Expand Down

0 comments on commit 1112678

Please sign in to comment.