Commit 94ea13e6 authored by Nikos Psaromanolakis's avatar Nikos Psaromanolakis
Browse files

update master orchestrator, create orchestratros folders, update features... Relate to #8

parent fd35838d
Loading
Loading
Loading
Loading
+8
Changes for src/test/resources/hypo/afterScenario.js: 8 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -2,9 +2,17 @@ function() {
    karate.log('>>>> EXECUTION OF TESTS FINISHED <<<<');
    karate.log('>>>>>>>> STARTING TO EXECUTE CLEAN UP <<<<<<<<');

    var skipCleanup = karate.get('skipCleanup', false);
    if (skipCleanup) {
        karate.log('afterScenario: skipCleanup=true, skipping cleanup (handled by master orchestrator)');
        return;
    }

    var initCleanupId = karate.get('orgId');
    var infra = karate.get('infra');
    
    

    var cleanupId = initCleanupId ? initCleanupId : (infra == 'ubi' ? '2582308c-9f26-497e-9547-ec88d60ef9ff' : '2bc5e74c-4760-425b-911f-eca7df5ce3f0');
    var token = karate.get('auth_token');

+5 −1
Changes for src/test/resources/hypo/cleanUp.feature: 5 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -3,9 +3,11 @@ Feature: Full clean up of test resources
# Standalone, reusable clean up

Background:

  * def auth       = call read('classpath:hypo/auth.feature')
  * def token      = auth.accessToken
  * def auth_token = auth.accessToken
  
  * def deleteEach =
    """
    function(list, callTag, idParam) {
@@ -27,7 +29,9 @@ Background:
    """

@clean-up-workflow
Scenario: Wokflow that terminates services and deletes services, orders, network, organization, peering, candidates, specifications and registry secrets
Scenario: Workflow that terminates services and deletes services, orders, network, organization, peering, candidates, specifications and registry secrets
  * karate.log('###### GENERIC CLEAN-UP-WORKFLOW STARTING ######')

  * def orgs = call read('classpath:hypo/organization.feature@getOrganizations') { auth_token: '#(auth_token)' }
  * def controllers = call read('classpath:hypo/fabric.feature@getControllers') { auth_token: '#(auth_token)' }
  * def peering = call read('classpath:hypo/peering.feature@getPeerings') { auth_token: '#(auth_token)' }
+1 −2
Changes for src/test/resources/hypo/fabric.feature: 1 added line, 2 removed lines.
Original line number Diff line number Diff line
@@ -53,8 +53,7 @@ Scenario: Poll Service Status and Delete on Failure
      karate.log('Polling Fabric attempt: ' + count)
      // Wait 3 seconds between tries (Postman interval)
      java.lang.Thread.sleep(3000); 
      
      var result = karate.call('fabric.feature@getFabricStatus', { token: token, networkControllerId: networkControllerId });
      var result = karate.call('classpath:hypo/fabric.feature@getFabricStatus', { token: token, networkControllerId: networkControllerId });
      var res = result.response;
      var status = result.responseStatus;

+19
Changes for src/test/resources/hypo/orchestrators/orchestrator-setup.feature: 19 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -41,4 +41,23 @@ Scenario: Setup - registry, org, peering, specs
  # # 9) Poll peering
  # * call read('classpath:hypo/peering.feature@pollPeering') { auth_token: '#(auth_token)', peeringId: '#(orgId)', orgId: '#(orgId)' }

  # 7) Create Fabric controller

  * def fabricRes = call read('classpath:hypo/fabric.feature@createFabric') { auth_token: '#(auth_token)' }
  * def networkControllerId = fabricRes.networkControllerId
  
  # 8) Get Fabric controller
  
  * call read('classpath:hypo/fabric.feature@pollFabric') {auth_token: '#(auth_token)', networkControllerId: '#(networkControllerId)' }

  # 8a) Edit Domain Identity Resource
  * def identityId = infra == 'ubi' ? 'r06URWklNn' : 'FKfuWDxTQ'

  * call read('classpath:hypo/fabric.feature@updateDomainIdentityResource') {auth_token: '#(auth_token)', networkControllerId: '#(networkControllerId)', identityId: '#(identityId)'} 

  # 8b) Get Domain Identity Resource
  * call read('classpath:hypo/fabric.feature@getDomainIdentityResource') {auth_token: '#(auth_token)', networkControllerId: '#(networkControllerId)', identityId: '#(identityId)'} 



+58 −4
Changes for src/test/resources/hypo/orchestrators/orchestratorMasterNightly.feature: 58 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -9,25 +9,79 @@ Feature: Master Orchestrator - Run all tests sequentially - Nightly Tests
    
     # Test 1
    * karate.log('#################### 1) Running Portal Orchestrator... ####################')
    * call read('classpath:hypo/orchestratorPortal.feature')
    * call read('classpath:hypo/orchestrators/orchestratorPortal.feature')
    * karate.log('------ Tests for the Portal PASSED ------')

    # Test 2
    * karate.log('#################### 2) Running Private Orchestrator... ####################')
    * call read('classpath:hypo/orchestratorPrivate.feature')
    * call read('classpath:hypo/orchestrators/orchestratorPrivate.feature') {skipCleanup: true }
    * karate.log('------ Tests with a private cluster PASSED ------')
    
    # Test 3
    * karate.log('#################### 3) Running Public Orchestrator... ####################')
    * call read('classpath:hypo/orchestratorPublic.feature')
    * call read('classpath:hypo/orchestrators/orchestratorPublic.feature') {skipCleanup: true, skipInitSteps: true }
    * karate.log('------ Tests with a public PASSED ------')
    
    # Test 4
    * karate.log('#################### 4) Running OCM Orchestrator... ####################')
    * call read('classpath:hypo/orchestratorOCM.feature')
    * call read('classpath:hypo/orchestrators/orchestratorOCM.feature') {skipCleanup: true, skipInitSteps: true }
    * karate.log('------ Tests with a OCM PASSED ------')
    

    * karate.log('========================================')
    * karate.log('------ ALL TESTS PASSED ------')
    * karate.log('========================================')



@nightly-workflow-with-clean-up
Scenario: Execute all orchestrators one by one

  * def runSequence =
  """
  function() {
    karate.log('========================================');
    karate.log('STARTING MASTER-NIGHTLY ORCHESTRATOR');
    karate.log('========================================');

    karate.log('#################### 1) Running Portal Orchestrator... ####################');
    karate.call('classpath:hypo/orchestrators/orchestratorPortal.feature', { skipCleanup: true });
    karate.log('------ Tests for the Portal PASSED ------');

    karate.log('#################### 2) Running Private Orchestrator... ####################');
    karate.call('classpath:hypo/orchestrators/orchestratorPrivate.feature', { skipCleanup: true });
    karate.log('------ Tests with a private cluster PASSED ------');

    karate.log('#################### 3) Running Public Orchestrator... ####################');
    karate.call('classpath:hypo/orchestrators/orchestratorPublic.feature', { skipCleanup: true, skipInitSteps: true });
    karate.log('------ Tests with a public PASSED ------');

    karate.log('#################### 4) Running OCM Orchestrator... ####################');
    karate.call('classpath:hypo/orchestrators/orchestratorOCM.feature', { skipCleanup: true, skipInitSteps: true });
    karate.log('------ Tests with a OCM PASSED ------');

    karate.log('========================================');
    karate.log('------ ALL TESTS PASSED ------');
    karate.log('========================================');
  }
  """

  * def cleanupAndMaybeRethrow =
  """
  function() {
    var caughtError = null;
    try {
      runSequence();
    } catch (e) {
      caughtError = e;
      karate.log('*** ONE OR MORE ORCHESTRATORS FAILED - running master cleanup ***');
    } finally {
      karate.log('>>>>>>>> STARTING TO EXECUTE MASTER CLEAN UP <<<<<<<<');
      karate.call('classpath:hypo/cleanUp.feature@clean-up-workflow');
    }
    if (caughtError) {
      throw caughtError;
    }
  }
  """
  * eval cleanupAndMaybeRethrow()
 No newline at end of file
Loading