-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add SKR binding test #1184
Add SKR binding test #1184
Changes from 11 commits
c8bbbf4
558fef6
1d22146
e6e25b9
bdc962d
cc0e2fd
27886c4
9880e2d
0231eaa
0fea4dd
4de4840
dc761cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
const {gatherOptions} = require('../skr-test'); | ||
const {initializeK8sClient} = require('../utils/index.js'); | ||
const {getSecret} = require('../utils'); | ||
const {provisionSKRInstance} = require('../skr-test/provision/provision-skr'); | ||
const {deprovisionAndUnregisterSKR} = require('../skr-test/provision/deprovision-skr'); | ||
const {KEBClient, KEBConfig} = require('../kyma-environment-broker'); | ||
const keb = new KEBClient(KEBConfig.fromEnv()); | ||
|
||
const provisioningTimeout = 1000 * 60 * 30; // 30m | ||
const deprovisioningTimeout = 1000 * 60 * 95; // 95m | ||
let globalTimeout = 1000 * 60 * 70; // 70m | ||
const slowTime = 5000; | ||
const secretName = 'sap-btp-manager'; | ||
const ns = 'kyma-system'; | ||
|
||
describe('SKR Binding test', function() { | ||
globalTimeout += provisioningTimeout + deprovisioningTimeout; | ||
|
||
this.timeout(globalTimeout); | ||
this.slow(slowTime); | ||
|
||
const options = gatherOptions(); // with default values | ||
let skr; | ||
let kubeconfigFromBinding; | ||
|
||
before('Ensure SKR is provisioned', async function() { | ||
this.timeout(provisioningTimeout); | ||
await provisionSKRInstance(options, provisioningTimeout); | ||
}); | ||
|
||
it('Create SKR binding', async function() { | ||
try { | ||
kubeconfigFromBinding = await keb.createBinding(options.instanceID); | ||
} catch (err) { | ||
console.log(err); | ||
} | ||
}); | ||
|
||
it('Initiate K8s client with kubeconfig from binding', async function() { | ||
await initializeK8sClient({kubeconfig: kubeconfigFromBinding.credentials}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please add an assertion that where you cannot access cluster before initialization is done? I am afraid that it might swallow errors. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will change it to not provision and init in the first step. |
||
}); | ||
|
||
it('Fetch sap-btp-manager secret', async function() { | ||
await getSecret(secretName, ns); | ||
}); | ||
|
||
after('Cleanup the resources', async function() { | ||
this.timeout(deprovisioningTimeout); | ||
if (process.env['SKIP_DEPROVISIONING'] != 'true') { | ||
await deprovisionAndUnregisterSKR(options, deprovisioningTimeout, true); | ||
} | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder whether it should be
service binding
here and in line 135? If justbinding
is sufficient, please ignore this comment.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will leave it as it is. It's documentation for the tests, so I think that's sufficient.