Description
This gem parses a TAP report per the specifications listed on https://testanything.org/tap-specification.html. Each of the tests has six attributes: number, description, status, directive, diagnostic and passing.
TapReportParser alternatives and similar gems
Based on the "Testing" category.
Alternatively, view TapReportParser alternatives based on common mentions on social networks and blogs.
-
Selenium WebDriver
A browser automation framework and ecosystem. -
faker
A library for generating fake data such as names, addresses, and phone numbers. -
factory_bot
A library for setting up Ruby objects as test data. -
vcr
Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests. -
WebMock
Library for stubbing and setting expectations on HTTP requests in Ruby. -
shoulda-matchers
Simple one-liner tests for common Rails functionality -
Cucumber
A home for issues that are common to multiple cucumber repositories -
Parallel Tests
Ruby: 2 CPUs = 2x Testing Speed for RSpec, Test::Unit and Cucumber -
minitest
minitest provides a complete suite of testing facilities supporting TDD, BDD, mocking, and benchmarking. -
timecop
A gem providing "time travel", "time freezing", and "time acceleration" capabilities, making it simple to test time-dependent code. It provides a unified method to mock Time.now, Date.today, and DateTime.now in a single call. -
capybara-webkit
A Capybara driver for headless WebKit to test JavaScript web apps -
mutant
Automated code reviews via mutation testing - semantic code coverage. -
DuckRails
Development tool to mock API endpoints quickly and easily (docker image available) -
Ruby Tests Profiling Toolbox
Ruby Tests Profiling Toolbox -
Spork
A DRb server for testing frameworks (RSpec / Cucumber currently) that forks before each run to ensure a clean testing state. -
Aruba
Test command-line applications with Cucumber-Ruby, RSpec or Minitest. -
Appraisal
A Ruby library for testing your library against different versions of dependencies. -
Phony
E164 international phone number normalizing, splitting, formatting. -
Konacha
Test your Rails application's JavaScript with the mocha test framework and chai assertion library -
Fabrication
This project has moved to GitLab! Please check there for the latest updates. -
Ruby-JMeter
A Ruby based DSL for building JMeter test plans -
API Taster
A quick and easy way to visually test your Rails application's API. -
Knapsack
Knapsack splits tests evenly across parallel CI nodes to run fast CI build and save you time. -
ActiveMocker
Generate mocks from ActiveRecord models for unit tests that run fast because they don’t need to load Rails or a database. -
Wrong
Wrong provides a general assert method that takes a predicate block. Assertion failure messages are rich in detail. -
RR
RR is a test double framework that features a rich selection of double techniques and a terse syntax. ⛺ -
FactoryTrace
Simple tool to maintain factories and traits from FactoryBot -
Pundit Matchers
A set of RSpec matchers for testing Pundit authorisation policies. -
Flatware
A parallel test runner for RSpec and Cucumber with pretty output -
Drawers
Group related classes together. No more silos. A solution to rails dystopia.
Tired of breaking your main and manually rebasing outdated pull requests?
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of TapReportParser or a related project?
README
TapReportParser
This gem parses a TAP report per the specifications listed on https://testanything.org/tap-specification.html. Each of the tests has six attributes: number
, description
, status
, directive
, diagnostic
and passing
.
- The
number
is test number. If thenumber
is not present, the parser maintains its own count. - The
description
is the text describing the test. If thedescription
is not present, then its value is empty string. - The
status
is represented by one of the four values:success
(when test is passing),failure
(when test is failing),skipped
(when test is marked as skipped irrespective of success or failure), andignore
(when test is marked as todo irrespective of success or failure). - The
directive
is either skipped or todo. - The
diagnostic
is a YAML block or text. If it is YAML then its value is ruby Hash, otherwise string. If thediagnostic
is not present, then its value is empty string. - The value of the
passing
istrue
if test status is eitherpassing
orignored
.
Installation
Add this line to your application's Gemfile:
gem 'tap_report_parser'
And then execute:
$ bundle
Or install it yourself as:
$ gem install tap_report_parser
Usage
You can parse report either from file or text, i.e.,
report = TapReportParser::Report.from_text(text)
report = TapReportParser::Report.from_file(file)
For example, consider the following TAP report:
TAP version 13
1..6
#
# Create a new Board and Tile, then place
# the Tile onto the board.
#
ok 1 - The object is a Board
ok 2 - Board size is zero
ok 3 - The object is a Tile
ok 4 - Get possible places to put the Tile
ok 5 - Placing the tile produces no error
ok 6 - Board size is 1
Parsing the report from text will return the TapReportParser::Report
object, which has the following three attributes:
test_count
: The test counttests
: Array ofTapReportParser::Test
objects each describing the test. Each of the test object has six attributes:number
,description
,status
,directive
,diagnostic
andpassing
.passing
: A boolean value which istrue
if all the tests are passing, i.e., the status is eithersuccess
orignored
, otherwisefalse
.
# Tests count
report.test_count
=> 6
# All the tests passing?
report.passing
=> true
# Tests
=> [#<TapReportParser::Test:0x00007f943a97d968 @status="success", @directive="", @passing=true, @number=1, @description="The object is a Board", @diagnostic="">, #<TapReportParser::Test:0x00007f943a97d580 @status="success", @directive="", @passing=true, @number=2, @description="Board size is zero", @diagnostic="">, #<TapReportParser::Test:0x00007f943a97d198 @status="success", @directive="", @passing=true, @number=3, @description="The object is a Tile", @diagnostic="">, #<TapReportParser::Test:0x00007f943a97cd88 @status="success", @directive="", @passing=true, @number=4, @description="Get possible places to put the Tile", @diagnostic="">, #<TapReportParser::Test:0x00007f943a97c978 @status="success", @directive="", @passing=true, @number=5, @description="Placing the tile produces no error", @diagnostic="">, #<TapReportParser::Test:0x00007f943a97c590 @status="success", @directive="", @passing=true, @number=6, @description="Board size is 1", @diagnostic="">]
# Test number
report.tests.first.number
=> 1
# Test description
report.tests.first.description
=> "The object is a Board"
# Test status
report.tests.first.status
=> "success"
# Test passing?
report.tests.first.passing
=> true
# Test directive
report.tests.first.directive
=> ""
# Test diagnostic
report.tests.first.diagnostic
=> ""
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/avmnu-sng/tap_report_parser. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the TapReportParser project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
*Note that all licence references and agreements mentioned in the TapReportParser README section above
are relevant to that project's source code only.