Skip to content

Commit

Permalink
Merge pull request #2370 from zowe/add-abort-to-search
Browse files Browse the repository at this point in the history
Add abort functionality to search
  • Loading branch information
t1m0thyj authored Nov 21, 2024
2 parents 0dc4bcc + f641bb1 commit 4a894f4
Show file tree
Hide file tree
Showing 9 changed files with 275 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ describe("Search Datasets handler", () => {
let logMessage = "";
let fakeSession = null;

// Mock the submit JCL function
// Mock the search datasets function
Search.dataSets = jest.fn(async (session) => {
fakeSession = session;
return {
success: true,
commandResponse: "Found \"test\" in 2 data sets and PDS members",
apiResponse: [
{
dsname: "TEST1.DS",
memname: "TESTMEM",
dsn: "TEST1.DS",
member: "TESTMEM",
matchList: [
{
line: 1,
Expand All @@ -48,8 +48,8 @@ describe("Search Datasets handler", () => {
]
},
{
dsname: "TEST2.DS",
memname: undefined,
dsn: "TEST2.DS",
member: undefined,
matchList: [
{
line: 1,
Expand Down Expand Up @@ -139,8 +139,8 @@ describe("Search Datasets handler", () => {
commandResponse: "Found \"test\" in 2 data sets and PDS members",
apiResponse: [
{
dsname: "TEST1.DS",
memname: "TESTMEM",
dsn: "TEST1.DS",
member: "TESTMEM",
matchList: [
{
line: 1,
Expand All @@ -150,8 +150,8 @@ describe("Search Datasets handler", () => {
]
},
{
dsname: "TEST2.DS",
memname: undefined,
dsn: "TEST2.DS",
member: undefined,
matchList: [
{
line: 1,
Expand Down Expand Up @@ -242,8 +242,8 @@ describe("Search Datasets handler", () => {
commandResponse: "Found \"test\" in 2 data sets and PDS members",
apiResponse: [
{
dsname: "TEST1.DS",
memname: "TESTMEM",
dsn: "TEST1.DS",
member: "TESTMEM",
matchList: [
{
line: 1,
Expand All @@ -253,8 +253,8 @@ describe("Search Datasets handler", () => {
]
},
{
dsname: "TEST2.DS",
memname: undefined,
dsn: "TEST2.DS",
member: undefined,
matchList: [
{
line: 1,
Expand Down Expand Up @@ -345,8 +345,8 @@ describe("Search Datasets handler", () => {
commandResponse: "Found \"test\" in 2 data sets and PDS members",
apiResponse: [
{
dsname: "TEST1.DS",
memname: "TESTMEM",
dsn: "TEST1.DS",
member: "TESTMEM",
matchList: [
{
line: 1,
Expand All @@ -356,8 +356,8 @@ describe("Search Datasets handler", () => {
]
},
{
dsname: "TEST2.DS",
memname: undefined,
dsn: "TEST2.DS",
member: undefined,
matchList: [
{
line: 1,
Expand Down Expand Up @@ -448,8 +448,8 @@ describe("Search Datasets handler", () => {
commandResponse: "Found \"test\" in 2 data sets and PDS members",
apiResponse: [
{
dsname: "TEST1.DS",
memname: "TESTMEM",
dsn: "TEST1.DS",
member: "TESTMEM",
matchList: [
{
line: 1,
Expand All @@ -459,8 +459,8 @@ describe("Search Datasets handler", () => {
]
},
{
dsname: "TEST2.DS",
memname: undefined,
dsn: "TEST2.DS",
member: undefined,
matchList: [
{
line: 1,
Expand Down Expand Up @@ -551,8 +551,8 @@ describe("Search Datasets handler", () => {
commandResponse: "Found \"test\" in 2 data sets and PDS members",
apiResponse: [
{
dsname: "TEST1.DS",
memname: "TESTMEM",
dsn: "TEST1.DS",
member: "TESTMEM",
matchList: [
{
line: 1,
Expand All @@ -562,8 +562,8 @@ describe("Search Datasets handler", () => {
]
},
{
dsname: "TEST2.DS",
memname: undefined,
dsn: "TEST2.DS",
member: undefined,
matchList: [
{
line: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ exports[`Search Datasets handler process method should search a data set if requ
Object {
"apiResponse": Array [
Object {
"dsname": "TEST1.DS",
"dsn": "TEST1.DS",
"matchList": Array [
Object {
"column": 1,
"contents": "TEST CONTENTS",
"line": 1,
},
],
"memname": "TESTMEM",
"member": "TESTMEM",
},
Object {
"dsname": "TEST2.DS",
"dsn": "TEST2.DS",
"matchList": Array [
Object {
"column": 1,
"contents": "TEST CONTENTS",
"line": 1,
},
],
"memname": undefined,
"member": undefined,
},
],
"commandResponse": "Found \\"test\\" in 2 data sets and PDS members",
Expand All @@ -42,26 +42,26 @@ exports[`Search Datasets handler process method should search a data set if requ
Object {
"apiResponse": Array [
Object {
"dsname": "TEST1.DS",
"dsn": "TEST1.DS",
"matchList": Array [
Object {
"column": 1,
"contents": "TEST CONTENTS",
"line": 1,
},
],
"memname": "TESTMEM",
"member": "TESTMEM",
},
Object {
"dsname": "TEST2.DS",
"dsn": "TEST2.DS",
"matchList": Array [
Object {
"column": 1,
"contents": "TEST CONTENTS",
"line": 1,
},
],
"memname": undefined,
"member": undefined,
},
],
"commandResponse": "Found \\"test\\" in 2 data sets and PDS members",
Expand All @@ -80,26 +80,26 @@ exports[`Search Datasets handler process method should search a data set if requ
Object {
"apiResponse": Array [
Object {
"dsname": "TEST1.DS",
"dsn": "TEST1.DS",
"matchList": Array [
Object {
"column": 1,
"contents": "TEST CONTENTS",
"line": 1,
},
],
"memname": "TESTMEM",
"member": "TESTMEM",
},
Object {
"dsname": "TEST2.DS",
"dsn": "TEST2.DS",
"matchList": Array [
Object {
"column": 1,
"contents": "TEST CONTENTS",
"line": 1,
},
],
"memname": undefined,
"member": undefined,
},
],
"commandResponse": "Found \\"test\\" in 2 data sets and PDS members",
Expand All @@ -118,26 +118,26 @@ exports[`Search Datasets handler process method should search a data set if requ
Object {
"apiResponse": Array [
Object {
"dsname": "TEST1.DS",
"dsn": "TEST1.DS",
"matchList": Array [
Object {
"column": 1,
"contents": "TEST CONTENTS",
"line": 1,
},
],
"memname": "TESTMEM",
"member": "TESTMEM",
},
Object {
"dsname": "TEST2.DS",
"dsn": "TEST2.DS",
"matchList": Array [
Object {
"column": 1,
"contents": "TEST CONTENTS",
"line": 1,
},
],
"memname": undefined,
"member": undefined,
},
],
"commandResponse": "Found \\"test\\" in 2 data sets and PDS members",
Expand All @@ -156,26 +156,26 @@ exports[`Search Datasets handler process method should search a data set if requ
Object {
"apiResponse": Array [
Object {
"dsname": "TEST1.DS",
"dsn": "TEST1.DS",
"matchList": Array [
Object {
"column": 1,
"contents": "TEST CONTENTS",
"line": 1,
},
],
"memname": "TESTMEM",
"member": "TESTMEM",
},
Object {
"dsname": "TEST2.DS",
"dsn": "TEST2.DS",
"matchList": Array [
Object {
"column": 1,
"contents": "TEST CONTENTS",
"line": 1,
},
],
"memname": undefined,
"member": undefined,
},
],
"commandResponse": "Found \\"test\\" in 2 data sets and PDS members",
Expand All @@ -194,26 +194,26 @@ exports[`Search Datasets handler process method should search a data set if requ
Object {
"apiResponse": Array [
Object {
"dsname": "TEST1.DS",
"dsn": "TEST1.DS",
"matchList": Array [
Object {
"column": 1,
"contents": "TEST CONTENTS",
"line": 1,
},
],
"memname": "TESTMEM",
"member": "TESTMEM",
},
Object {
"dsname": "TEST2.DS",
"dsn": "TEST2.DS",
"matchList": Array [
Object {
"column": 1,
"contents": "TEST CONTENTS",
"line": 1,
},
],
"memname": undefined,
"member": undefined,
},
],
"commandResponse": "Found \\"test\\" in 2 data sets and PDS members",
Expand Down
4 changes: 4 additions & 0 deletions packages/zosfiles/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to the Zowe z/OS files SDK package will be documented in this file.

## Recent Changes

- Enhancement: Allows extenders of the Search functionality to pass a function `abortSearch` on `searchOptions` to abort a search. [#2370](https://github.com/zowe/zowe-cli/pull/2370)

## `8.8.3`

- BugFix: Resolved issue where special characters could be corrupted when downloading a large file. [#2366](https://github.com/zowe/zowe-cli/pull/2366)
Expand Down
Loading

0 comments on commit 4a894f4

Please sign in to comment.