Skip to content

Commit ee78083

Browse files
committed
job-list: add unit test for missing job duration
Problem: JobspecV1 requires attributes.system.duration to be set, but a unit test for this is missing in job-list. Add a unit test for this coverage.
1 parent 35c7bd8 commit ee78083

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

src/modules/job-list/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ EXTRA_DIST = \
9797
test/jobspec/queue_specified.jobspec \
9898
test/jobspec/cwd_not_specified.jobspec \
9999
test/jobspec/invalid_attributes_system_job.jobspec \
100+
test/jobspec/invalid_attributes_system_missing_duration.jobspec \
100101
test/jobspec/invalid_command_array.jobspec \
101102
test/jobspec/invalid_command_string.jobspec \
102103
test/jobspec/invalid_json.jobspec \

src/modules/job-list/test/job_data.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ struct test_jobspec_corner_case {
2929
{ TEST_SRCDIR "/jobspec/invalid_json.jobspec", -1 },
3030
{ TEST_SRCDIR "/jobspec/missing_attributes.jobspec", -1 },
3131
{ TEST_SRCDIR "/jobspec/invalid_attributes_system_job.jobspec", -1 },
32+
{ TEST_SRCDIR "/jobspec/invalid_attributes_system_missing_duration.jobspec", -1 },
3233
{ TEST_SRCDIR "/jobspec/missing_tasks.jobspec", -1 },
3334
{ TEST_SRCDIR "/jobspec/invalid_tasks_array.jobspec", -1 },
3435
{ TEST_SRCDIR "/jobspec/invalid_tasks_missing_command.jobspec", -1 },
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"resources": [
3+
{
4+
"type": "node",
5+
"count": 1,
6+
"exclusive": true,
7+
"with": [
8+
{
9+
"type": "slot",
10+
"count": 1,
11+
"with": [
12+
{
13+
"type": "core",
14+
"count": 1
15+
}
16+
],
17+
"label": "task"
18+
}
19+
]
20+
}
21+
],
22+
"tasks": [
23+
{
24+
"command": [
25+
"hostname"
26+
],
27+
"slot": "task",
28+
"count": {
29+
"per_slot": 1
30+
}
31+
}
32+
],
33+
"attributes": {
34+
"system": {
35+
"cwd": "/tmp/job"
36+
}
37+
},
38+
"version": 1
39+
}

0 commit comments

Comments
 (0)