jfxs/robot-framework

By jfxs

Updated 9 months ago

A lightweight docker image to run Robot Framework tests

Image
Languages & frameworks
3

100K+

jfxs/robot-framework repository overview

jfxs / robot-framework

Software License Pipeline Status Robot Framework Tests

A lightweight automatically updated and tested multiarch amd64 and arm64 Docker image to run Robot Framework tests and containing:

  • lightweight image based on Alpine Linux only 40 MB,
  • multiarch with support of amd64 and arm64,
  • non-root container user,
  • automatically updated by comparing the software bill of materials (SBOM) changes,
  • image signed with Cosign,
  • an software bill of materials (SBOM) attestation added using Syft,
  • available on Docker Hub and Quay.io.

GitLab The main repository.

Docker Hub The Docker Hub registry.

Quay.io The Quay.io registry.

This image has:

Running Robot Framework

Example to run Robot Framework tests in your current directory:

docker run -t --rm -v $(pwd):/tests jfxs/robot-framework robot --outputdir /tests /tests/tests/RF

Example to add a Robot Framework library and run Robot Framework tests in your current directory:

docker run -t --rm -v $(pwd):/tests jfxs/robot-framework /bin/sh -c "pip install --user robotframework-faker && robot --outputdir /tests /tests/tests/RF"

Task robot.yml template

This image includes a Task Robot Framework template with some useful tasks:

  • badge: create a badge all_tests.svg from the results of the Robot Framework tests. Robot tests badge If all tests pass, the background is green. If at least one test fails, the background is red. If at least a test has a skip status and all other pass, the background is orange.
      Usage: task robot:badge FILE|F=<output_file_path> [DIR|D=<badge_directory>] [IMG|I=<docker_image:tag>] [PULL|P=<n|N>]

      Arguments:
        FILE | F  Output XML results file (required)
        DIR  | D  Generated badge directory (optional, current directory by default)
        IMG  | I  Docker Robot Framework image to use (optional, by default {{.IMAGE_ROBOT}})
        PULL | P  Pull docker image (optional, by default yes)

      Requirements:
        - pybadges lib or docker
# Example:
docker run -t --rm -v $(pwd):/tests jfxs/robot-framework /bin/sh -c "task --taskfile /robot.yml badge FILE=/tests/reports/output.xml"
  • cop: static code analysis of Robot Framework language with Robocop.
      Usage: task robot:cop DIR|D=<tests_dir> [ARG|A="cli_arguments"] [IMG|I=<docker_image:tag>] [PULL|P=<n|N>]

      Arguments:
        DIR  | D  Directory or file to format (required)
        ARG  | A  Arguments and options (optional)
        IMG  | I  Docker Robot Framework image to use (optional, by default {{.IMAGE_ROBOT}})
        PULL | P  Pull docker image (optional, by default yes)

      Requirements:
        - robocop or docker
# Example:
docker run -t --rm -v $(pwd):/tests jfxs/robot-framework /bin/sh -c "task --taskfile /robot.yml cop DIR=/tests/tests/RF"
  • mask: mask sensitive data of a file, especially in output.xml Robot Framework file before publishing.
      Usage: task robot:mask FILE|F=<file_path> DATA|D=paswword1,password2

      Arguments:
        FILE | F  Fix files (required)
        DATA | D  Data to mask separated by comma (required)
# Example:
docker run -t --rm -v $(pwd):/tests jfxs/robot-framework /bin/sh -c "task --taskfile /robot.yml mask FILE=/tests/reports/output.xml DATA=paswword1,password2"
      Usage: task robot:tidy DIR|D=<tests_dir> [ARG|A="cli_arguments"] [IMG|I=<docker_image:tag>] [PULL|P=<n|N>]

      Arguments:
        DIR  | D  Directory or file to format (required)
        ARG  | A  Arguments and options (optional)
        IMG  | I  Docker Robot Framework image to use (optional, by default {{.IMAGE_ROBOT}})
        PULL | P  Pull docker image (optional, by default yes)

      Requirements:
        - robotidy or docker
# Example:
docker run -t --rm -v $(pwd):/tests jfxs/robot-framework /bin/sh -c "task --taskfile /robot.yml tidy DIR=/tests/tests/RF ARG"--check""

You can also install Task and download the robot.yml template locally. Documentation: Task templates

Built with

Docker latest tag is 7.3.2-025, 7.3, 7 and has:

NameVersionType
curl8.14.1-r2apk
go-task3.43.3-r4apk
pip25.2python
robotframework7.3.2python
robotframework-requests0.9.7python
robotframework-robocop6.9.0python
robotframework-seleniumlibrary6.8.0python
robotframework-tidy4.18.0python
selenium4.38.0python

Details are available on Dockerhub Overview page.

Versioning

The Docker tag is defined by the Robot Framework version used and an increment to differentiate build with the same Robot Framework version:

<robot_version>-<increment>

Example: 6.0.2-001

Signature and attestation

Cosign public key:

-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEa3yV6+yd/l4zh/tfT6Tx+zn0dhy3
BhFqSad1norLeKSCN2MILv4fZ9GA6ODOlJOw+7vzUvzZVr9IXnxEdjoWJw==
-----END PUBLIC KEY-----

The public key is also available online: https://gitlab.com/op_so/docker/cosign-public-key/-/raw/main/cosign.pub.

To verify an image:

cosign verify --key cosign.pub $IMAGE_URI

To verify and get the SBOM attestation:

cosign verify-attestation --key cosign.pub --type spdxjson $IMAGE_URI | jq '.payload | @base64d | fromjson | .predicate'

Authors

License

This program is free software: you can redistribute it and/or modify it under the terms of the MIT License (MIT). See the LICENSE for details.

Tag summary

Content type

Image

Digest

sha256:b6a1e8f37

Size

54.1 MB

Last updated

9 months ago

docker pull jfxs/robot-framework