Coder Social home page Coder Social logo

robot_docker_demo's Introduction

Robot Framework CI Demo

Project demonstrates how to setup Continous Integration for Robot Frameowrk tests using GitHub Actions.

Use Cases

Demo covers these use cases:

  • Run Robot Framework tests:
    • when new commits are pushed to the main branch
    • when new commits are pushed to a Pull request
    • run tests with a pre-defined schedule
    • Trigger tests manually. Input variables for a test run.
  • Reporting:
    • Store Robot Framework reports from test runs
    • Post summary of results as comment to a commit. Comment is posted only to the main (master) branch.

In other words, separate CI server (such as Jenkins) is not needed to run Robot Framework tests.

Why use Actions for CI?

Using GitHub Actions for setup CI is far far better than sliced bread ๐Ÿฅฏ๐ŸŽ‰ Setup is straightforward and usage is free for public repositories (see pricing for other types of repositories).

Setup described here is very simple for demo purposes. It is possible to add more bells and whisthles if needed.

Description of the setup

CI Workflows are configured in YAML files in a folder .github/workflows. When Job is run, it is visible in the Actions tab in the repository.

Workflow fails if Robot Framework tests fail. Robot Framewework results reports are stored in a zip file.

This repository has two workflows for demo purposes:

Docker container used in this demo is ppodgorsek/robot-framework. The container has many pre-installed libraries and tools (it is even possible to run Selenium Browser tests).

The next chapter describes how to modify example workflows for your project.

To configure example setup to your own project:

  1. Modify docker run command according to your project:
    • reports folder needs to exist in a repository. As it is not possible to add an empty folder in a git, place a file to the /reports folder and commit it (this is bit hacky, but I could not get ppodgorsek container's privileges to work without this dummy file)
    • Place your tests to the test folder, or modify run command accordingly
    • Modify line -e ROBOT_OPTIONS="--variable DINOSAUR:Achillobator --variable NOT_DINOSAUR:kissa" \ according to your project or remove it completely
docker run \
    -v ${PWD}/reports:/opt/robotframework/reports:Z \
    -v ${PWD}/tests:/opt/robotframework/tests:Z \
    -e ROBOT_OPTIONS="--variable DINOSAUR:Achillobator --variable NOT_DINOSAUR:kissa" \
    --user $(id -u):$(id -g) \
    ppodgorsek/robot-framework:latest
  1. All other modifications, such as changing cron schedule are optional. Things to consider:
    • If workflow needs secrets, those can be stored in repository settings. Secret is used in the flow like this ${{ secrets.MY_SECRET_NAME }}

Acknowledgments

robot_docker_demo's People

Contributors

laojala avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.