Skip to content

Add a new upgrade test case #4141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: v3.x/staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/scripts/cicd_test/make_matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ case $install_test_choice in
test_file="$INSTALL_PTF_TWICE_TESTFILE"
;;

"Upgrade Zowe (3.0 to latest)")
test_file="$UPGRADE_ZOWE_TESTFILE"
;;

"VSAM Caching Storage Method")
test_file="$VSAM_CACHING_STORAGE_METHOD_TESTFILE"
;;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ else
fi

if [[ -n "$use_defaut" ]]; then
if [[ "$MATRIX_TEST" == *install-fmid.ts ]] || [[ "$MATRIX_TEST" == *install-ptf.ts ]]; then
if [[ "$MATRIX_TEST" == *install-fmid.ts ]] || [[ "$MATRIX_TEST" == *install-ptf.ts ]] || [[ "$MATRIX_TEST" == *install-base-then-upgrade.ts ]]; then
zowe_artifactory_pattern_interim="$DEFAULT_ZOWE_SMPE_ARTIFACTORY_PATTERN"
else
zowe_artifactory_pattern_interim="$DEFAULT_ZOWE_PAX_ARTIFACTORY_PATTERN"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/cicd-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ on:
- Infinispan Caching Storage Method
- Config Manager
- Generate API Documentation
- Upgrade Zowe (3.0 to latest)
- Zowe Nightly Tests
- Zowe Release Tests
custom-zowe-artifactory-pattern-or-build-number:
Expand Down Expand Up @@ -89,6 +90,7 @@ env:
ZOS_NODE_V22_TESTFILE: extended/node-versions/node-v22.ts
NON_STRICT_VERIFY_EXTERNAL_CERTIFICATE_TESTFILE: extended/certificates/nonstrict-verify-external-certificate.ts
INSTALL_PTF_TWICE_TESTFILE: extended/install-ptf-two-times.ts
UPGRADE_ZOWE_TESTFILE: extended/upgrades/install-base-then-upgrade.ts
VSAM_CACHING_STORAGE_METHOD_TESTFILE: extended/caching-storages/vsam-storage.ts
INFINISPAN_CACHING_STORAGE_METHOD_TESTFILE: extended/caching-storages/infinispan-storage.ts
CONFIG_MANAGER_TESTFILE: extended/config-manager/enable-config-manager.ts
Expand Down
1 change: 1 addition & 0 deletions playbooks/install-ptf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
# Configure Zowe ?
- import_role:
name: configure
when: zowe_ptf_configure|default(True)

