Skip to content

RobotFramework AIO version 0.13.0.22

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 17 Sep 08:10
· 162 commits to develop since this release
0a4b28b

Changelog

JsonPreprocessor

  • Changed data type of return value

    JsonPreprocessor now returns a dotdict (instead of a standard Python dictionary). With the dotdict notation, dictionary keys can be accessed as attributes. The resulting code is shorter and therefore easier to read.

  • Blocked dynamic key names

    In opposite to previous versions of the JsonPreprocessor, the creation of new keys based on parameter (dynamic key names), is not supported an more!

    Example:

    {
       "param1" : "ABC",
       "param2" : "XYZ",
       "${param2}" : 1
    }

    This code previously created a new parameter "XYZ" with value 1. Now an error message will be raised.

  • Improved error handling and error messages

  • Added jsonLoads method that allows users to directly parse JSONP content from strings

    Example:

    jsonpStr = "{\"A\" : 1, \"B\" : 2}"
    json_preprocessor = CJsonPreprocessor()
    retValues = json_preprocessor.jsonLoads(jsonpStr)
  • Added a naming convention check for key names within JSONP content processed by the JsonPreprocessor

    Key names have to start with a character, digit, or underscore and must not contain these special characters !#$%^&()=[]{}|;',?`~

    Example:

    Valid key names are: "abcParam", "01_Param", "__param+1", "param-1", "[email protected]", ...

    Invalid key names are: "+param01", "param$01", "abc#Param", ...

PrometheusInterface

Initial introduction of keyword library PrometheusInterface.

The interface library PrometheusInterface provides Robot Framework keywords to communicate with the monitoring system Prometheus. With the help of this interface it is possible to use Prometheus to monitor data provided by Robot Framework tests.

The monitoring system Prometheus has to be installed separately. Please visit the homepage for that. This homepage also contains a getting started section containing useful hints about how to configure the application. Further informations can also be found here.

The entire test setup is described in the main documentation of this keyword library.

Example

The goal is to count the number of passed and failed tests at two test benches: testbench_1 and testbench_2.

Step 1: Import the interface library

Library %{ROBOTPYTHONSITEPACKAGESPATH}/PrometheusInterface/prometheus_interface.py WITH NAME rf.prometheus_interface

Step 2: Create a counter for passed and a counter for failed tests (with "testbench" is the name of a label, and not the value of a label with this name; the name of the testbench is also not part of the counter name!).

rf.prometheus_interface.add_counter name=num_passed description=: number of passed tests labels=testbench
rf.prometheus_interface.add_counter name=num_failed description=: number of failed tests labels=testbench

This is usually done in the suite setup.

Step 3: Whenever a test is passed or failed on a certain testbench, increment the corresponding counter, passing the testbench name also (here the testbench name is the value of the label with name "testbench").

rf.prometheus_interface.inc_counter name=num_passed labels=testbench_1
rf.prometheus_interface.inc_counter name=num_failed labels=testbench_2

And so on.

PyTestLog2DB

  • Introduce new feature to switch the access interface to TestResult's database
    • Add supported new interface to database REST API Access.

      This interface helps to import test result data to the secured server which is not allowed to interact directly with the database.

    • Add new optional argument --interface which allow to switch between available interfaces (currently only direct access). Its value can be:

      • db (default value): use direct access to TestResult's database.
      • rest: use REST API Access to TestResult's database (new access)
    • This change is transparent to end user.

  • Add new optional argument --testrunurl to specify a link to test execution job, such as Jenkins or Gitlab CI/CD
  • Fix issue with parsing timestamps from pytest version 8.3.1 result files

Robot Framework

Introduction of New Thread Locking Keywords:

In this release, we have introduced two powerful new keywords to enhance thread management and synchronization in your test automation: Thread RLock Acquire and Thread RLock Release. These keywords are essential for managing re-entrant locks (RLocks), providing greater control and safety in multi-threaded environments.

Thread RLock Acquire:

