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:
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.
-
Any successful commit (which gets successfully deployed by ArgoCD) triggers the CN2 test workflow.
-
The commit should cross the threshold set in the ConfigMap
cn2pipeline-configs
parametertestcase_trigger_threshold
. -
If the commit fails to apply configuration using Argo CD, that commitID will not get registered to ConfigMap.
-
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.
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.
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:
resource-workflow-5547v-3345460271 0/2 Completed 0 11h
-
The actual test workflow starts from CN2 and looks like this:
cn2-test-workflow-zfhtf-4049010958 0/2 Completed 0 13h
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:
https://<management_api_ip>:30552
Uninstall the CN2 Pipelines
Use this procedure to uninstall and delete the CN2 Pipelines.
-
To uninstall CN2 Pipelines, run this command:
helm uninstall cn2-pipeline
Output:
kubectl patch -n argo-events eventsource/gitlab -p '{"metadata":{"finalizers":[]}}' --type=merge kubectl patch -n argo-events sensor/gitlab -p '{"metadata":{"finalizers":[]}}' --type=merge kubectl patch -n argo-events eventbus/default -p '{"metadata":{"finalizers":[]}}' --type=merge kubectl patch -n argocd applications.argoproj.io/cn2networkconfig -p '{"metadata":{"finalizers":[]}}' --type=merge