# Pipeline Testing

The Test suite module helps the developers to create a unit test for every component on the pipeline. We can upload input data and expected output data for every test case this will be then compared with the actual output generated by the component.&#x20;

{% hint style="success" %}
_Check out the below-given walk through to understand the Pipeline Testing functionality._
{% endhint %}

{% embed url="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2Fw28zPOdlxpC0ogYab9q1%2F2024-02-29-12-32-54%20(online-video-cutter.com).mp4?alt=media&token=afa0aaf6-7c18-4491-9e3d-1a106fc21c09" %}

**The Test suite provides the following comparisons:**&#x20;

* Compare no. of rows generated with the given output.
* Compare no. of columns with the given output
* Compare actual data with the given output
* Schema validation with given schema.

## **Steps to Use Test Framework** <a href="#steps-to-use-test-framework" id="steps-to-use-test-framework"></a>

* Navigate to the _**Pipeline toolbar**_.
* Click on _**Pipeline Testing**_.

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2FBQcfELgHOI73GCPk2ti2%2Fimage.png?alt=media&#x26;token=c7cadc89-ac23-49b9-a372-4cf3ea812ad6" alt=""><figcaption><p><em><strong>Pipeline Testing</strong></em></p></figcaption></figure>

* The **Test Framework** page opens displaying details of the selected pipeline.

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2FUKcslENpj59SWvicZNTy%2Fimage.png?alt=media&#x26;token=21fc1374-8739-4945-aac5-422503b5c19d" alt=""><figcaption><p><em><strong>Test Framework Page</strong></em></p></figcaption></figure>

* **Search Component:** A Search bar is provided to search all components associated with that pipeline. It helps to find a specific component by inserting the name in the Search Bar.
* **Component Panel:** It displays all the components associated with that pipeline.
* **Create Test Case:** By clicking on the _**Create Test Case**_ ico&#x6E;**.**

## **Creating a Test Case**

* Click the _**Create Test Case**_ icon.
* The _**Test Case**_ opens. Here, the user can create a new test case for the selected component from the component panel.
  * **Test Name:** Enter the test case name.
  * **Test Description:** Enter the description of the test case.
  * **Input Data File:** Upload the input data file. It is required for transformations and writer’s components.
  * **Output Data File:** Upload the expected output data file.
  * **Schema File:** Upload the schema of expected output data.
  * **Input Data Type:** It supports the JSON type.
  * **Assertion Method:** It supports the equals assertion method.
  * **Sort:** It orders the column values in Actual Output. A User can sort the string and integer column values.
  *   **Comparison Logic:** It contains four type of comparison logic:

      * **Compare Number of Columns:** It compares input data columns with output data columns.
      * **Compare Data:** It compares input data with output data.
      * **Compare Number of Rows:** It compares input data rows with output data rows.
      * **Check Data Matches Schema:** It checks the uploaded schema with expected output data.​

      <figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2FpDsJie1eUAurhofa4oZE%2Fimage.png?alt=media&#x26;token=51ee699e-01a3-4092-bc0b-1e6c41300e51" alt=""><figcaption><p><em><strong>Creating a Test case</strong></em></p></figcaption></figure>

{% hint style="info" %}
<mark style="color:green;">Please Note:</mark>

* **Cross:** This icon will close the create test case pop-up.
* **Cancel:** This button will close the create test case pop-up.
* **Save:** This button will save the test case and the test case will list in the **Test Case** list.
{% endhint %}

## **Running Test Cases**

* **Run Test Cases:** It will run single and multiple test cases for the selected component by clicking on the **Run Test Cases** button.

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2F55hgSgzwFd7NziwZwDwZ%2Fimage.png?alt=media&#x26;token=70436169-43d8-460d-8417-775bc943f9dc" alt=""><figcaption><p><em><strong>Run test cases</strong></em></p></figcaption></figure>

### Test Cases

* **Test Cases:** It displays the created test cases list for the selected component.

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2F8ZH7DQuomq2o5Fu1R50c%2Fimage.png?alt=media&#x26;token=483abf15-0d21-4c7c-b4cc-7fc2f70558b7" alt=""><figcaption><p>Test cases list</p></figcaption></figure>

#### **Test Case List**

It displays the following the details:

* **Checkbox:** The User can select multiple or single test cases while running the test cases.
* **Test Name:** It displays name of the test case.
* **Test Case Description:** It displays description of the test case.
* **Created Date:** It displays the created date of the test case.
* **Delete Icon:** The User can remove the test case by clicking on the delete icon.

