Skip to content

Commit

Permalink
Merge branch 'main' into e2e-extension-test-branch
Browse files Browse the repository at this point in the history
Signed-off-by: Chinmay Das <[email protected]>
  • Loading branch information
chinmdas authored Feb 28, 2025
2 parents 9e5d149 + 2d13589 commit c3cb212
Show file tree
Hide file tree
Showing 314 changed files with 4,534 additions and 4,045 deletions.
5 changes: 1 addition & 4 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ rules:
"@typescript-eslint/explicit-member-accessibility": off
"@typescript-eslint/explicit-function-return-type": off
"@typescript-eslint/restrict-template-expressions": off
indent": off
"@typescript-eslint/indent":
- error
- 2
"@typescript-eslint/indent": off

# There are several errors falling under these rules; resolve
"@typescript-eslint/no-for-in-array": off
Expand Down
11 changes: 11 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
plugins:
- "prettier-plugin-organize-imports"
printWidth: 150
tabWidth: 2
useTabs: false
semi: true
singleQuote: false
trailingComma: "es5"
bracketSpacing: true
arrowParens: "always"
experimentalTernaries: true
7 changes: 2 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,14 @@
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},

// Make sure people do not accidentally forget to sign
"git.alwaysSignOff": true,

"typescript.tsdk": "node_modules/typescript/lib",
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off",
// Standardize on the Prettier formatter
"editor.defaultFormatter": "esbenp.prettier-vscode",
// Enforce prettier on save
"editor.formatOnSave": true,
"npm.packageManager": "npm",
"eslint.packageManager": "npm"
}
"npm.packageManager": "npm"
}
30 changes: 25 additions & 5 deletions package-lock.json

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

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"lint": "npm run lint --workspaces",
"lintErrors": "npm run lintErrors --workspaces",
"prepare": "husky install",
"license": "node scripts/updateLicenses.js"
"license": "node scripts/updateLicenses.js",
"pretty": "turbo pretty --no-cache"
},
"devDependencies": {
"@types/glob": "^7.2.0",
Expand All @@ -35,7 +36,7 @@
"@zowe/zowe-explorer-api": "^3.1.1",
"chalk": "^4.1.2",
"eslint": "^8.37.0",
"eslint-config-prettier": "^8.6.0",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-deprecation": "^2.0.0",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-license-header": "^0.6.0",
Expand All @@ -53,7 +54,8 @@
"jest-stare": "^2.5.0",
"madge": "^6.0.0",
"npm-lockfile": "^4.0.0",
"prettier": "^3.2.5",
"prettier": "^3.5.2",
"prettier-plugin-organize-imports": "^4.1.0",
"rimraf": "^4.4.1",
"terser": "^5.16.8",
"ts-jest": "^29.1.0",
Expand Down
20 changes: 10 additions & 10 deletions packages/cli/__mocks__/@zowe/cli-test-utils.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*
* This program and the accompanying materials are made available under the terms of the
* Eclipse Public License v2.0 which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-v20.html
*
* SPDX-License-Identifier: EPL-2.0
*
* Copyright Contributors to the Zowe Project.
*
*/
/**
* This program and the accompanying materials are made available under the terms of the
* Eclipse Public License v2.0 which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-v20.html
*
* SPDX-License-Identifier: EPL-2.0
*
* Copyright Contributors to the Zowe Project.
*
*/

const original = jest.requireActual("@zowe/cli-test-utils") as any;
const nodePath = require("path");
Expand Down
53 changes: 26 additions & 27 deletions packages/cli/__tests__/__src__/ITestPropertiesSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,58 +14,57 @@
* see example_properties.yaml for descriptions and more details
*/
export interface ITestPropertiesSchema {

/**
* Properties related to connecting to CICS service
*/
* Properties related to connecting to CICS service
*/
cics: {
/**
* user ID to connect to CMCI
*/
user: string,
* user ID to connect to CMCI
*/
user: string;
/**
* Password to connect to CMCI
*/
password: string,
* Password to connect to CMCI
*/
password: string;
/**
* host name for CMCI
*/
host: string,
* host name for CMCI
*/
host: string;
/**
* Port for CMCI
*/
port?: number,
* Port for CMCI
*/
port?: number;

/**
* http or https protocol for CMCI
*/
* http or https protocol for CMCI
*/
protocol?: string;

/**
* http or https protocol for CMCI
*/
* http or https protocol for CMCI
*/
rejectUnauthorized?: boolean;
};

/**
* Properties related to connecting to CMCI
*/
* Properties related to connecting to CMCI
*/
cmci: {
/**
* CSD group to define resources to
*/
* CSD group to define resources to
*/
csdGroup?: string;

/**
* Name of the CICS region e.g. "CICSCMCI"
*/
* Name of the CICS region e.g. "CICSCMCI"
*/
regionName?: string;
};

urimap: {
/**
* Name of the certificate to use for CICS Client Testing
*/
* Name of the certificate to use for CICS Client Testing
*/
certificate?: string;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ import { ITestPropertiesSchema } from "../../../__src__/ITestPropertiesSchema";

let TEST_ENVIRONMENT: ITestEnvironment<ITestPropertiesSchema>;
describe("CICS add-to-list csdGroup command", () => {

beforeAll(async () => {
TEST_ENVIRONMENT = await TestEnvironment.setUp({
testName: "add_to_list_csdGroup",
installPlugin: true,
tempProfileTypes: ["cics"]
tempProfileTypes: ["cics"],
});
});

Expand All @@ -35,8 +34,7 @@ describe("CICS add-to-list csdGroup command", () => {
});

it("should get a syntax error if csdGroup name is omitted", () => {
const output = runCliScript(__dirname + "/__scripts__/add_to_list_csdGroup.sh", TEST_ENVIRONMENT,
["", "FAKELIST", "FAKERGN"]);
const output = runCliScript(__dirname + "/__scripts__/add_to_list_csdGroup.sh", TEST_ENVIRONMENT, ["", "FAKELIST", "FAKERGN"]);
const stderr = output.stderr.toString();
expect(stderr).toContain("Syntax");
expect(stderr).toContain("Missing Positional Argument");
Expand All @@ -45,8 +43,7 @@ describe("CICS add-to-list csdGroup command", () => {
});

it("should get a syntax error if list name is omitted", () => {
const output = runCliScript(__dirname + "/__scripts__/add_to_list_csdGroup.sh", TEST_ENVIRONMENT,
["FAKEGRP", "", "FAKERGN"]);
const output = runCliScript(__dirname + "/__scripts__/add_to_list_csdGroup.sh", TEST_ENVIRONMENT, ["FAKEGRP", "", "FAKERGN"]);
const stderr = output.stderr.toString();
expect(stderr).toContain("Syntax");
expect(stderr).toContain("Missing Positional Argument");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
*/

import { ITestEnvironment, TestEnvironment, runCliScript } from "@zowe/cli-test-utils";
import { ITestPropertiesSchema } from "../../../__src__/ITestPropertiesSchema";
import { generateRandomAlphaNumericString } from "../../../__src__/TestUtils";
import { Session } from "@zowe/imperative";
import { CicsCmciConstants, CicsCmciRestClient } from "../../../../src";
import { ITestPropertiesSchema } from "../../../__src__/ITestPropertiesSchema";
import { generateRandomAlphaNumericString } from "../../../__src__/TestUtils";

let TEST_ENVIRONMENT: ITestEnvironment<ITestPropertiesSchema>;
let regionName: string;
Expand All @@ -25,12 +25,11 @@ let password: string;
let protocol: string;
let rejectUnauthorized: boolean;
describe("CICS define program command", () => {

beforeAll(async () => {
TEST_ENVIRONMENT = await TestEnvironment.setUp({
testName: "define_program",
installPlugin: true,
tempProfileTypes: ["cics"]
tempProfileTypes: ["cics"],
});
csdGroup = TEST_ENVIRONMENT.systemTestProperties.cmci.csdGroup;
regionName = TEST_ENVIRONMENT.systemTestProperties.cmci.regionName;
Expand All @@ -56,12 +55,14 @@ describe("CICS define program command", () => {
user: cicsProperties.user,
password: cicsProperties.password,
rejectUnauthorized: cicsProperties.rejectUnauthorized || false,
protocol: cicsProperties.protocol as any || "https",
protocol: (cicsProperties.protocol as any) || "https",
});

return CicsCmciRestClient.deleteExpectParsedXml(session,
return CicsCmciRestClient.deleteExpectParsedXml(

Check warning on line 61 in packages/cli/__tests__/__system__/define/program/cli.define.program.system.test.ts

View workflow job for this annotation

GitHub Actions / lint

Unsafe return of an `any` typed value
session,
`/${CicsCmciConstants.CICS_SYSTEM_MANAGEMENT}/CICSDefinitionProgram/${cmciProperties.regionName}` +
`?CRITERIA=(NAME=${programName})&PARAMETER=CSDGROUP(${cmciProperties.csdGroup})`);
`?CRITERIA=(NAME=${programName})&PARAMETER=CSDGROUP(${cmciProperties.csdGroup})`
);
};

it("should be able to display the help", () => {
Expand Down Expand Up @@ -102,21 +103,21 @@ describe("CICS define program command", () => {
it("should be able to successfully define a program using profile options", async () => {
const programNameSuffixLength = 4;
const programName = "DFN" + generateRandomAlphaNumericString(programNameSuffixLength);
const output = runCliScript(__dirname + "/__scripts__/define_program_fully_qualified.sh", TEST_ENVIRONMENT,
[programName,
csdGroup,
regionName,
host,
port,
user,
password,
protocol,
rejectUnauthorized]);
const output = runCliScript(__dirname + "/__scripts__/define_program_fully_qualified.sh", TEST_ENVIRONMENT, [
programName,
csdGroup,
regionName,
host,
port,
user,
password,
protocol,
rejectUnauthorized,
]);
const stderr = output.stderr.toString();
expect(stderr).toEqual("");
expect(output.status).toEqual(0);
expect(output.stdout.toString()).toContain("success");
await deleteProgram(programName);
});

});
Loading

0 comments on commit c3cb212

Please sign in to comment.