Skip to content

Commit

Permalink
Merge pull request #4 from ni892489/main-hizir-test
Browse files Browse the repository at this point in the history
Main hizir test
  • Loading branch information
hizir-bc authored and GitHub Enterprise committed May 9, 2022
2 parents b6d93a5 + 688e926 commit 17e8c8a
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 19 deletions.
4 changes: 2 additions & 2 deletions GSECONF/DOGGOS/COBOL/DOGGOS.CBL
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
01 BREED-INDEXES.
05 SHIBA-INDEX.
10 SHIBA-INDEX-VALUE PIC 9(1) VALUE 1.
10 SHIBA-BREED-NAME PIC X(5) VALUE 'SHIBA'.
10 SHIBA-BREED-NAME PIC X(5) VALUE 'SHIBA'.
05 SHNAUTZER-INDEX.
10 SHNAUTZER-INDEX-VALUE PIC 9(1) VALUE 2.
10 SHNAUTZER-BREED-NAME PIC X(9) VALUE 'SHNAUTZER'.
Expand Down Expand Up @@ -183,7 +183,7 @@
EVALUATE INP-DOG-BREED
WHEN SHIBA-BREED-NAME
ADD INP-ADOPTED-AMOUNT
TO BREED-ADOPTIONS(SHIBA-INDEX-VALUE)
TO BREED-ADOPTIONS(SHIBA-INDEX-VALUE)
WHEN SHNAUTZER-BREED-NAME
ADD INP-ADOPTED-AMOUNT
TO BREED-ADOPTIONS(SHNAUTZER-INDEX-VALUE)
Expand Down
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ Once you have met the prerequisites,

### Running The Test Case

1. Navigate to the **test4z/test/doggos/doggos.test.ts** file and check the regression test codes.

1. Run the following command to configure Test4z and deploy the input file to the mainframe, enter your username when
the command prompt asks:

npm run configure

1. Navigate to the **test/doggos/doggos.test.ts** file and check the regression test codes.
2. Run the test suite using the following command:

npm run test
Expand All @@ -57,18 +63,18 @@ Once you have met the prerequisites,

### Extending the test suite

1. Navigate to the **test4z/scripts/files/DOGGOS.INPUT** file. Add a new breed with a number of adoptions, or change
1. Navigate to the **scripts/files/DOGGOS.INPUT** file. Add a new breed with a number of adoptions, or change
the number of adoptions for an existing breed.
2. Upload the new input dataset to the mainframe using the following command, enter your username when
the command prompt asks:

npm run uploadFile
npm run uploadFile

3. Navigate to the **test4z/test/doggos/doggos.test.ts** file back, and run it using the following command:
3. Navigate to the **test/doggos/doggos.test.ts** file back, and run it using the following command:

npm run test

4. Observe the failed test cases, update them according to your changes in the DOGGOS.INPUT file (from the 1st step).
4. Observe the failed test cases, update the test assertions according to your changes in the 1st step for the INPUT file.
If you added a new breed, create a test suite for it by following the existing breed test cases.
5. Run the test suite again, and verify all the test cases are passing.

Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
"author": "Broadcom",
"scripts": {
"test": "jest",
"setup": "sh scripts/test-setup.sh",
"postinstall": "npm run setup && npm run uploadFile",
"uploadFile": "cd scripts && sh upload.sh"
"configure": "cd scripts && sh configure.sh",
"uploadFile": "cd scripts && sh upload-file.sh"
},
"devDependencies": {
"@types/jest": "^26.0.15",
Expand Down
20 changes: 16 additions & 4 deletions scripts/test-setup.sh → scripts/configure.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
#!/bin/bash
set -e
source ./basescript.sh

printf "\nConfiguring Test4z...\n\n"

printf "Enter username: "
read USER_NAME

npx zowe config set profiles.lpar1.profiles.test4z.properties.hlq "$USER_NAME"
npx zowe config set --secure profiles.lpar1.profiles.test4z.properties.user "$USER_NAME"
npx zowe config set --secure profiles.lpar1.profiles.test4z.properties.password "$USER_NAME"

npx zowe config set --secure profiles.lpar1.profiles.zosmf.properties.user "$USER_NAME"
npx zowe config set --secure profiles.lpar1.profiles.zosmf.properties.password "$USER_NAME"
printf "\n#########################################"
printf "\n#### Test4z configuration successful ####"
printf "\n#########################################"
printf "\n#########################################\n\n"

printf "Deploying the input file to the Mainframe\n\n"

hlq=$USER_NAME
tempDirectoryName="FILES_TEMP";
DOGGOS_INPUT="DOGGOS.INPUT";
DOGGOS_INPUT_NEW="DOGGOS.INPUT.NEW";
DOGGOS_RUNAPP="DOGGOS.RUNAPP"
storageClass="CAEDS6";
upload "$DOGGOS_INPUT" files/DOGGOS.INPUT DS N
printf "\n###########################################################"
printf "\n# Input dataset successfully deployed to the Z/OS system #"
printf "\n###########################################################\n"
7 changes: 2 additions & 5 deletions scripts/upload.sh → scripts/upload-file.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
#!/bin/bash
set -e
source ./basescript.sh

printf "\nDeploying the input file to the Mainframe\n\n"

printf "Enter username: "
read hlq
printf "\nDeploying the input file to the Mainframe\n\n"
tempDirectoryName="FILES_TEMP";
DOGGOS_INPUT="DOGGOS.INPUT";
DOGGOS_INPUT_NEW="DOGGOS.INPUT.NEW";
DOGGOS_RUNAPP="DOGGOS.RUNAPP"
storageClass="CAEDS6";
upload "$DOGGOS_INPUT" files/DOGGOS.INPUT DS N
printf "Datasets successfully deployed to the Z/OS system\n\n";
printf "\n###########################################################"
printf "\n#### Datasets successfully deployed to the Z/OS system ####"
printf "\n# Input dataset successfully deployed to the Z/OS system #"
printf "\n###########################################################\n"

0 comments on commit 17e8c8a

Please sign in to comment.