-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add SMFID to Jobs Tree View #2629
Conversation
Signed-off-by: Santhoshi Boyina <[email protected]>
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 <[email protected]>
Signed-off-by: Santhoshi Boyina <[email protected]>
Signed-off-by: SanthoshiBoyina <[email protected]>
Signed-off-by: Santhoshi Boyina <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
Signed-off-by: Santhoshi Boyina <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! thanks @SanthoshiBoyina for this enhancement and thanks for upping the code coverage!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Quality Gate failedFailed conditions 10.7% Duplication on New Code (required ≤ 3%) |
Proposed changes
Release Notes
Milestone:
Changelog:
Types of changes
What types of changes does your code introduce to Zowe Explorer?
Put an
x
in the boxes that applyChecklist
Put an
x
in 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:prepublish
has been executedFurther comments