The Thread RLock Acquire keyword allows a thread to acquire a re-entrant lock (RLock). This is crucial for ensuring that critical sections of your code are executed by only one thread at a time, preventing race conditions and ensuring data consistency.

  • In robot code:

    Thread RLock Acquire     rlock_name     blocking=True     timeout=-1

Thread RLock Release:

The Thread RLock Release keyword allows a thread to release a previously acquired re-entrant lock (RLock). Properly releasing locks is vital for avoiding deadlocks and ensuring the smooth execution of concurrent operations.

  • In robot code:

    Thread RLock Release     rlock_name

More details can be found in RobotFrameworkAIO_Reference.pdf chapter "Threading".

RobotFramework AIO Documentation

Added documentation of TestResultDBAccess package

RobotFramework AIO Package

Python Packages

  • Integrated robotframework-prometheus library
  • Integrated prometheus_client library
  • Integrated pika library
  • Updated robotframework-appiumlibrary library to use latest vesion

VSCodium Package

  • Updated from VSCodium version 1.73.0.22306 to latest version 1.90.2.24171

Python Package Index (PyPI)

  • Publish Robotframework-prometheus package to PyPI

Environment/Installation

  • Debian package:
    • Enhanced initRobotFrameworkAIO.sh, support to setup environment for non-root user

    • Introduce new user group robot-aio which is granted required permissions to use robotframework-aio package

      An user (BOT or integrator account) which have non-root permission can also be setup to use the installed robotframework-aio package on test machine as following steps:

      • Add BOT or Integrator account to robot-aio group by execute below command with root user or add it as a RUN step of Docker file

        usermod -a -G robot-aio $BOT_USER
      • Login as BOT or Integrator account

      • Execute initRobotFrameworkAIO.sh script to setup enviroment or add it as CMD step when starting Docker container

        initRobotFrameworkAIO.sh
      • Now, execute your Robotframework test case/suite. E.g

        robot ~/RobotTest/testcases/HelloWorld.robot
    • Added executable appium script to start the Appium server in command line (useful for Docker container)

      $RobotDevtools/appium

RobotFramework_TestsuitesManagement

  • Improved error messages in case of issues while loading the test configuration.

  • Updated JSON schema validation.

  • Resolved redundant code.

  • Modified the naming convention check to be aligned with Robot Framework core standards.

  • Extended import of variant configuration files

    After the RobotFramework_TestsuitesManagement library is imported

    Library RobotFramework_TestsuitesManagement WITH NAME testsuites

    a variant configuration file is usually loaded in a way like this:

    Suite Setup testsuites.testsuite_setup ./config/variants_config.jsonp

    With the three-dots syntax extension for relative paths, the positional dependency between the file containing the suite setup and the file with the variant configuration, is made dynamic.

    Suite Setup testsuites.testsuite_setup .../config/variants_config.jsonp

    The Robot Framework now also recursively considers parent directories while searching for variant configuration files starting with the actual relative path.

    Important: This feature previously was located inside the variant configuration files, e.g.:

    "default": {
    "name": "testconfig.json",
    "path": ".../"
    }

    This is not supported any more! Only relative paths to the actual directory ("path": "./") and to the parent directory ("path": "../") are possible.

    Why this change?

    Reason 1: It would be confusing to have the three-dots syntax available at two different positions in parallel in the code.

    Reason 2: It is possible now to move the folder containing the variant configuration files and the parameter configuration files up and down in the hierarchy of directories in the file sytem without the need to adapt any import path afterwards!

RobotFramework_UDS

Initial introduction of keyword library RobotFramework_UDS

RobotFramework_UDS provides a set of Robot Framework keywords for sending UDS (UnifiedDiagnostic Services) requests and interpreting responses from automotive electronic control units (ECUs).

This library supports almost UDS services such as Tester Present, Routine Control, Read Data By Identifier, ...

Besides, it also provides some enhancement keywords which allow you to use readable service names instead of dealing with hex IDs.

