Coder Social home page Coder Social logo

agent-ruby's Introduction

Ruby Cucumber and RSpec formatters for ReportPortal

Download

Join Slack chat! stackoverflow UserVoice Build with Love

Installation

Use Ruby 2.3+

Rubygems

From https://rubygems.org

gem install reportportal

or

Add gem 'reportportal', git: 'https://github.com/reportportal/agent-ruby.git' to your Gemfile. Run bundle install.

Usage (examples)

  • With Cucumber:

cucumber <other options> -f ReportPortal::Cucumber::Formatter

  • With Cucumber and parallel_tests gem:

parallel_cucumber <some options> -o '<some other options> -f ReportPortal::Cucumber::ParallelFormatter'

  • With RSpec:

rspec <other options> -f ReportPortal::RSpec::Formatter

Configuration

Create report_portal.yml configuration file in one of the following folders of your project: '.', './.config', './config' (see report_portal.yaml.example). Alternatively specify path to configuration file via rp_config environment variable.

Supported settings:

  • uuid - uuid of the ReportPortal user
  • endpoint - URI of ReportPortal web service where requests should be sent
  • launch - launch name
  • description - custom launch description
  • project - project name
  • attributes - launch attributes. key value object
  • formatter_modes - array of modes that modify formatter behavior, see formatter modes
  • launch_id - id of previously created launch (to be used if formatter_modes contains attach_to_launch)
  • file_with_launch_id - path to file with id of launch (to be used if formatter_modes contains attach_to_launch)
  • disable_ssl_verification - set to true to disable SSL verification on connect to ReportPortal (potential security hole!). Set disable_ssl_verification to true if you see the following error:
Request to https://rp.epam.com/reportportal-ws/api/v1/pass-team/launch//finish produced an exception: RestClient::SSLCertificateNotVerified: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
  • is_debug - set to true to mark the launch as 'DEBUG' (it will appear in Debug tab in Report Portal)
  • use_standard_logger - set to true to enable logging via standard Ruby Logger class to ReportPortal. Note that log messages are transformed to strings before sending.

Each of these settings can be overridden by an environment variable with the same name and 'rp_' prefix (e.g. 'rp_uuid' for 'uuid'). Environment variable can be upper cased (e.g. 'RP_UUID'). Environment variables take precedence over YAML configuration. Environment variable values are parsed as YAML values.

WebMock configuration

If you use WebMock for stubbing and setting expectations on HTTP requests in Ruby, add this to your configuration file (for RSpec it would be rails_helper.rb or spec_helper.rb)

WebMock.disable_net_connect!(:net_http_connect_on_start => true, :allow_localhost => true, :allow => [/rp\.epam\.com/]) # Don't break Net::HTTP

Formatter modes

The following modes are supported:

Name Purpose
attach_to_launch Do not create a new launch but add executing features/scenarios to an existing launch. Use launch_id or file_with_launch_id settings to configure that. If they are not present client will check rp_launch_id.tmp in Dir.tmpdir)
use_same_thread_for_reporting Send reporting commands in the same main thread used for running tests. This mode is useful for debugging this Report Portal client. It changes default behavior to send commands in the separate thread. Default behavior is there not to slow test execution.
skip_reporting_hierarchy Do not create items for folders and feature files
use_persistent_connection Use persistent connection to connect to the server

Logging

Experimental support for three common logging frameworks was added:

To use Logger, set use_standard_logger parameter to true (see Configuration chapter). For the other two corresponding appenders/outputters are available under reportportal/logging.

Parallel formatter

ReportPortal::Cucumber::ParallelFormatter can be used for tests started via parallel_tests gem.

Note: Launch id is shared between independent processes (as is the case with parallel_tests gem) via a file in Dir.tmpdir.

Links

agent-ruby's People

Contributors

abotalov avatar alalayla avatar aliaksandr-trush avatar angeliski avatar avarabyeu avatar filland avatar flaviomeira avatar mjnohai avatar monkey-t avatar razboev avatar scorpibear avatar yuri-karpovich avatar

Watchers

 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.