github.com/kyma-project/kyma-environment-broker@v0.0.1/testing/e2e/skr/skr-aws-upgrade-integration/index.js (about) 1 const { 2 gatherOptions, 3 oidcE2ETest, 4 withCustomParams, 5 } = require('../skr-test'); 6 const { 7 getEnvOrThrow, 8 switchDebug, 9 } = require('../utils'); 10 const {getOrProvisionSKR} = require('../skr-test/provision/provision-skr'); 11 const {deprovisionAndUnregisterSKR} = require('../skr-test/provision/deprovision-skr'); 12 const {upgradeSKRInstance} = require('./upgrade/upgrade-skr'); 13 14 const skipProvisioning = process.env.SKIP_PROVISIONING === 'true'; 15 const provisioningTimeout = 1000 * 60 * 60; // 1h 16 const deprovisioningTimeout = 1000 * 60 * 30; // 30m 17 const upgradeTimeoutMin = 30; // 30m 18 let globalTimeout = 1000 * 60 * 90; // 90m 19 const slowTime = 5000; 20 21 const kymaVersion = getEnvOrThrow('KYMA_VERSION'); 22 const kymaUpgradeVersion = getEnvOrThrow('KYMA_UPGRADE_VERSION'); 23 24 describe('SKR-Upgrade-test', function() { 25 switchDebug(true); 26 27 if (!skipProvisioning) { 28 globalTimeout += provisioningTimeout + deprovisioningTimeout; // 3h 29 } 30 this.timeout(globalTimeout); 31 this.slow(slowTime); 32 33 const customParams = { 34 'kymaVersion': kymaVersion, 35 }; 36 let options = gatherOptions( 37 withCustomParams(customParams), 38 ); 39 let skr; 40 const getShootInfoFunc = function() { 41 return skr.shoot; 42 }; 43 const getShootOptionsFunc = function() { 44 return options; 45 }; 46 47 before(`Provision SKR with ID ${options.instanceID} and version ${kymaVersion}`, async function() { 48 this.timeout(provisioningTimeout); 49 skr = await getOrProvisionSKR(options, skipProvisioning, provisioningTimeout); 50 console.log('SKR provisioned'); 51 options = skr.options; 52 }); 53 54 // Run the OIDC tests 55 oidcE2ETest(getShootOptionsFunc, getShootInfoFunc); 56 57 it('Perform Upgrade', async function() { 58 console.log('Performing upgrade'); 59 await upgradeSKRInstance(options, kymaUpgradeVersion, upgradeTimeoutMin); 60 }); 61 62 const skipCleanup = getEnvOrThrow('SKIP_CLEANUP'); 63 if (skipCleanup === 'FALSE') { 64 after('Cleanup the resources', async function() { 65 this.timeout(deprovisioningTimeout); 66 await deprovisionAndUnregisterSKR(options, deprovisioningTimeout, skipProvisioning, false); 67 }); 68 } 69 });