Example test case with UDS:

  *** Settings ***
  Library RobotFramework_UDS
  Suite Setup Connect
  Suite Teardown Disconnect

  *** Variables ***
  ${SUT_IP_ADDRESS}= ecu_ip_address
  ${SUT_LOGICAL_ADDRESS}= ecu_logical_address
  ${TB_IP_ADDRESS}= client_ip_address
  ${TB_LOGICAL_ADDRESS}= client_logical_address
  ${ACTIVATION_TYPE}= 0
  ${NAME}= UDS Connector

  *** Keywords ***
  Connect
     Log Create a uds Connector (DoIP) and establish the connection
     ${uds}= Create UDS Connector ecu_ip_address= ${SUT_IP_ADDRESS}
     ... ecu_logical_address= ${SUT_LOGICAL_ADDRESS}
     ... client_ip_address= ${TB_IP_ADDRESS}
     ... client_logical_address= ${TB_LOGICAL_ADDRESS}
     ... activation_type= ${ACTIVATION_TYPE}
     Connect UDS Connector name=${Name}
     Open UDS Connection

  Disconnect
     Log Close uds connection
     Close UDS Connection

  *** Test Cases ***
  Test user can use Tester Present service on ECU
     Log Use Tester Present service
     ${response}= Tester Present

Please refer to RobotFramework_UDS documentation for more details.

RobotLog2DB

Introduce new feature to switch the access interface to TestResult's database

  • Add supported new interface to database REST API Access.

    This interface helps to import test result data to the secured server which is not allowed to interact directly with the database.

  • Add new optional argument --interface which allow to switch between available interfaces (currently only direct access). Its value can be:

    • db (default value): use direct access to TestResult's database.
    • rest: use REST API Access to TestResult's database (new access)
  • This change is transparent to end user.

  • Fixed issue when importing test case with SKIP status

Add new optional argument --testrunurl to specify a link to test execution job, such as Jenkins or Gitlab CI/CD

RobotLog2RQM

Fixed issue when importing test case with SKIP status

New feature of testsuite

  • New optional argument: --testsuite <TESTSUITEID>

    The new --testsuite argument allows you to specify how test results are imported into IBM Rational Quality Manager (RQM). You can now import test results into an existing test suite or create a new one if needed.

  • Usage:

    • Import to existing test suite:

      To import test results into an existing test suite, simply provide the test suite ID with the --testsuite argument.

      python -m RobotLog2RQM resultxmlfile <host> <project> <user> <password> <testplan> --testsuite <EXISTING_TESTSUITE_ID>

      This command will import the test results into the test suite specified by <EXISTING_TESTSUITE_ID>.

    • Create a new test suite:

      If you want to create a new test suite and import the test results into it, use the value new for the --testsuite argument.

      python -m RobotLog2RQM resultxmlfile <host> <project> <user> <password> <testplan> --testsuite new

      This command will create a new test suite in RQM and then import the test results into the newly created test suite.

  • Example scenarios:

    • Import to existing test suite with id 1234

      python -m RobotLog2RQM robot_result.xml https://rqm-host.com My_RQM_Project testuser testpass 123 --testsuite 1234
    • Create and import to new test suite

      python -m RobotLog2RQM robot_result.xml https://rqm-host.com My_RQM_Project testuser testpass 123 --testsuite new

New feature to support project which enable Configuration Management (CM)

  • New optional arguments:

    When Configuration Management (CM) is enabled for the project area, it is necessary to specify the project stream or baseline when executing import tool to interact with the proper stream/baseline resources.

    The following arguments are used to provide this information:

    • --stream <STREAM>: A project stream represents a branch of work within a project area.
    • --baseline <BASELINE>: A baseline captures the state of project artifacts at a particular point in time.
  • Example usages:

    • Using stream Develop_stream for importing test execution results:

      python -m RobotLog2RQM output.xml https://sample-rqm-host.com ROBFW-AIO test_user test_pw 720 --stream 'Develop_stream'
    • Using baseline Baseline_v1 for importing test execution results:

      python -m RobotLog2RQM output.xml https://sample-rqm-host.com ROBFW-AIO test_user test_pw 720 --baseline 'Baseline_v1'

TestResultDBAccess

Support added for new interface REST API