#### **Test Case Tab**

The user can update the test case details under this tab.

* **Test Case Name:** The User can change the test case name.
* **Test Description:** The User can change the description of the test case.
* **Output Schema File:** A User can change the schema of expected output data by clicking on the upload icon, view the schema by clicking on the view icon, remove the schema by clicking on cross icon.
* **Sort Column Name:** A User can change the sorting column name.
* **Update:** By clicking on the **Update** button user can update the test case details.
* **Last Updated Date:** It displays the last updated date of the test case.

#### Input Data Tab

The user can check the existing input data by clicking on this tab. It contains **Shrink, Expand, Upload, Remove** icon.

* **Shrink:** It Shrink the input data rows.
* **Expand:** It expand the input data rows.
* **Upload:** User can upload input data file by clicking on upload button.
* **Remove:** User can remove input data file by clicking on remove button.

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2F0SGKjbWHesfIup4SXwXz%2Fimage.png?alt=media&#x26;token=0c86cd1f-9318-4e97-8114-cae9fdddfc99" alt=""><figcaption><p><em><strong>Input Data tab</strong></em></p></figcaption></figure>

#### **Expected Output**

The user can check existing expected output data. It contains **Shrink, Expand, Upload, Remove** icon.

* **Shrink:** It Shrink the expected output data rows.
* **Expand:** It expand the expected output data rows.
* **Upload:** User can upload expected output data file by clicking on upload button.
* **Remove:** User can remove expected output data file by clicking on remove button.

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2FCNvw2CFXLaM6UPtpdemb%2Fimage.png?alt=media&#x26;token=259352cd-3443-4b2f-8832-330c1547736a" alt=""><figcaption><p><em><strong>Expected Output tab</strong></em></p></figcaption></figure>

#### **Report Tab**

It displays the selected latest and previous test case reports.

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2FqjpXms9krdmKockHz6sf%2Fimage.png?alt=media&#x26;token=5a4d5ffe-8f2c-457c-9aa7-c263dcdb1540" alt=""><figcaption><p><em><strong>Report tab</strong></em></p></figcaption></figure>

* [x] **Failed Status Report:** It displays the failed status of report. It contains the **info icon** button that displays the error of failure by clicking on info icon. After clicking on info icon Data Comparison pop-up will come.

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2FtTf75oiRzcIUrhAnB5oE%2Fimage.png?alt=media&#x26;token=48b729d4-c9f6-4be1-bf97-83cf0069ebdc" alt=""><figcaption><p><em><strong>Report Tab</strong></em></p></figcaption></figure>

* [x] **Failure Reason Tab:** It displays the error of failure.

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2FwlCdSnMKSWIARpFLGf0t%2Fimage.png?alt=media&#x26;token=d1b263a7-e2c5-4eea-985a-0af1a8f8d071" alt=""><figcaption><p><em><strong>Failure Reason tab</strong></em></p></figcaption></figure>

* [x] **Output Comparison:** It displays the Expected Output data and Actual Output data. Here user compare Expected Output data with Actual Output data.

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2FBnXqElWU3wMjTRru3EB6%2Fimage.png?alt=media&#x26;token=6d45f643-be9f-4e85-9192-82e1b7ae3356" alt=""><figcaption><p><em><strong>Output Comparison tab</strong></em></p></figcaption></figure>

### **Reports**

**Reports:** It displays the latest report of each test cases for selected component. It displays each Test case name, Component Version, Comparison Logics and Run dat&#x65;**.**

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2Flk8LOnPd8koWjydcrKoI%2Fimage.png?alt=media&#x26;token=d9b292dc-7871-4c79-9575-b3375a95b920" alt=""><figcaption><p><em><strong>Reports Tab</strong></em></p></figcaption></figure>

### **Logs**&#x20;

It displays the log details of the component.

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2Fw1XwmgsCDKzWP9BHUrIZ%2Fimage.png?alt=media&#x26;token=ef33a4e6-7001-4a43-8a5c-f9cdc3182222" alt=""><figcaption><p><em><strong>Logs Tab</strong></em></p></figcaption></figure>

### **Advance Logs**&#x20;

It displays the component pods, if user run test case.

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2FzMFiPkkeStRffb7czBjH%2Fimage.png?alt=media&#x26;token=6b7e7be6-51b4-459a-a3c6-8ff8941f60d6" alt=""><figcaption><p><em><strong>Advance Logs tab</strong></em></p></figcaption></figure>

