From c5aea42ba51bb6a195d3a157a67bc6fba0e989cd Mon Sep 17 00:00:00 2001 From: Martin Zeithaml Date: Tue, 5 Nov 2024 13:21:35 +0100 Subject: [PATCH 1/6] Use xplatform for logging Signed-off-by: Martin Zeithaml --- CHANGELOG.md | 3 ++- bin/libs/common.ts | 33 +++++++++------------------------ 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d76a381ddc..ad7f0afd6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,8 @@ All notable changes to the Zowe Installer will be documented in this file. ## `2.18.1` -- Bugfix: When `--log-dir` parameter for `zwe` command is a file, there might be an error "InternalError: stack overflow". [#40nn](https://github.com/zowe/zowe-install-packaging/pull/40nn) +- Bugfix: When logging `zwe` command, sometimes the log has wrong file tag and the log is unreadable. [#40nn](https://github.com/zowe/zowe-install-packaging/pull/40nn) +- Bugfix: When `--log-dir` parameter for `zwe` command is a file, there might be an error "InternalError: stack overflow". [#4063](https://github.com/zowe/zowe-install-packaging/pull/4063) - Bugfix: Error message `ZWEL0141E` did not print user ID. [#3971](https://github.com/zowe/zowe-install-packaging/pull/3971) ## `2.17.0` diff --git a/bin/libs/common.ts b/bin/libs/common.ts index 7eabf33f5f..bee6a059f4 100644 --- a/bin/libs/common.ts +++ b/bin/libs/common.ts @@ -128,36 +128,21 @@ export function date(...args: string[]): string|undefined { let logExists = false; -let logFile:std.File|null = null; function writeLog(message: string): boolean { + const filename = std.getenv('ZWE_PRIVATE_LOG_FILE'); + if (!filename) { + return false; + } + logExists = fs.fileExists(filename); if (!logExists) { - const filename = std.getenv('ZWE_PRIVATE_LOG_FILE'); - if (filename) { + fs.createFile(filename, 0o640, message); logExists = fs.fileExists(filename); - if (!logExists) { - fs.createFile(filename, 0o640, message); - logExists = fs.fileExists(filename); - } - if (logExists) { - let errObj = {errno:undefined}; - logFile = std.open(filename, 'w', errObj); - if (errObj.errno) { - printError(`Error opening file ${filename}, errno=${errObj.errno}`); - logFile=null; - logExists=false; - return false; - } - } - } - } - if (logFile===undefined || logFile===null) { - return false; } else { - //TODO this does utf8. should we flip it to 1047 on zos? - logFile.puts(message); - return true; + xplatform.appendFileUTF8(filename, xplatform.AUTO_DETECT, message); + return true; } + return logExists; } From beff0053c4ee169484a8a5292d2e9fec0971aa86 Mon Sep 17 00:00:00 2001 From: Martin Zeithaml Date: Tue, 5 Nov 2024 13:25:12 +0100 Subject: [PATCH 2/6] Changelog update Signed-off-by: Martin Zeithaml --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad7f0afd6c..950cf6954c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to the Zowe Installer will be documented in this file. ## `2.18.1` -- Bugfix: When logging `zwe` command, sometimes the log has wrong file tag and the log is unreadable. [#40nn](https://github.com/zowe/zowe-install-packaging/pull/40nn) +- Bugfix: When logging `zwe` command, sometimes the log has wrong file tag and the log is unreadable. [#4068](https://github.com/zowe/zowe-install-packaging/pull/4068) - Bugfix: When `--log-dir` parameter for `zwe` command is a file, there might be an error "InternalError: stack overflow". [#4063](https://github.com/zowe/zowe-install-packaging/pull/4063) - Bugfix: Error message `ZWEL0141E` did not print user ID. [#3971](https://github.com/zowe/zowe-install-packaging/pull/3971) From a6caf7490bfb4f4c20941d3e5e204e0e6d699054 Mon Sep 17 00:00:00 2001 From: MarkAckert Date: Mon, 4 Nov 2024 16:09:23 -0500 Subject: [PATCH 3/6] all zlux ui plugin tests through apiml Signed-off-by: MarkAckert --- tests/sanity/test/e2e/test-07-iframe.js | 2 +- tests/sanity/test/e2e/test-08-subsys.js | 2 +- tests/sanity/test/e2e/test-10-api-catalog.js | 4 +++- tests/sanity/test/e2e/test-11-workflows.js | 2 +- tests/sanity/test/e2e/test-12-angular-sample.js | 2 +- tests/sanity/test/e2e/test-13-react-sample.js | 2 +- tests/sanity/test/e2e/test-14-ip-explorer.js | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/sanity/test/e2e/test-07-iframe.js b/tests/sanity/test/e2e/test-07-iframe.js index 2962918ba4..13c7b668b1 100644 --- a/tests/sanity/test/e2e/test-07-iframe.js +++ b/tests/sanity/test/e2e/test-07-iframe.js @@ -47,7 +47,7 @@ describe.skip(`test ${APP_TO_TEST}`, function() { // load MVD login page await loginMVD( driver, - `https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_ZLUX_HTTPS_PORT}/`, + `https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_API_MEDIATION_GATEWAY_HTTP_PORT}/zlux/ui/v1/ZLUX/plugins/org.zowe.zlux.bootstrap/web/`, process.env.SSH_USER, process.env.SSH_PASSWD ); diff --git a/tests/sanity/test/e2e/test-08-subsys.js b/tests/sanity/test/e2e/test-08-subsys.js index d10735e604..f4cfcff868 100644 --- a/tests/sanity/test/e2e/test-08-subsys.js +++ b/tests/sanity/test/e2e/test-08-subsys.js @@ -40,7 +40,7 @@ describe.skip(`test ${APP_TO_TEST}`, function() { // load MVD login page await loginMVD( driver, - `https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_ZLUX_HTTPS_PORT}/`, + `https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_API_MEDIATION_GATEWAY_HTTP_PORT}/zlux/ui/v1/ZLUX/plugins/org.zowe.zlux.bootstrap/web/`, process.env.SSH_USER, process.env.SSH_PASSWD ); diff --git a/tests/sanity/test/e2e/test-10-api-catalog.js b/tests/sanity/test/e2e/test-10-api-catalog.js index ab42adab69..9723150c16 100644 --- a/tests/sanity/test/e2e/test-10-api-catalog.js +++ b/tests/sanity/test/e2e/test-10-api-catalog.js @@ -45,7 +45,7 @@ describe(`test ${APP_TO_TEST}`, function() { // load MVD login page await loginMVD( driver, - `https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_ZLUX_HTTPS_PORT}/`, + `https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_ZLUX_HTTPS_PORT}/zlux/ui/v1/ZLUX/plugins/org.zowe.zlux.bootstrap/web/`, process.env.SSH_USER, process.env.SSH_PASSWD ); @@ -79,6 +79,8 @@ describe(`test ${APP_TO_TEST}`, function() { try { const searchBox = await waitUntilElement(driver, '.search-bar'); expect(searchBox).to.be.an('object'); + await saveScreenshotWithIframeAppContext(this, driver, testName, 'login-pre-success', APP_TO_TEST, MVD_IFRAME_APP_CONTENT); + } catch (e) { // try to save screenshot for debug purpose await saveScreenshotWithIframeAppContext(this, driver, testName, 'login-failed', APP_TO_TEST, MVD_IFRAME_APP_CONTENT); diff --git a/tests/sanity/test/e2e/test-11-workflows.js b/tests/sanity/test/e2e/test-11-workflows.js index 2bfde0962d..df0b21dc77 100644 --- a/tests/sanity/test/e2e/test-11-workflows.js +++ b/tests/sanity/test/e2e/test-11-workflows.js @@ -40,7 +40,7 @@ describe.skip(`test ${APP_TO_TEST}`, function() { // load MVD login page await loginMVD( driver, - `https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_ZLUX_HTTPS_PORT}/`, + `https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_API_MEDIATION_GATEWAY_HTTP_PORT}/zlux/ui/v1/ZLUX/plugins/org.zowe.zlux.bootstrap/web/`, process.env.SSH_USER, process.env.SSH_PASSWD ); diff --git a/tests/sanity/test/e2e/test-12-angular-sample.js b/tests/sanity/test/e2e/test-12-angular-sample.js index addeb9fc4c..57248ca41d 100644 --- a/tests/sanity/test/e2e/test-12-angular-sample.js +++ b/tests/sanity/test/e2e/test-12-angular-sample.js @@ -44,7 +44,7 @@ describe.skip(`test ${APP_TO_TEST}`, function() { // load MVD login page await loginMVD( driver, - `https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_ZLUX_HTTPS_PORT}/`, + `https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_API_MEDIATION_GATEWAY_HTTP_PORT}/zlux/ui/v1/ZLUX/plugins/org.zowe.zlux.bootstrap/web/`, process.env.SSH_USER, process.env.SSH_PASSWD ); diff --git a/tests/sanity/test/e2e/test-13-react-sample.js b/tests/sanity/test/e2e/test-13-react-sample.js index d2fee77eca..ac01c05d0f 100644 --- a/tests/sanity/test/e2e/test-13-react-sample.js +++ b/tests/sanity/test/e2e/test-13-react-sample.js @@ -44,7 +44,7 @@ describe.skip(`test ${APP_TO_TEST}`, function() { // load MVD login page await loginMVD( driver, - `https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_ZLUX_HTTPS_PORT}/`, + `https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_API_MEDIATION_GATEWAY_HTTP_PORT}/zlux/ui/v1/ZLUX/plugins/org.zowe.zlux.bootstrap/web/`, process.env.SSH_USER, process.env.SSH_PASSWD ); diff --git a/tests/sanity/test/e2e/test-14-ip-explorer.js b/tests/sanity/test/e2e/test-14-ip-explorer.js index 99f9eb3326..0b274fd66d 100644 --- a/tests/sanity/test/e2e/test-14-ip-explorer.js +++ b/tests/sanity/test/e2e/test-14-ip-explorer.js @@ -40,7 +40,7 @@ describe(`test ${APP_TO_TEST}`, function() { // load MVD login page await loginMVD( driver, - `https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_ZLUX_HTTPS_PORT}/`, + `https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_API_MEDIATION_GATEWAY_HTTP_PORT}/zlux/ui/v1/ZLUX/plugins/org.zowe.zlux.bootstrap/web/`, process.env.SSH_USER, process.env.SSH_PASSWD ); From 88725f98596b8d89b44b02ef39d02d3681759b5a Mon Sep 17 00:00:00 2001 From: MarkAckert Date: Mon, 4 Nov 2024 16:23:27 -0500 Subject: [PATCH 4/6] missed one port Signed-off-by: MarkAckert --- tests/sanity/test/e2e/test-10-api-catalog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sanity/test/e2e/test-10-api-catalog.js b/tests/sanity/test/e2e/test-10-api-catalog.js index 9723150c16..ba53108906 100644 --- a/tests/sanity/test/e2e/test-10-api-catalog.js +++ b/tests/sanity/test/e2e/test-10-api-catalog.js @@ -45,7 +45,7 @@ describe(`test ${APP_TO_TEST}`, function() { // load MVD login page await loginMVD( driver, - `https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_ZLUX_HTTPS_PORT}/zlux/ui/v1/ZLUX/plugins/org.zowe.zlux.bootstrap/web/`, + `https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_API_MEDIATION_GATEWAY_HTTP_PORT}/zlux/ui/v1/ZLUX/plugins/org.zowe.zlux.bootstrap/web/`, process.env.SSH_USER, process.env.SSH_PASSWD ); From d3d3b773df8fcc1a76f501234b1f0c18abe072ae Mon Sep 17 00:00:00 2001 From: Martin Zeithaml <66114686+Martin-Zeithaml@users.noreply.github.com> Date: Thu, 21 Nov 2024 08:53:47 +0100 Subject: [PATCH 5/6] Update `xplatform.d.ts` with `appendFileUTF8` Signed-off-by: Martin Zeithaml <66114686+Martin-Zeithaml@users.noreply.github.com> --- build/zwe/types/@qjstypes/xplatform.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/build/zwe/types/@qjstypes/xplatform.d.ts b/build/zwe/types/@qjstypes/xplatform.d.ts index f139e1ac00..6d4572936e 100644 --- a/build/zwe/types/@qjstypes/xplatform.d.ts +++ b/build/zwe/types/@qjstypes/xplatform.d.ts @@ -27,6 +27,7 @@ export function stringFromBytes(data:ArrayBuffer, offset:number, length:number, */ export function loadFileUTF8(path:string, sourceCCSID:number):string; export function storeFileUTF8(path:string, targetCCSID:number, content:string):number; +export function appendFileUTF8(path: string, targetCCSID:number, content:string):number; export var AUTO_DETECT:number; export var NO_CONVERT:number; From 3a64038a4c46afcbdb87fe85b27e85cca3ce8ff4 Mon Sep 17 00:00:00 2001 From: MarkAckert Date: Tue, 26 Nov 2024 15:57:23 -0500 Subject: [PATCH 6/6] trigger ci Signed-off-by: MarkAckert