Skip to main content

A CLI tool for uploading Robot Framework test results to rflogs.io

Project description

rflogs CLI

rflogs is a command-line interface tool for uploading and managing Robot Framework test results with the RF Logs service. It provides an easy way to integrate RF Logs with your CI/CD pipelines or local development workflow.

Installation

Install rflogs using pipx (recommended) or pip:

pipx install rflogs

or

pip install rflogs

Usage

Authentication

rflogs uses an API key for authentication. Set your RF Logs API key as an environment variable:

export RFLOGS_API_KEY=your_api_key_here

You can add this line to your shell configuration file (e.g., .bashrc, .zshrc) to make it permanent.

Tagging Runs

You can associate tags with your test runs to categorize and filter them. Tags can be specified using the --tag or -t option when uploading results.

Tag Format

  • Key-Value Tags: key:value
  • Simple Tags: tag

Constraints

  • Tag Keys:

    • Must start with a letter (a-z, A-Z).
    • Length: 1 to 50 characters.
    • Allowed Characters: Letters, numbers, underscores (_), hyphens (-), dots (.).
    • Case-Insensitive: Env and env are considered the same key.
  • Tag Values:

    • Length: 1 to 100 characters.
    • Allowed Characters: Letters, numbers, spaces, underscores (_), hyphens (-), dots (.), slashes (/).
    • Case-Sensitive.

Examples

# Valid Tags
rflogs upload -t env:production -t browser:chrome -t regression

# Invalid Tag Key (starts with a number)
rflogs upload -t 1env:production  # Will produce an error

# Invalid Tag Value (contains invalid character '@')
rflogs upload -t env:prod@ction  # Will produce an error

Uploading Test Results

Upload test results after running your Robot Framework tests:

rflogs upload [OUTPUTDIR]
  • OUTPUTDIR: Optional. Specifies the location of the test output files. Default is the current directory.
  • The command does not perform a recursive search.

This command will:

  1. Find relevant test result files (log.html, report.html, output.xml, and screenshots) in the specified directory
  2. Compress output.xml using tar.gz
  3. Upload all files to the RF Logs server
  4. Provide a link to view the uploaded results

Example output:

$ rflogs upload ./results
Uploading results
  output.xml    1.20 MB - compressed to 800.00 KB ✓
  log.html    256.00 KB ✓
  report.html 128.00 KB ✓
  screenshot1.png 45.00 KB ✓
  screenshot2.png 52.00 KB ✓

Run ID: 1234abcd
Files:  5
Size:   1.28 MB

Overview: https://rflogs.io/runs/1234abcd
Log:      https://rflogs.io/runs/1234abcd/log.html
Report:   https://rflogs.io/runs/1234abcd/report.html

Listing Uploads

View your recent uploads:

rflogs list

Example output:

$ rflogs list
Available runs:
  1234abcd
  5678efgh
  90ijklmn

To view details of a specific run, use: rflogs info <run_id>

View Upload Details

Get details about a specific result:

rflogs info <run_id>

Example output:

$ rflogs info 1234abcd
Run ID: 1234abcd
Files: 5
  - log.html (ID: 1)
  - report.html (ID: 2)
  - output.xml (ID: 3)
  - screenshot1.png (ID: 4)
  - screenshot2.png (ID: 5)

Downloading Test Results

Download test results to your local machine:

rflogs download <run_id>

This command downloads all files associated with the specified test result to your current directory.

Example output:

$ rflogs download 1234abcd
Downloaded log.html
Downloaded report.html
Downloaded output.xml
Downloaded screenshot1.png
Downloaded screenshot2.png

Deleting a Test Run

To delete a specific run:

rflogs delete <run_id>

This command will immediately delete the specified run and its associated files from the server.

Integration with CI/CD Systems

GitHub Actions

To integrate rflogs with GitHub Actions, add the following step to your workflow:

- name: Upload Robot Framework results
  env:
    RFLOGS_API_KEY: ${{ secrets.RFLOGS_API_KEY }}
  run: |
    pipx install rflogs
    rflogs upload ./results

Make sure to set the RFLOGS_API_KEY secret in your GitHub repository settings.

Other CI/CD Systems

For other CI/CD systems:

  1. Install the RF Logs CLI tool in your CI environment
  2. Set the RFLOGS_API_KEY environment variable
  3. Run rflogs upload with the appropriate output directory

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rflogs-0.19.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

rflogs-0.19.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file rflogs-0.19.0.tar.gz.

File metadata

  • Download URL: rflogs-0.19.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for rflogs-0.19.0.tar.gz
Algorithm Hash digest
SHA256 efaf243f06b14c7d4782be7d356b71a69e518668023228b6816d93dc5b6a08b0
MD5 0971a7a568ca6994db54e1ff89b8b8de
BLAKE2b-256 69a8bd3a6a014cf26b1baf96766e61de824cf8588b2866670e6c1f0f0c32594f

See more details on using hashes here.

File details

Details for the file rflogs-0.19.0-py3-none-any.whl.

File metadata

  • Download URL: rflogs-0.19.0-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for rflogs-0.19.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ac353593f1c56ca845ae65e511409a1e2a8818676b3dc2d04aa901f1d157058
MD5 149ae0728851794610a736e31c463caa
BLAKE2b-256 421c40f57a98a42bcd1c99f28b05a19b6401ecf736ac008b0be5d2aad3ce75fb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page