Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated docs as per new UI features #276

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 30 additions & 38 deletions src/pages/docs/continuous-integration/azure-devops.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,47 +22,40 @@ contextual_links:
Microsoft Azure, aka Azure, is a cloud computing service created by Microsoft for building, testing, deploying, and managing applications and services through Microsoft-managed data centers.

---
##**Prerequisites:**
1. **API key for Azure:** To generate this, follow the below steps:
1. Log in to your account on Testsigma
2. Navigate to[Settings > API keys](https://testsigma.com/docs/configuration/api-keys/)
3. Click on the ‘Create’ button to generate a new API key.
2. [Test Plan ID:](https://testsigma.com/docs/continuous-integration/get-test-plan-details/) To get this, follow the steps below:
1. Click on the Test Plan name that you want to integrate
2. On the Test Plan details page that opens, click on the CI-CD integration tab.
3. You will find the execution ID for the Test Plan within the ‘REST API call to start Test Plan’ body content as shown in the screenshot below:
![get test plan id](https://docs.testsigma.com/images/azure-devops/get-test-plan-id.png)

---
##**How to integrate with Azure DevOps**
**Step 1: Create/Select a Pipeline**
Once you are logged in to the Azure DevOps account and created a Project, you can click on the Pipeline section and the below image will be displayed. If you want to create a **new pipeline**, we need to click on the New Pipeline Button to get started.
## **Prerequisites:**
- API key for Azure. For more information, refer to [API keys](https://testsigma.com/docs/configuration/api-keys/).

2. A Test Plan ID. For more information, refer to [get test plan id](https://docs.testsigma.com/images/azure-devops/get-test-plan-id.png).

---
## **How to integrate with Azure DevOps**
1. Login to the Azure DevOps account and create a **Project**. Navigate to Pipelines and click on the **New Pipeline** to get started.
![create new pipeline azure devops](https://docs.testsigma.com/images/azure-devops/create-new-pipeline-azure-devops.png)
**Step 2: Select the Version Control System(VCS)**
After clicking on the New Pipeline button, the below page will be displayed where you need to integrate with the version control system(VCS) such as Git Hub, Bitbucket, etc. where your application code is stored.

2. Choose the **Version Control System** (VCS) where your application code is stored.
![select version control system in Azure Devops](https://docs.testsigma.com/images/azure-devops/select-version-control-system-azure-devops.png)


[[info | NOTE:]]
| In order to integrate with Azure, you need to have a YAML file in your Code repository. This file contains the details for the CI/CD Integration with Azure DevOps. If not available yet, Azure has an option in which it will create a sample YAML file in your repository once access is given.

**Step 3: Select the Repository**
Once you have selected the VCS, it will take you to a page where it will ask you to choose the repository where your Configuration YAML file is present.

3. Choose the repository where your Configuration YAML file is present. Once you select your repository it will take you to the configuration page where you can configure your pipeline.
![select repository in Azure DevOps](https://docs.testsigma.com/images/azure-devops/select-repository-azure-devops.png)

Once you select your repository it will take you to the configuration page where you can configure your pipeline.

**Step 4: Select Configuration**
If you already have your YAML file in your repo, you can select the option **Existing Azure Pipeline YAML file**. Otherwise, you can select **Starter Pipeline** to create a sample YAML file in the selected repository.

4. On **Configure your pipeline** page, if you already have your YAML file in your repo, you can select the option **Existing Azure Pipeline YAML file**. Otherwise, you can select **Starter Pipeline** to create a sample YAML file in the selected repository.
![configure your pipeline page in Azure DevOps](https://docs.testsigma.com/images/azure-devops/configure-your-pipeline-azure-devops.png)
In this case, we already had an existing YAML file in the repo. So, once you select the fourth option in the above image, it will take you to a place where you need to enter the branch and path of the YAML file in your repository,


In this case, we already had an existing YAML file in the repo. So, once you select the fourth option in the above image, it will take you to a place where you need to enter the branch and path of the YAML file in your repository.
![Select existing pipeline while configuring an existing YAML file in Azure DevOps](https://docs.testsigma.com/images/azure-devops/configure-pipeline-select-yaml-file-azure-devops.png)
**Step 5: Review the CI Configuration**
After selecting the Branch and path you can click on "continue" and you will need to review your YAML code.


5. Review the CI Configuration after selecting the Branch and Path, click on **Continue**.
![Review CI configuration in Azure DevOps](https://docs.testsigma.com/images/azure-devops/review-ci-configuration-azure-devops.png)

The YAML file contains the following code where you need to enter the filePath of the [Generic Shell Script](https://testsigma.com/docs/continuous-integration/shell-script/) (cicd-api.sh) to run it. This Shell script is the one that actually triggers the Test Plan execution and gives you the result of Test plan once it's complete.

```yaml
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
Expand All @@ -89,26 +82,25 @@ testResultsFiles: '**/junit-report.xml' //Result File Type


In order to Trigger a particular test plan, you just need to add your own Test plan Execution id and the API key in the Shell Script (cicd-api.sh). As shown below:

![shell script for Azure DevOps](https://docs.testsigma.com/images/azure-devops/shell-script-azure-devops.png)

Please check the below article to get insight on the configuration of Generic Shell Script:
[Generic Shell Script for Integrating with any CI/CD Tool](https://testsigma.com/docs/continuous-integration/shell-script/)

**Step 6: Test the Configuration**
Once the Script is set up and Reviewed for the pipeline, you can click on the **Run** button to start your Job.
For more information on configuration of Generic Shell Script, refer to https://testsigma.com/docs/continuous-integration/shell-script/.

6. Test the configuration once the script is set up and reviewed for the pipeline, and click on the **Run** to start your Job.
![test configuration in Azure DevOps](https://docs.testsigma.com/images/azure-devops/test-configuration-azure-devops.png)

Once the Run is initiated, you will see this page:
![set up ci with Azure Pipelines](https://docs.testsigma.com/images/azure-devops/setup-ci-with-azure-pipelines.png)
Once the job has been completed, the Job status will be "Success" as shown in the image below:

Once the job has been completed, the Job status will be **Success** as shown in the image below:
![Job Status Success in Azure DevOps](https://docs.testsigma.com/images/azure-devops/job-status-success-azure-devops.png)
**Step 7: Checking the Test Run Results**
That was all about Running the Job, now we would learn how can we see the result reports in Azure. Once the job is completed we can see the JUnit report in the **Test Plans > Runs** as shown below:

7. Once the job is completed we can see the reports in the **Test Plans > Runs**.
![Test Plans Runs in Pipelines in Azure DevOps](https://docs.testsigma.com/images/azure-devops/pipelines-testplans-runs-azure-devops.png)
After clicking on Runs you can select the Test plan for which you want to view the report and then you will be navigated to the page below, and also you can download the JUnit report in XML format.

After clicking on **Runs** you can select the Test plan for which you want to view the report and then you will be navigated to the page below, and also you can download the JUnit report in XML format.
![Junit report in Azure DevOps](https://docs.testsigma.com/images/azure-devops/junit-report-azure-devops.png)
You can use another shell script to convert the JUnit XML format result into an HTML format. A tool like [Allure](https://docs.qameta.io/allure/#_reporting) can help you with this.

You can use another shell script to convert the JUnit XML format result into an HTML format.


67 changes: 36 additions & 31 deletions src/pages/docs/continuous-integration/circle-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,57 +9,62 @@ contextual_links:
- type: section
name: "Contents"
- type: link
name: "Prerequisites:"
url: "#pre-requisite"
name: "Prerequisites"
url: "#prerequisites"
- type: link
name: "Steps to follow"
url: "#steps-to-follow"
- type: link
name: "Obtain API and Test Plan ID from Testsigma App"
url: "#obtain-api-and-test-plan-id-from-testsigma-app"
- type: link
name: "Add the Shell Script to Code Repository"
url: "#add-the-shell-script-to-code-repository"
- type: link
name: "Configure the CircleCI Pipeline"
url: "#configure-the-circleci-pipeline"
---

---

Testsigma offers webhooks for triggering Testsigma Executions remotely from any third-party tool that provides a Command Line Interface (CLI). In this guide, we will see how we can integrate Testsigma in CircleCI for automatically triggering Test Executions after some code is changed on your code repository. We will also configure it to wait for the tests to complete execution and then check if they passed, before proceeding to deployment.
Testsigma offers webhooks for triggering Testsigma Executions remotely from any third-party tool that provides a Command Line Interface (CLI). This article will help you to integrate Testsigma with CircleCI for automatically triggering Test Executions after some code is changed on your code repository.

---
##**Pre-requisite:**
## **Prerequisites**

>Before we begin, you will need:
>- A CircleCI Account with connected Source Code Management (SCM) tool (Github, Azure, etc.)
> - A CI/CD pipeline set up in CircleCI. Please check with your DevOps team if you need help with this.
- A CircleCI Account with connected Source Code Management (SCM) tool (Github, Azure, etc.)
- A CI/CD pipeline set up in CircleCI.

---
##**Steps to follow:**
We will complete the integration in 3 parts:
* Obtain API and Test Plan ID from Testsigma App
* Add the Shell Script to Code Repository
* Configure the CircleCI Pipeline


Let’s begin.
## **Steps to follow:**
We will complete the integration in 3 parts:
- Obtain API and Test Plan ID from Testsigma App
- Add the Shell Script to Code Repository
- Configure the CircleCI Pipeline

---

### Part1: Obtain API and Test Plan ID from Testsigma App
1. If you have not created a Testsigma API key already, please create one by navigating to Settings > API Keys and clicking on Create button on the top right corner.
## **Obtain API and Test Plan ID from Testsigma App**
1. Create API Key by navigating to **Settings > API Keys**.
![API Key](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/APIKeyGen.png)
We will use this API Key to authenticate our remote Test Plan trigger requests from CircleCI.

![API key details in Testsigma](https://docs.testsigma.com/images/circle-ci/api-key-details-testsigma.png)
We will use this API Key to authenticate our remote Test Plan trigger requests from CircleCI (explained in next article section - Set up Code Repository)
2. Create a Test Plan in Testsigma that you will execute as part of the CircleCI Pipeline. Obtain the **Test Plan ID** for the Test Plan from the **CI/CD Integrations** tab within **Test Plan details** as shown below:
![Test Plan ID](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/TPAPIcall.png)
We will add Testsigma API Key and the Test Plan ID to a Shell script, and the shell script file to your Code Repository.

2. Create a Test Plan in Testsigma that you will execute as part of the CircleCI Pipeline. Obtain the Test Plan ID for the Test Plan from the CI/CD Integrations tab within Test Plan details as shown below:
![get test plan id from a test plan in Testsigma](https://docs.testsigma.com/images/circle-ci/get-test-plan-id-test-plan-testsigma.png)
We will use this Test Plan ID to specify which Test Plan to trigger from CircleCI (explained in next article section - **Set up Code Repository**)
]
So, we have noted down the Testsigma API Key and the Test Plan ID now. We will add those to a Shell script, and the shell script file to your Code Repository, in the next section.
---

### Part 2: Add the Shell Script to Code Repository
You need to add a script file in your Code Repository stored on Github, Bitbucket, Azure, or any such platform.
This script file contains commands to trigger the Testsigma Test Plan remotely.
1. Copy the shell script from the article: [Generic Shell Script for Integrating with CI/CD Tools](https://testsigma.com/docs/continuous-integration/shell-script/) and customize the script file as mentioned in the next steps.
## **Add the Shell Script to Code Repository**
You need to add a script file in your Code Repository stored on Github, Bitbucket, Azure, or any such platform. This script file contains commands to trigger the Testsigma Test Plan remotely.
1. Copy the shell script from the article: [Generic Shell Script for Integrating with CI/CD Tools](https://testsigma.com/docs/continuous-integration/shell-script/).
2. Update your [Testsigma API Key](https://testsigma.com/docs/configuration/api-keys/) and [Test Plan ID](https://testsigma.com/docs/continuous-integration/get-test-plan-details/) in the above script.
3. Now upload the script file to your Code Repository and commit.

2 Update your [Testsigma API Key](https://testsigma.com/docs/configuration/api-keys/) and [Test Plan ID](https://testsigma.com/docs/continuous-integration/get-test-plan-details/) in the above script.
---

3. Now upload the script file to your Code Repository (preferably root folder) and commit.

### Part 3: Configure the CircleCI Pipeline
## **Configure the CircleCI Pipeline**
1. In CircleCI, create a new project or select the Project that you want to integrate with Testsigma.
2. Clicking on **Setup Project** takes us to the Set Up page as shown below:

Expand Down
Loading
Loading