feat: Add SMFID to Jobs Tree View#2629
Conversation
Signed-off-by: Santhoshi Boyina <Santhoshi.Boyina1@ibm.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2629 +/- ##
==========================================
+ Coverage 93.21% 93.23% +0.01%
==========================================
Files 104 104
Lines 10411 10414 +3
Branches 2200 2203 +3
==========================================
+ Hits 9705 9709 +4
+ Misses 705 704 -1
Partials 1 1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Santhoshi Boyina <Santhoshi.Boyina1@ibm.com>
Signed-off-by: Santhoshi Boyina <Santhoshi.Boyina1@ibm.com>
Signed-off-by: SanthoshiBoyina <83487694+SanthoshiBoyina@users.noreply.github.com>
Signed-off-by: Santhoshi Boyina <Santhoshi.Boyina1@ibm.com>
JillieBeanSim
left a comment
There was a problem hiding this comment.
Thanks @SanthoshiBoyina for this enhancement, it works great for profile types that return the value and that don't. Once code coverage it up, I think this PR will be good to go.
Signed-off-by: Santhoshi Boyina <Santhoshi.Boyina1@ibm.com>
Signed-off-by: Santhoshi Boyina <Santhoshi.Boyina1@ibm.com>
JillieBeanSim
left a comment
There was a problem hiding this comment.
LGTM! thanks @SanthoshiBoyina for this enhancement and thanks for upping the code coverage!
traeok
left a comment
There was a problem hiding this comment.
LGTM, thanks @SanthoshiBoyina! Since my comments are mostly focused on test code, I won't request changes - just wanted to mention a couple things 😋
| expect(jobs[0].label).toEqual("TESTJOB(JOB1234) - ACTIVE"); | ||
| }); | ||
|
|
||
| it("To check smfid field when return code is undefined", async () => { |
There was a problem hiding this comment.
I might be misinterpreting the name for this test case, but I believe that the test code is checking for the opposite scenario:
| it("To check smfid field when return code is undefined", async () => { | |
| it("Does not add the SMFID field when return code is undefined", async () => { |
| const globalMocks = await createGlobalMocks(); | ||
|
|
||
| await globalMocks.testJobsProvider.addSession("fake"); | ||
| globalMocks.testJobsProvider.mSessionNodes[1].searchId = "JOB1234"; | ||
| globalMocks.testJobsProvider.mSessionNodes[1].dirty = true; | ||
| globalMocks.testJobsProvider.mSessionNodes[1].filtered = true; | ||
| globalMocks.testIJob.retcode = "ACTIVE"; | ||
|
|
||
| const jobs = await globalMocks.testJobsProvider.mSessionNodes[1].getChildren(); |
There was a problem hiding this comment.
I noticed a pattern across the new tests in this file. For the future, we might benefit from a test function that condenses this pattern, calling it with the appropriate arguments:
function jobLabelWithArgs(retcode?: string, execMember?: string): string {
const globalMocks = await createGlobalMocks();
await globalMocks.testJobsProvider.addSession("fake");
globalMocks.testJobsProvider.mSessionNodes[1].searchId = "JOB1234";
globalMocks.testJobsProvider.mSessionNodes[1].dirty = true;
globalMocks.testJobsProvider.mSessionNodes[1].filtered = true;
globalMocks.testIJob.retcode = retcode;
globalMocks.testIJob["exec-member"] = execMember;
const jobs = await globalMocks.testJobsProvider.mSessionNodes[1].getChildren();
return jobs[0].label;
}
// then one of the tests could just be:
expect(jobLabelWithArgs("ACTIVE").toEqual("TESTJOB(JOB1234) - ACTIVE");| nodeTitle = | ||
| job["exec-member"] !== undefined && job["exec-member"] !== "" | ||
| ? `${job.jobname}(${job.jobid}) - ${job["exec-member"] as string} - ${job.retcode}` | ||
| : `${job.jobname}(${job.jobid}) - ${job.retcode}`; |
There was a problem hiding this comment.
For the future, we might benefit from an exported function that builds these labels - primarily so it can be used to build job labels in tests.
|

Proposed changes
Release Notes
Milestone:
Changelog:
Types of changes
What types of changes does your code introduce to Zowe Explorer?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This checklist will be used as reference for both the contributor and the revieweryarn workspace vscode-extension-for-zowe vscode:prepublishhas been executedFurther comments