@@ -52,13 +52,13 @@ describe('Test Fleet deployment on PUBLIC repos', { tags: '@p0' }, () => {
5252} ) ;
5353
5454describe ( 'Test Fleet deployment on PRIVATE repos with HTTP auth' , { tags : '@p0' } , ( ) => {
55-
55+ //TODO: Commented Azure tests due to token expired, once restored uncomment it.
5656 const gitAuthType = "http"
5757 const repoTestData : testData [ ] = [
5858 { qase_id : 6 , provider : 'GitLab' , repoUrl : 'https://gitlab.com/fleetqa/fleet-qa-examples.git' } ,
5959 { qase_id : 7 , provider : 'Gh' , repoUrl : 'https://github.com/fleetqa/fleet-qa-examples.git' } ,
6060 { qase_id : 8 , provider : 'Bitbucket' , repoUrl : 'https://bitbucket.org/fleetqa-bb/fleet-qa-examples.git' } ,
61- { qase_id : 98 , provider : 'Azure' , repoUrl : 'https://dev.azure.com/fleetqateam/fleet-qa-examples/_git/fleet-qa-examples' }
61+ // {qase_id: 98, provider: 'Azure', repoUrl: 'https://dev.azure.com/fleetqateam/fleet-qa-examples/_git/fleet-qa-examples'}
6262 ]
6363
6464 repoTestData . forEach ( ( { qase_id, provider, repoUrl } ) => {
@@ -81,15 +81,15 @@ describe('Test Fleet deployment on PRIVATE repos with HTTP auth', { tags: '@p0'
8181} ) ;
8282
8383describe ( 'Test Fleet deployment on PRIVATE repos with SSH auth' , { tags : '@p0' } , ( ) => {
84-
84+ //TODO: Commented Azure tests due to token expired, once restored uncomment it.
8585 const gitAuthType = "ssh"
8686 const userOrPublicKey = Cypress . env ( "rsa_public_key_qa" )
8787 const pwdOrPrivateKey = Cypress . env ( "rsa_private_key_qa" )
8888 const repoTestData : testData [ ] = [
8989 { qase_id :
2 , provider :
'GitLab' , repoUrl :
'[email protected] :fleetqa/fleet-qa-examples.git' } , 9090 { qase_id :
3 , provider :
'Bitbucket' , repoUrl :
'[email protected] :fleetqa-bb/fleet-qa-examples.git' } , 9191 { qase_id :
4 , provider :
'Github' , repoUrl :
'[email protected] :fleetqa/fleet-qa-examples.git' } , 92- { qase_id :
97 , provider :
'Azure' , repoUrl :
'[email protected] :v3/fleetqateam/fleet-qa-examples/fleet-qa-examples' } 92+ // {qase_id: 97, provider: 'Azure', repoUrl: 'git@ssh.dev.azure.com:v3/fleetqateam/fleet-qa-examples/fleet-qa-examples' }
9393 ]
9494
9595 repoTestData . forEach ( ( { qase_id, provider, repoUrl } ) => {
@@ -218,6 +218,73 @@ describe('Test gitrepos with cabundle', { tags: '@p0' }, () => {
218218
219219} ) ;
220220
221+ if ( ! / \/ 2 \. 7 / . test ( Cypress . env ( 'rancher_version' ) ) && ! / \/ 2 \. 8 / . test ( Cypress . env ( 'rancher_version' ) ) ) {
222+ describe ( 'Test Fleet with Webhook' , { tags : '@p0' } , ( ) => {
223+ qase ( 152 ,
224+ it ( 'Fleet-152: Test Fleet with Webhook and disable polling ' , { tags : '@fleet-152' } , ( ) => {
225+
226+ const repoName = 'webhook-test-disable-polling' ;
227+ const gh_private_pwd = Cypress . env ( 'gh_private_pwd' ) ;
228+
229+ // Prepare webhook in Github
230+ cy . exec ( 'bash assets/webhook-tests/webhook_setup.sh' , { env : { gh_private_pwd } } ) . then ( ( result ) => {
231+ cy . log ( result . stdout , result . stderr ) ;
232+ } )
233+
234+ // Open local terminal in Rancher UI
235+ cy . accesMenuSelection ( 'local' ) ;
236+ cy . get ( '#btn-kubectl' ) . click ( ) ;
237+ cy . contains ( 'Connected' ) . should ( 'be.visible' ) ;
238+
239+ // Add yaml file to the terminal to create ad-hoc ingress
240+ cy . get ( 'button > i.icon.icon-upload.icon-lg' ) . click ( ) ;
241+ cy . addYamlFile ( 'assets/webhook-tests/webhook_ingress.yaml' ) ;
242+ cy . clickButton ( 'Import' ) ;
243+ cy . clickButton ( 'Close' ) ;
244+
245+ cy . typeIntoCanvasTermnal ( '\
246+ kubectl create secret generic gitjob-webhook -n cattle-fleet-system --from-literal=github=webhooksecretvalue{enter}' ) ;
247+
248+ // Ensure webhook repo starts with 2 replicas
249+ cy . exec ( 'bash assets/webhook-tests/webhook_test_2_replicas.sh' , { env : { gh_private_pwd } } ) . then ( ( result ) => {
250+ cy . log ( result . stdout , result . stderr ) ;
251+ } ) ;
252+
253+ // Gitrepo creation via YAML
254+ cy . accesMenuSelection ( 'Continuous Delivery' , 'Git Repos' ) ;
255+ cy . fleetNamespaceToggle ( 'fleet-local' ) ;
256+ cy . clickButton ( 'Add Repository' ) ;
257+ cy . clickButton ( 'Edit as YAML' ) ;
258+ cy . addYamlFile ( 'assets/webhook-tests/webhook_test_disable_polling.yaml' ) ;
259+ cy . clickButton ( 'Create' ) ;
260+ cy . verifyTableRow ( 0 , 'Active' , '1/1' ) ;
261+ cy . checkGitRepoStatus ( repoName , '1 / 1' , '1 / 1' ) ;
262+ cy . verifyJobDeleted ( repoName , false ) ;
263+
264+ // Verify deployments has 2 replicas only
265+ cy . accesMenuSelection ( 'local' , 'Workloads' , 'Deployments' ) ;
266+ cy . filterInSearchBox ( repoName ) ;
267+ cy . wait ( 500 ) ;
268+ cy . contains ( 'tr.main-row' , repoName , { timeout : 20000 } ) . should ( 'be.visible' ) ;
269+ cy . verifyTableRow ( 0 , 'Active' , '2/2' ) ;
270+
271+ // Give extra time for job to finsih.
272+ // TODO: remove this wait once https://github.com/rancher/fleet/issues/3067 is fixed
273+ // or find a way to wait for the job to finish
274+ cy . wait ( 10000 ) ;
275+
276+ // Change replicas to 5
277+ cy . exec ( 'bash assets/webhook-tests/webhook_test_5_replicas.sh' ) . then ( ( result ) => {
278+ cy . log ( result . stdout , result . stderr ) ;
279+ } ) ;
280+
281+ // Verify deployments has 5 replicas
282+ cy . verifyTableRow ( 0 , 'Active' , '5/5' ) ;
283+ } )
284+ ) ;
285+ } )
286+ } ;
287+
221288if ( ! / \/ 2 \. 7 / . test ( Cypress . env ( 'rancher_version' ) ) && ! / \/ 2 \. 8 / . test ( Cypress . env ( 'rancher_version' ) ) ) {
222289 // New tests for jobs cleanup
223290 describe ( 'Test Fleet job cleanup' , { tags : '@p0' } , ( ) => {
@@ -327,73 +394,6 @@ if (!/\/2\.7/.test(Cypress.env('rancher_version')) && !/\/2\.8/.test(Cypress.env
327394 ) } ) ;
328395} ;
329396
330- if ( ! / \/ 2 \. 7 / . test ( Cypress . env ( 'rancher_version' ) ) && ! / \/ 2 \. 8 / . test ( Cypress . env ( 'rancher_version' ) ) ) {
331- describe ( 'Test Fleet with Webhook' , { tags : '@p0' } , ( ) => {
332- qase ( 152 ,
333- it ( 'Fleet-152: Test Fleet with Webhook and disable polling ' , { tags : '@fleet-152' } , ( ) => {
334-
335- const repoName = 'webhook-test-disable-polling' ;
336- const gh_private_pwd = Cypress . env ( 'gh_private_pwd' ) ;
337-
338- // Prepare webhook in Github
339- cy . exec ( 'bash assets/webhook-tests/webhook_setup.sh' , { env : { gh_private_pwd } } ) . then ( ( result ) => {
340- cy . log ( result . stdout , result . stderr ) ;
341- } )
342-
343- // Open local terminal in Rancher UI
344- cy . accesMenuSelection ( 'local' ) ;
345- cy . get ( '#btn-kubectl' ) . click ( ) ;
346- cy . contains ( 'Connected' ) . should ( 'be.visible' ) ;
347-
348- // Add yaml file to the terminal to create ad-hoc ingress
349- cy . get ( 'button > i.icon.icon-upload.icon-lg' ) . click ( ) ;
350- cy . addYamlFile ( 'assets/webhook-tests/webhook_ingress.yaml' ) ;
351- cy . clickButton ( 'Import' ) ;
352- cy . clickButton ( 'Close' ) ;
353-
354- cy . typeIntoCanvasTermnal ( '\
355- kubectl create secret generic gitjob-webhook -n cattle-fleet-system --from-literal=github=webhooksecretvalue{enter}' ) ;
356-
357- // Ensure webhook repo starts with 2 replicas
358- cy . exec ( 'bash assets/webhook-tests/webhook_test_2_replicas.sh' , { env : { gh_private_pwd } } ) . then ( ( result ) => {
359- cy . log ( result . stdout , result . stderr ) ;
360- } ) ;
361-
362- // Gitrepo creation via YAML
363- cy . accesMenuSelection ( 'Continuous Delivery' , 'Git Repos' ) ;
364- cy . fleetNamespaceToggle ( 'fleet-local' ) ;
365- cy . clickButton ( 'Add Repository' ) ;
366- cy . clickButton ( 'Edit as YAML' ) ;
367- cy . addYamlFile ( 'assets/webhook-tests/webhook_test_disable_polling.yaml' ) ;
368- cy . clickButton ( 'Create' ) ;
369- cy . verifyTableRow ( 0 , 'Active' , '1/1' ) ;
370- cy . checkGitRepoStatus ( repoName , '1 / 1' , '1 / 1' ) ;
371- cy . verifyJobDeleted ( repoName , false ) ;
372-
373- // Verify deployments has 2 replicas only
374- cy . accesMenuSelection ( 'local' , 'Workloads' , 'Deployments' ) ;
375- cy . filterInSearchBox ( repoName ) ;
376- cy . wait ( 500 ) ;
377- cy . contains ( 'tr.main-row' , repoName , { timeout : 20000 } ) . should ( 'be.visible' ) ;
378- cy . verifyTableRow ( 0 , 'Active' , '2/2' ) ;
379-
380- // Give extra time for job to finsih.
381- // TODO: remove this wait once https://github.com/rancher/fleet/issues/3067 is fixed
382- // or find a way to wait for the job to finish
383- cy . wait ( 10000 ) ;
384-
385- // Change replicas to 5
386- cy . exec ( 'bash assets/webhook-tests/webhook_test_5_replicas.sh' ) . then ( ( result ) => {
387- cy . log ( result . stdout , result . stderr ) ;
388- } ) ;
389-
390- // Verify deployments has 5 replicas
391- cy . verifyTableRow ( 0 , 'Active' , '5/5' ) ;
392- } )
393- ) ;
394- } )
395- } ;
396-
397397if ( ! / \/ 2 \. 8 / . test ( Cypress . env ( 'rancher_version' ) ) && ! / \/ 2 \. 9 / . test ( Cypress . env ( 'rancher_version' ) ) ) {
398398 describe ( 'Test GitJob security context' , { tags : '@p0' } , ( ) => {
399399 qase ( 160 ,
0 commit comments