Skip to content

Commit a1cfa79

Browse files
authored
Merge pull request #161 from kube-HPC/job-invoker
job invoker e2e
2 parents cc0270e + a01d113 commit a1cfa79

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

package-lock.json

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"@hkube/etcd": "^5.1.10",
2525
"@hkube/kubernetes-client": "^1.0.27",
2626
"@hkube/logger": "^1.0.30",
27+
"@hkube/consts": "^1.0.59",
2728
"autocannon": "^7.4.0",
2829
"axios": "^0.21.1",
2930
"chai": "^4.1.2",

tests/pipeline_tests.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const chaiHttp = require("chai-http");
44
const path = require("path");
55
const delay = require("delay");
66
var diff = require("deep-diff").diff;
7+
const { executeActions } = require('@hkube/consts');
78
const config = require(path.join(process.cwd(), 'config/config'));
89

910

@@ -20,6 +21,7 @@ const {
2021
getWebSocketJobs,
2122
getWebSocketlogs,
2223
getDriverIdByJobId,
24+
getJobById
2325
} = require("../utils/socketGet");
2426
const { getStatus } = require("../utils/results")
2527

@@ -806,6 +808,12 @@ let dev_token;
806808
expect(pipelineStatus.body.status).to.be.equal("paused");
807809
await resumePipeline(jobId, dev_token);
808810
await getResult(jobId, 200, dev_token);
811+
const jobBody = await getJobById(dev_token, jobId)
812+
expect(jobBody.job).to.have.property("auditTrail");
813+
expect(jobBody.job.auditTrail[jobBody.job.auditTrail.length -1].action).to.eql(executeActions.RUN);
814+
expect(jobBody.job.auditTrail[jobBody.job.auditTrail.length -2].action).to.eql(executeActions.PAUSE);
815+
expect(jobBody.job.auditTrail[jobBody.job.auditTrail.length -3].action).to.eql(executeActions.RESUME);
816+
expect(jobBody.job.auditTrail[jobBody.job.auditTrail.length -3].timestamp).to.be.gt(jobBody.job.auditTrail[jobBody.job.auditTrail.length -1].timestamp)
809817
}).timeout(1000 * 60 * 5);
810818

811819
it("pause resume pipeline multiple batch", async () => {

utils/graphql/queries/job-by-id-query.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ const JOB_BY_ID_QUERY = gql`
116116
progress
117117
}
118118
}
119+
auditTrail {
120+
timestamp
121+
user
122+
action
123+
}
119124
pipeline {
120125
name
121126
experimentName

0 commit comments

Comments
 (0)