diff --git a/.github/workflows/theia-zowe-explorer-ci.yml b/.github/workflows/theia-zowe-explorer-ci.yml index e886cbd687..bd8457f15e 100644 --- a/.github/workflows/theia-zowe-explorer-ci.yml +++ b/.github/workflows/theia-zowe-explorer-ci.yml @@ -39,16 +39,16 @@ jobs: run: yarn workspace vscode-extension-for-zowe package - name: Create extension install directory - run: mkdir -p temp/plugins && chmod -R 777 temp + run: mkdir -p temp/extensions && chmod -R 777 temp - name: Copy vsix to theia folder - run: cp dist/*.vsix temp/plugins + run: cp dist/*.vsix temp/extensions # Verify vsix - - run: ls -la temp/plugins + - run: ls -la temp/extensions - name: Start Theia - run: docker run --name theia --init -d -p 3000:3000 --user theia -v "${PWD}/temp/plugins/:/home/theia/plugins" ghcr.io/zowe/zowe-sample-dockerfiles-ze-theia-slim + run: docker run --name theia --init -d -p 3000:3000 --user theia -v "${PWD}/temp/:/home/theia/.theia" ghcr.io/zowe/zowe-sample-dockerfiles-ze-theia-slim # NOTE(Kelosky): alternatively, we could run docker via something like this; however, we cannot hot reload # hosted VS Code extensions after theia is started (at least at the time this was written). # services: @@ -61,14 +61,11 @@ jobs: # # --health-cmd "curl --fail http://localhost:3000 || exit 1" --health-interval=5s --health-timeout=5s --health-retries 60 # options: --init - - name: Allow some time for the theia server to load - run: sleep 30s + - name: Verify Theia accessible + run: curl --fail --max-time 5 --retry 12 --retry-delay 5 --retry-all-errors http://localhost:3000 - name: Verify plugin loaded - run: docker exec -i theia ls -la /home/theia/plugins - - - name: Verify Theia accessible - run: curl --fail http://localhost:3000 + run: docker exec -i theia ls -la /home/theia/.theia/deployedPlugins - name: Prep integration test files run: yarn workspace vscode-extension-for-zowe build:integration diff --git a/packages/eslint-plugin-zowe-explorer/CHANGELOG.md b/packages/eslint-plugin-zowe-explorer/CHANGELOG.md index 432ec53ae1..9aab4b9d24 100644 --- a/packages/eslint-plugin-zowe-explorer/CHANGELOG.md +++ b/packages/eslint-plugin-zowe-explorer/CHANGELOG.md @@ -6,11 +6,9 @@ All notable changes to the "eslint-plugin-zowe-explorer" package will be documen ### Bug fixes -## `2.16.2` - -### New features and enhancements +## `2.16.3` -### Bug fixes +## `2.16.2` ## `2.16.1` diff --git a/packages/zowe-explorer-api/CHANGELOG.md b/packages/zowe-explorer-api/CHANGELOG.md index 4bfb7d2fb2..378cdd33df 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -10,6 +10,8 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t - Removed `handlebars` dependency in favor of `mustache` for technical currency purposes. [#2974](https://github.com/zowe/zowe-explorer-vscode/pull/2974) +## `2.16.3` + ## `2.16.2` ### Bug fixes diff --git a/packages/zowe-explorer-ftp-extension/CHANGELOG.md b/packages/zowe-explorer-ftp-extension/CHANGELOG.md index d1e7bcd04f..d9bf284733 100644 --- a/packages/zowe-explorer-ftp-extension/CHANGELOG.md +++ b/packages/zowe-explorer-ftp-extension/CHANGELOG.md @@ -6,6 +6,8 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be docum ### Bug fixes +## `2.16.3` + ## `2.16.2` ### Bug fixes diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 092450fa8b..a01911cab1 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -6,9 +6,15 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen ### New features and enhancements +- To add the ability to open a Favorited Job Search under Favorites [#2630](https://github.com/zowe/zowe-explorer-vscode/pull/2930) + ### Bug fixes -- To add the ability to open a Favorited Job Search under Favorites [#2630](https://github.com/zowe/zowe-explorer-vscode/pull/2930) +## `2.16.3` + +### Bug fixes + +- Fixed issue where USS files could not be submitted as JCL. [#2991](https://github.com/zowe/zowe-explorer-vscode/issues/2991) ## `2.16.2` diff --git a/packages/zowe-explorer/__tests__/__theia__/theia/Locators.ts b/packages/zowe-explorer/__tests__/__theia__/theia/Locators.ts index 0ac0d8cc36..639c9750df 100644 --- a/packages/zowe-explorer/__tests__/__theia__/theia/Locators.ts +++ b/packages/zowe-explorer/__tests__/__theia__/theia/Locators.ts @@ -11,11 +11,11 @@ export const TheiaLocator = { theiaUrl: "http://localhost:3000", - zoweExplorerxId: "shell-tab-plugin-view-container:zowe", + zoweExplorerxId: "shell-tab-plugin-view-container:workbench.view.extension.zowe", }; export const DatasetsLocators = { - datasetTabId: "plugin-view-container:zowe--plugin-view:zowe.ds.explorer", + datasetTabId: "plugin-view-container:workbench.view.extension.zowe--plugin-view:zowe.ds.explorer", datasetTabXpath: "//span[@title='Data Sets']", datasetsPanelId: "plugin-view:zowe.ds.explorer", datasetsAddSessionId: "zowe.ds.addSession-as-tabbar-toolbar-item", @@ -32,7 +32,7 @@ export const DatasetsLocators = { }; export const UssLocators = { - ussTabId: "plugin-view-container:zowe--plugin-view:zowe.uss.explorer", + ussTabId: "plugin-view-container:workbench.view.extension.zowe--plugin-view:zowe.uss.explorer", ussTabXpath: "//span[@title='Unix System Services (USS)']", ussPanelId: "plugin-view:zowe.uss.explorer", ussAddSessionId: "zowe.uss.addSession-as-tabbar-toolbar-item", @@ -48,7 +48,7 @@ export const UssLocators = { }; export const JobsLocators = { - jobTabId: "plugin-view-container:zowe--plugin-view:zowe.jobs.explorer", + jobTabId: "plugin-view-container:workbench.view.extension.zowe--plugin-view:zowe.jobs.explorer", jobTabXpath: "//span[@title='Jobs']", jobsPanelId: "zowe.jobs.explorer", jobsAddSessionId: "zowe.jobs.addJobsSession-as-tabbar-toolbar-item", diff --git a/packages/zowe-explorer/__tests__/__theia__/theia/extension.theiaChrome.ts b/packages/zowe-explorer/__tests__/__theia__/theia/extension.theiaChrome.ts index 17ccf20591..cad310cd8d 100644 --- a/packages/zowe-explorer/__tests__/__theia__/theia/extension.theiaChrome.ts +++ b/packages/zowe-explorer/__tests__/__theia__/theia/extension.theiaChrome.ts @@ -42,7 +42,7 @@ export async function OpenTheiaInChrome() { } export async function clickOnZoweExplorer() { - await driverChrome.wait(until.elementLocated(By.id(TheiaLocator.zoweExplorerxId))).click(); + await driverChrome.wait(until.elementLocated(By.id(TheiaLocator.zoweExplorerxId)), WAITTIME).click(); } export async function clickOnFavoriteTabInDatasets() { diff --git a/packages/zowe-explorer/__tests__/__theia__/theia/extension.theiaFirefox.ts b/packages/zowe-explorer/__tests__/__theia__/theia/extension.theiaFirefox.ts index 9160b5a921..6d354661eb 100644 --- a/packages/zowe-explorer/__tests__/__theia__/theia/extension.theiaFirefox.ts +++ b/packages/zowe-explorer/__tests__/__theia__/theia/extension.theiaFirefox.ts @@ -37,7 +37,7 @@ export async function OpenTheiaInFirefox() { } export async function clickOnZoweExplorer() { - driverFirefox.wait(until.elementLocated(By.id(TheiaLocator.zoweExplorerxId))).click(); + driverFirefox.wait(until.elementLocated(By.id(TheiaLocator.zoweExplorerxId)), WAITTIME).click(); } export async function clickOnDatasetsTab() { diff --git a/packages/zowe-explorer/__tests__/__unit__/job/actions.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/job/actions.unit.test.ts index 674b81dc8c..786ee6922d 100644 --- a/packages/zowe-explorer/__tests__/__unit__/job/actions.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/job/actions.unit.test.ts @@ -46,6 +46,7 @@ import { ProfileManagement } from "../../../src/utils/ProfileManagement"; import { TreeProviders } from "../../../src/shared/TreeProviders"; import { mocked } from "../../../__mocks__/mockUtils"; import { TreeViewUtils } from "../../../src/utils/TreeViewUtils"; +import * as path from "path"; const activeTextEditorDocument = jest.fn(); @@ -423,8 +424,6 @@ describe("Jobs Actions Unit Tests - Function submitJcl", () => { const imperativeProfile = createIProfile(); const datasetSessionNode = createDatasetSessionNode(session, imperativeProfile); const textDocument = createTextDocument("HLQ.TEST.AFILE(mem)", datasetSessionNode); - (textDocument.languageId as any) = "jcl"; - (textDocument.uri.fsPath as any) = "/user/temp/textdocument.txt"; const profileInstance = createInstanceOfProfile(imperativeProfile); const jesApi = createJesApi(imperativeProfile); const mockCheckCurrentProfile = jest.fn(); @@ -651,22 +650,25 @@ describe("Jobs Actions Unit Tests - Function submitJcl", () => { expect(showMessagespy).toBeCalledWith("No profiles available"); }); it("Getting session name from the path itself", async () => { - globals.defineGlobals("/user/"); + globals.defineGlobals(__dirname); createGlobalMocks(); const blockMocks: any = createBlockMocks(); mocked(zowe.ZosmfSession.createSessCfgFromArgs).mockReturnValue(blockMocks.session); mocked(Profiles.getInstance).mockReturnValue(blockMocks.profileInstance); + const loadNamedProfileSpy = jest.spyOn(blockMocks.profileInstance, "loadNamedProfile"); blockMocks.testDatasetTree.getChildren.mockResolvedValueOnce([ new ZoweDatasetNode({ label: "node", collapsibleState: vscode.TreeItemCollapsibleState.None, parentNode: blockMocks.datasetSessionNode }), blockMocks.datasetSessionNode, ]); - blockMocks.datasetSessionNode.label = "temp"; + blockMocks.textDocument.fileName = path.join(globals.USS_DIR, "lpar1_zosmf", "file.txt"); + blockMocks.textDocument.uri = vscode.Uri.file(blockMocks.textDocument.fileName); activeTextEditorDocument.mockReturnValue(blockMocks.textDocument); const submitJclSpy = jest.spyOn(blockMocks.jesApi, "submitJcl"); submitJclSpy.mockClear(); submitJclSpy.mockResolvedValueOnce(blockMocks.iJob); await dsActions.submitJcl(blockMocks.testDatasetTree, undefined); + expect(loadNamedProfileSpy).toBeCalledWith("lpar1_zosmf"); expect(submitJclSpy).toBeCalled(); expect(mocked(Gui.showMessage)).toBeCalled(); expect(mocked(Gui.showMessage).mock.calls.length).toBe(1); diff --git a/packages/zowe-explorer/src/dataset/actions.ts b/packages/zowe-explorer/src/dataset/actions.ts index a95d56c4d0..fe49b921c1 100644 --- a/packages/zowe-explorer/src/dataset/actions.ts +++ b/packages/zowe-explorer/src/dataset/actions.ts @@ -933,39 +933,30 @@ export async function submitJcl(datasetProvider: api.IZoweTree 1) { - const quickPickOptions: vscode.QuickPickOptions = { - placeHolder: localize("submitJcl.qp.placeholder", "Select the Profile to use to submit the job"), - ignoreFocusOut: true, - canPickMany: false, - }; - sessProfileName = await api.Gui.showQuickPick(profileNamesList, quickPickOptions); - if (!sessProfileName) { - api.Gui.infoMessage(localizedStrings.opCancelled); - return; - } - } else if (profileNamesList.length > 0) { - sessProfileName = profileNamesList[0]; - } else { - api.Gui.showMessage(localize("submitJcl.noProfile", "No profiles available")); + if (!doc.uri.fsPath.includes(globals.ZOWETEMPFOLDER)) { + const profileNamesList = ProfileManagement.getRegisteredProfileNameList(globals.Trees.JES); + if (profileNamesList.length > 1) { + const quickPickOptions: vscode.QuickPickOptions = { + placeHolder: localize("submitJcl.qp.placeholder", "Select the Profile to use to submit the job"), + ignoreFocusOut: true, + canPickMany: false, + }; + sessProfileName = await api.Gui.showQuickPick(profileNamesList, quickPickOptions); + if (!sessProfileName) { + api.Gui.infoMessage(localizedStrings.opCancelled); + return; } + } else if (profileNamesList.length > 0) { + sessProfileName = profileNamesList[0]; } else { - const filePathArray = doc.uri.fsPath.split(path.sep); - sessProfileName = filePathArray[filePathArray.length - 2]; + api.Gui.showMessage(localize("submitJcl.noProfile", "No profiles available")); } } else { - sessProfileName = regExp[1]; - if (sessProfileName.includes("[")) { - // if submitting from favorites, sesName might be the favorite node, so extract further - sessProfileName = sessionregex.exec(sessProfileName)[1]; - } + const start = path.join(globals.ZOWETEMPFOLDER + path.sep).length; + const pathSegments = doc.fileName.substring(start).split(path.sep); + sessProfileName = pathSegments[1]; } // get profile from session name