Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

CN2 Pipelines Test Management

SUMMARY This section covers the tasks that are specific to managing the test cases.

Trigger the CN2 Pipelines Test

Any valid commit automatically triggers the CN2 Pipelines test. For the commit to be valid, you need to do the following:

  1. Apply the commit to the correct branch mentioned in the values.yaml.
  2. Verify that Argo CD is in sync state. You can verify by logging into the Argo GUI and checking the application status. See Argo Log In.
  3. Verify the commit will cross the threshold trigger.
    You can verify the threshold trigger setting in the configuration map named cn2-pipeline-configs.

Support for Queuing Test Execution

CN2 Pipelines creates a test workflow execution queue when a commit threshold is reached, while previously triggered test workflows are in Running phase. As soon as a workflow is completed, the next test workflow execution is triggered. CN2 Pipelines has a push mechanism from a test workflow to detect the test completion.

  1. Any successful commit (which gets successfully deployed by ArgoCD) triggers the CN2 test workflow.

  2. The commit should cross the threshold set in the ConfigMap cn2pipeline-configs parameter testcase_trigger_threshold.

  3. If the commit fails to apply configuration using Argo CD, that commitID will not get registered to ConfigMap.

  4. The ConfigMap has data about the commitID with timestamp, test to run based on kind, and status of the test.

Change Commit Threshold Trigger

Use this procedure to change the commit threshold trigger.

  1. To access the ConfigMap named cn2-pipeline-configs, run this command:

    Output:

  2. Change the testcase_trigger_threshold value for the number of commits you want to ignore. By default, this is set to 0.

Change Test Profiles

Use this procedure to change test profiles. This mapping configuration contains the workflow template to CN2 resource kind mapping. Only one template is selected for execution and the first map that matches has the higher priority. An asterisk (*) in kind: ['*'] has higher priority than any other kind matches and overrides every mapping.

  1. To access the configuration map named cn2tmpl-to-kind-map, run this command:

    Output:

    CN2 Pipelines will trigger the test where the kind:['*'] value exists. By default, the profile it-cloud is triggered.

  2. To trigger another profile, change profile kind to kind:['*'].
    Note:

    Only one workflow can have an asterisk (*) as the kind: value.

Identify CN2 Pipelines Test Trigger

After installing CN2 Pipelines, every valid commit in a given branch and folder will trigger the CN2 test. There is a commit processing workflow triggered after every commit that starts from the resource asterisk (*), for example where the kind:['*'] value exists. This processes the commit and validates the commit against the threshold value and Argo CD synchronize.

  • The commit processing workflow looks like this:

  • The actual test workflow starts from CN2 and looks like this:

Access Test Results

You can access the test results in HTML format from the GUI.

  • To access test results, enter the following in your browser:

Uninstall the CN2 Pipelines

Use this procedure to uninstall and delete the CN2 Pipelines.

  • To uninstall CN2 Pipelines, run this command:

Output: