Skip to main content

Robot Framework System Profiler

Project description

Formulated Logo

Formulated Autoamation RPA Resources

FormulatedAutomation-Profiler

FormulatedAutomation PyPI version

image

Introduction

The purpose of this project is to record a snapshot of the runtime environment for an automation workspace. This includes recording installed applications and their versions on the machine. This is especially useful when automations stop working and allows for rapid debugging of machine prior and current states.

⚠️ This project is currently a work in process and should not be used in production environments. ⚠️

Installation

  • Create a virtual environment
  • pip install fa-profiler

Usage

Profiler

*** Settings ***
Library                 FormulatedAutomation.Profiler
Suite Teardown          Teardown

*** Keywords ***
Teardown
    Write Profile

If you look in the 'output' directory (which is the current directory, or whatever you speficy at runtime), you'll find an fa_report.yml file. In this file is a profile of the system you ran on, which includes things like

  • Python version and installed packages
  • Environment variables
  • Robot Framework variables (Secrets omitted)
  • Installed programs(on Windows)

It's organized in a way that makes 'diffing' it with a previous report trivial and therefore makes it easy to see what's changed between runs.

Sample Report from Windows CI
Sample Report from Linux CI

Omitting secrets from the profile

There's a good chance you're setting a varaible to something you don't want listed in the logs. In order to prevent secrets from leaking, Profiler will 'redact' any variables with 'secret' in their name. This will later be configurable.

Debugging

The Formulated Automation Profiler also includes some basic debugging tools.

*** Settings ***
Library                 FormulatedAutomation.Profiler
Suite Teardown          Teardown

*** Keywords ***
Teardown
    Pause On Failure # Launch a Dialog to pause execution whenever a task fails
    Write Profile

*** Keywords ***
Some Task
    Set Breakpoint # Pause execution and drop to Python's 'pdb' debugger
    Do Some Other Task
    Pause for Debug # Pause with a Dialog regardless of failure

Pause on Failure and Pause for Debug only occur if the environment variable 'ROBOT_DEBUG' is set to TRUE. This prevents pausing in production if the keywords are accidentally set.

Command Line Example:

Powershell: $Env:ROBOT_DEBUG = "TRUE"; robot -d output -P src tests
Bash: ROBOT_DEBUG=TRUE && robot -d output -P src tests

Testing

This library expects teh ROBOT_DEBUG environment variable to be set. You can do this however suits your platform:

Powershell: $Env:ROBOT_DEBUG = "TRUE"; robot -d output -P src tests
Bash: ROBOT_DEBUG=TRUE && robot -d output -P src tests

Execute the tests in this project:

robot -d output -P src tests

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

fa-profiler-0.1.2.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

fa_profiler-0.1.2-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file fa-profiler-0.1.2.tar.gz.

File metadata

  • Download URL: fa-profiler-0.1.2.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

File hashes

Hashes for fa-profiler-0.1.2.tar.gz
Algorithm Hash digest
SHA256 42484e26ce6b420e5c700b673fb8ccf69ebbc335a0f66dc1f6cea8e493852443
MD5 4408daa1c8678a0bb1b32e180fef907d
BLAKE2b-256 ba2cc7d092dc8d1684a0696d2e92f7d5c584e3ed0124c5513d65aad58a96ebca

See more details on using hashes here.

File details

Details for the file fa_profiler-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: fa_profiler-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

File hashes

Hashes for fa_profiler-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 65b7b49d0ab5cf84d331c5ea07d638aa6c0bcae33a75582c03eebe1849de78c5
MD5 03a8a62ae4827a18ec1f37d29dd64edf
BLAKE2b-256 600e6332b342258ea39fbe736d68ab849d89edcb641e117d38a36541f4dc6837

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