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

Add azure DevOps documentation for running robot framework CI #68

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
64 changes: 59 additions & 5 deletions website/docs/using_rf_in_ci_systems/ci/azure-devops.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,61 @@
# ⛔ Azure DevOps
# Azure DevOps

**Azure DevOps** is a Microsoft platform that provides an end-to-end DevOps toolchain for developing and deploying software. It integrates with most leading tools on the market and is a great option for orchestrating a CI/CD pipeline.

To run **Robot Framework** tests in your Azure DevOps pipeline, you need to have **Python** and **Robot Framework** installed on the agents that execute the pipeline. You can use either Microsoft-hosted agents or set up your own self-hosted agents.

## Setting Up the Pipeline

In Azure DevOps, pipelines are defined using YAML files that specify the steps and jobs to be executed. Below is an example of an Azure DevOps pipeline that runs Robot Framework tests.

### Example of Azure Pipelines YAML for Robot Framework

```yaml
# azure-pipelines.yml

trigger: none
pr: none

pool:
name: 'Your Agent Pool' # Replace with your agent pool name

jobs:
- job: RunRobotTests
displayName: 'Run Robot Framework Tests'
steps:

- task: UsePythonVersion@0
inputs:
versionSpec: '3.10' # Specify the Python version you need
addToPath: true

- script: |
python -m pip install --upgrade pip
pip install -r requirements.txt
displayName: 'Install Dependencies'

- script: |
echo Running Robot Framework Tests
robot -d Results Tests/yourPathToTests..
displayName: 'Run Robot Framework Tests'
continueOnError: true

- task: PublishBuildArtifacts@1
displayName: 'Publish Robot Framework Reports'
inputs:
PathtoPublish: 'Results'
ArtifactName: 'RobotFrameworkReports'
publishLocation: 'Container'
condition: succeededOrFailed()
```

## Explanation of parameters
Pool: Specifies the agent pool that will run the pipeline.
Job: Defines a job called RunRobotTests.
UsePythonVersion@0: Uses a specific version of Python on the agent.
Install Dependencies: Installs necessary Python packages from requirements.txt.
Run Robot Framework Tests: Executes the Robot Framework tests located in the specified test suite and outputs results to the Results directory.
PublishBuildArtifacts@1: Publishes the test results as build artifacts, making them available for download.


## No content yet 😿

Do you have experience with **Azure DevOps** and want to share your expertise?
Here is how to [contribute](/docs/about/contribute).
You can also [raise an issue](https://github.com/MarketSquare/robotframeworkguides/issues/new) and describe the content you would like to see here.