Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/zowe/zowe-cli into error-…
Browse files Browse the repository at this point in the history
…msg-help-version

Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
  • Loading branch information
zFernand0 committed Nov 5, 2024
2 parents f8f520d + 440f8e3 commit 6545a33
Show file tree
Hide file tree
Showing 202 changed files with 5,189 additions and 1,123 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module.exports = {
],
"rules": {
"@typescript-eslint/no-magic-numbers": "off",
"@typescript-eslint/no-restricted-imports": "off",
"jest/expect-expect": ["warn", {
"assertFunctionNames": ["expect*", "**.*expect*"]
}],
Expand Down Expand Up @@ -64,6 +65,11 @@ module.exports = {
"ignoreEnums": true,
"ignoreReadonlyClassProperties": true
}],
"@typescript-eslint/no-restricted-imports": ["error", {
"patterns": [{
"group": ["**/../lib", "**/../src"]
}]
}],
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/semi": "warn",
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ jobs:
- name: Configure Sonar Scan
uses: zowe-actions/octorelease/script@v1
env:
COVERAGE_ARTIFACT: "ubuntu-latest-18.x-results:__tests__/__results__"
COVERAGE_ARTIFACT: "ubuntu-22.04-20.x-results:__tests__/__results__"
# COVERAGE_ARTIFACT: "ubuntu-latest-20.x-results:__tests__/__results__"
with:
script: sonarConfig

Expand Down
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
4 changes: 2 additions & 2 deletions __tests__/__packages__/cli-test-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zowe/cli-test-utils",
"version": "8.2.0",
"version": "8.7.0",
"description": "Test utilities package for Zowe CLI plug-ins",
"author": "Zowe",
"license": "EPL-2.0",
Expand Down Expand Up @@ -43,7 +43,7 @@
"devDependencies": {
"@types/js-yaml": "^4.0.9",
"@types/uuid": "^10.0.0",
"@zowe/imperative": "8.2.0"
"@zowe/imperative": "8.7.0"
},
"peerDependencies": {
"@zowe/imperative": "^8.0.0"
Expand Down
11 changes: 9 additions & 2 deletions __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 Expand Up @@ -121,7 +126,9 @@ export function mockHandlerParameters(params: PartialHandlerParameters): IHandle
},
progress: {
startBar: jest.fn((parms) => undefined),
endBar: jest.fn(() => undefined)
endBar: jest.fn(() => undefined),
startSpinner: jest.fn(() => undefined),
endSpinner: jest.fn(() => undefined)
},
format: {
output: jest.fn((parms) => {
Expand Down
2 changes: 2 additions & 0 deletions __tests__/__resources__/properties/default_properties.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ zosjobs:
modifiedJobclass: B
# System affinity
sysaff: zosjobs-sysaff
# CIM Support
skipCIM: false
#-----------------------------------------------------------------------------#
# Set of properties for testing provisioning #
#-----------------------------------------------------------------------------#
Expand Down
1 change: 1 addition & 0 deletions __tests__/__src__/properties/ITestZosJobsSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export interface ITestZosJobsSchema {
jobclass: string;
modifiedJobclass: string;
sysaff: string;
skipCIM?: boolean;
}
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
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "8.3.0",
"version": "8.7.0",
"command": {
"publish": {
"ignoreChanges": [
Expand Down
116 changes: 58 additions & 58 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6545a33

Please sign in to comment.