From 541c8a8a3f15948a34742afe69b3fc97221c93ad Mon Sep 17 00:00:00 2001 From: Gad Hassine <43172181+hassineabd@users.noreply.github.com> Date: Wed, 2 Oct 2024 20:46:24 +0200 Subject: [PATCH] azure-devops doumentation fo RF CI.md --- .../using_rf_in_ci_systems/ci/azure-devops.md | 64 +++++++++++++++++-- 1 file changed, 59 insertions(+), 5 deletions(-) diff --git a/website/docs/using_rf_in_ci_systems/ci/azure-devops.md b/website/docs/using_rf_in_ci_systems/ci/azure-devops.md index bea190cd..25ecc1f5 100644 --- a/website/docs/using_rf_in_ci_systems/ci/azure-devops.md +++ b/website/docs/using_rf_in_ci_systems/ci/azure-devops.md @@ -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. \ No newline at end of file