Skip to content

Commit

Permalink
Merge branch 'master' into zos-download-attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
jace-roell authored Nov 6, 2024
2 parents 685fa54 + 440f8e3 commit 35a2351
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
4 changes: 4 additions & 0 deletions __tests__/__packages__/cli-test-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to the Zowe CLI test utils package will be documented in this file.

## Recent Changes

- BugFix: Improved the error message shown on MacOS when `runCliScript` method fails to run script that is missing shebang line. [#2314](https://github.com/zowe/zowe-cli/pull/2314)

## `8.1.1`

- BugFix: Updated peer dependencies to `^8.0.0`, dropping support for versions tagged `next`. [#2287](https://github.com/zowe/zowe-cli/pull/2287)
Expand Down
7 changes: 6 additions & 1 deletion __tests__/__packages__/cli-test-utils/src/TestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/

import * as fs from "fs";
import * as path from "path";
import { spawnSync, SpawnSyncReturns, ExecFileException } from "child_process";
import { ITestEnvironment } from "./environment/doc/response/ITestEnvironment";
import { ICommandDefinition, IHandlerParameters } from "@zowe/imperative";
Expand Down Expand Up @@ -55,12 +56,16 @@ export function runCliScript(scriptPath: string, testEnvironment: ITestEnvironme
} catch {
fs.chmodSync(scriptPath, "755");
}
return spawnSync(scriptPath, args, {
const response = spawnSync(scriptPath, args, {
cwd: testEnvironment.workingDir,
env: childEnv,
encoding: "buffer"
});
if (process.platform === "darwin" && (response.error as ExecFileException)?.errno === -8) {
throw new Error(`The script file ${path.basename(scriptPath)} failed to execute. Check that it starts with a shebang line.`);
}

return response;
} else {
throw new Error(`The script file ${scriptPath} doesn't exist`);

Expand Down
5 changes: 1 addition & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,11 @@ module.exports = {
...projectConfig,
"reporters": [
"default",
"jest-stare",
["jest-junit", {
"outputDirectory": "__tests__/__results__",
"reportTestSuiteErrors": true
}],
["jest-stare", {
"coverageLink": "../unit/coverage/lcov-report/index.html",
"resultDir": "__tests__/__results__/jest-stare"
}],
["github-actions", { "silent": false } ]
],
"testResultsProcessor": "jest-sonar-reporter",
Expand Down
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,13 @@
},
"jestSonar": {
"reportPath": "__tests__/__results__/jest-sonar"
},
"jest-stare": {
"additionalResultsProcessors": [
"jest-junit",
"jest-sonar-reporter"
],
"coverageLink": "../unit/coverage/lcov-report/index.html",
"resultDir": "__tests__/__results__/jest-stare"
}
}
4 changes: 2 additions & 2 deletions packages/zosjobs/__tests__/__system__/GetJobs.system.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -719,8 +719,7 @@ describe("Get Jobs - System Tests", () => {

it("should be able to get a job that was submitted and get proper error when the job is deleted", async () => {
const job = await SubmitJobs.submitJcl(REAL_SESSION, JCL);
const jobStatus = await GetJobs.getStatusForJob(REAL_SESSION, job);

await wait(3000);
await DeleteJobs.deleteJobForJob(REAL_SESSION, job);
await wait(3000); // make sure jobs is deleted
let error;
Expand Down Expand Up @@ -978,6 +977,7 @@ describe("Get Jobs - System Tests", () => {
describe("invalid request error handling", () => {
it("should detect and surface an error for getting JCL that doesnt exist", async () => {
const job = await SubmitJobs.submitJcl(REAL_SESSION, JCL);
await wait(3000);
await DeleteJobs.deleteJobForJob(REAL_SESSION, job);
await wait(3000);
let error;
Expand Down

0 comments on commit 35a2351

Please sign in to comment.