# ============================================================================
# Customize for testing
Expand Down
1 change: 1 addition & 0 deletions tests/installation/src/__tests__/basic/install-ptf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe(testSuiteName, () => {
await installAndVerifySmpePtf(
testSuiteName,
process.env.TEST_SERVER,
{},
{
'zowe_build_local': process.env['ZOWE_BUILD_LOCAL'],
'zowe_custom_for_test': 'true',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe(testSuiteName, () => {
await installAndVerifySmpePtf(
testSuiteName,
testServer,
{},
{
'zowe_build_local': process.env['ZOWE_BUILD_LOCAL'],
'zowe_custom_for_test': 'true',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe(testSuiteName, () => {
await installAndVerifySmpePtf(
testSuiteName,
testServer,
{},
{
'zowe_build_local': process.env['ZOWE_BUILD_LOCAL'],
'zowe_custom_for_test': 'true',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe(testSuiteName, () => {
await installAndVerifySmpePtf(
testSuiteName,
testServer,
{},
{
'zowe_build_local': process.env['ZOWE_BUILD_LOCAL'],
'zowe_custom_for_test': 'true',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* 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 IBM Corporation 2020
*/

import {
checkMandatoryEnvironmentVariables,
installAndVerifySmpePtf,
showZoweRuntimeLogs,
} from '../../../utils';
import { TEST_TIMEOUT_SMPE_FMID, TEST_TIMEOUT_SMPE_PTF } from '../../../constants';

const testSuiteName = 'Test 3.0 base install then upgrade (basic config)';
describe(testSuiteName, () => {
beforeAll(() => {
// validate variables
checkMandatoryEnvironmentVariables([
'TEST_SERVER',
'ZOWE_BUILD_LOCAL',
]);
});

test('install and verify', async () => {
await installAndVerifySmpePtf(
testSuiteName,
process.env.TEST_SERVER,
{
'zowe_custom_for_test': 'true'
},
{
'zowe_build_local': process.env['ZOWE_BUILD_LOCAL'],
'zowe_custom_for_test': false,
'zowe_ptf_configure': false,
'zowe_lock_keystore': 'false',
}
);
}, TEST_TIMEOUT_SMPE_FMID + TEST_TIMEOUT_SMPE_PTF); // long timeout since we start + test both


afterAll(async () => {
await showZoweRuntimeLogs(process.env.TEST_SERVER);
});

});
19 changes: 12 additions & 7 deletions tests/installation/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
*
* @param {Any} obj any object
*/
export function calculateHash(obj: any): string {

Check warning on line 53 in tests/installation/src/utils.ts

View workflow job for this annotation

GitHub Actions / cicd-test (extended/upgrades/install-base-then-upgrade.ts, marist-zzow10)

Unexpected any. Specify a different type
return crypto.createHash('md5').update(util.format('%j', obj)).digest('hex');
}

Expand Down Expand Up @@ -87,7 +87,7 @@
* @param {Object} extraVars Object
* @param {String} serverId String
*/
export function importDefaultExtraVars(extraVars: {[key: string]: any}, serverId: string): void {

Check warning on line 90 in tests/installation/src/utils.ts

View workflow job for this annotation

GitHub Actions / cicd-test (extended/upgrades/install-base-then-upgrade.ts, marist-zzow10)

Unexpected any. Specify a different type
const defaultMapping: {[key: string]: string[]} = {
'ansible_ssh_host' : ['SSH_HOST'],
'ansible_port' : ['SSH_PORT'],
Expand Down Expand Up @@ -138,7 +138,7 @@
* @param {Object} extraVars
* @param {String} verbose
*/
export function runAnsiblePlaybook(testcase: string, playbook: string, serverId: string, extraVars: {[key: string]: any} = {}, verbose = '-v'): Promise<PlaybookResponse> {

Check warning on line 141 in tests/installation/src/utils.ts

View workflow job for this annotation

GitHub Actions / cicd-test (extended/upgrades/install-base-then-upgrade.ts, marist-zzow10)

Unexpected any. Specify a different type
return new Promise((resolve, reject) => {
const result: PlaybookResponse = {
reportHash: calculateHash(testcase),
Expand Down Expand Up @@ -185,7 +185,7 @@
});
}

async function verifyZowe(testcase: string, serverId: string, extraVars: {[key: string]: any} = {}): Promise<PlaybookResponse> {

Check warning on line 188 in tests/installation/src/utils.ts

View workflow job for this annotation

GitHub Actions / cicd-test (extended/upgrades/install-base-then-upgrade.ts, marist-zzow10)

Unexpected any. Specify a different type
debug(`run verify.yml on ${serverId}`);
let resultVerify;

Expand All @@ -212,7 +212,7 @@
* @param {String} serverId
* @param {Object} extraVars
*/
async function installAndVerifyZowe(testcase: string, installPlaybook: string, serverId: string, extraVars: {[key: string]: any} = {}): Promise<void> {

Check warning on line 215 in tests/installation/src/utils.ts

View workflow job for this annotation

GitHub Actions / cicd-test (extended/upgrades/install-base-then-upgrade.ts, marist-zzow10)

Unexpected any. Specify a different type
debug(`installAndVerifyZowe(${testcase}, ${installPlaybook}, ${serverId}, ${JSON.stringify(extraVars)})`);

debug(`run ${installPlaybook} on ${serverId}`);
Expand Down Expand Up @@ -248,7 +248,7 @@
}
}

async function installExtension(testcase: string, serverId: string, extraVars: {[key: string]: any} = {}): Promise<void> {

Check warning on line 251 in tests/installation/src/utils.ts

View workflow job for this annotation

GitHub Actions / cicd-test (extended/upgrades/install-base-then-upgrade.ts, marist-zzow10)

Unexpected any. Specify a different type
debug(`run install-ext.yml on ${serverId}`);
const resultInstall = await runAnsiblePlaybook(
testcase,
Expand Down Expand Up @@ -302,7 +302,7 @@

}

async function verifyExtension(testcase: string, serverId: string, extraVars: {[key: string]: any} = {}): Promise<PlaybookResponse> {

Check warning on line 305 in tests/installation/src/utils.ts

View workflow job for this annotation

GitHub Actions / cicd-test (extended/upgrades/install-base-then-upgrade.ts, marist-zzow10)

'verifyExtension' is defined but never used

Check warning on line 305 in tests/installation/src/utils.ts

View workflow job for this annotation

GitHub Actions / cicd-test (extended/upgrades/install-base-then-upgrade.ts, marist-zzow10)

Unexpected any. Specify a different type
debug(`run verify-ext.yml on ${serverId}`);
// FIXME: how to verify in v2?
let resultVerify;
Expand All @@ -329,7 +329,7 @@
* @param {String} serverId
* @param {Object} extraVars
*/
export async function installAndVerifyConvenienceBuild(testcase: string, serverId: string, extraVars: {[key: string]: any} = {}): Promise<void> {

Check warning on line 332 in tests/installation/src/utils.ts

View workflow job for this annotation

GitHub Actions / cicd-test (extended/upgrades/install-base-then-upgrade.ts, marist-zzow10)

Unexpected any. Specify a different type
await installAndVerifyZowe(testcase, 'install.yml', serverId, extraVars);
}

Expand Down Expand Up @@ -416,20 +416,25 @@
* @param {Object} extraFmidVars
* @param {Object} extraPtfVars
*/
export async function installAndVerifySmpePtf(testcase: string, serverId: string, extraPtfVars: {[key: string]: any} = {}): Promise<void> {
debug(`installAndVerifySmpePtf(${testcase}, ${serverId}, ${JSON.stringify(extraPtfVars)})`);
export async function installAndVerifySmpePtf(testcase: string, serverId: string, extraFmidVars: {[key: string]: any} = {}, extraPtfVars: {[key: string]: any} = {}): Promise<void> {
debug(`installAndVerifySmpePtf(${testcase}, ${serverId}, ${JSON.stringify(extraFmidVars)}, ${JSON.stringify(extraPtfVars)})`);

debug(`run install-fmid.yml on ${serverId}`);

const fmidVars = {
...{
'zowe_build_remote': ZOWE_FMID,
'skip_start': 'true',
...APIML_OIDC_VARS
},
...extraFmidVars,
}

const resultFmid = await runAnsiblePlaybook(
testcase,
'install-fmid.yml',
serverId,
{
'zowe_build_remote': ZOWE_FMID,
'skip_start': 'true',
...APIML_OIDC_VARS
}
fmidVars
);

expect(resultFmid.code).toBe(0);
Expand Down
Loading