RSpec

RSpec is a behavior-driven development (BDD) testing framework for the Ruby programming language, widely used for testing Ruby code and, notably, Ruby on Rails applications. RSpec can generate standard format JUnit-style XML files which can be submitted to Testfiesta or Testrail using Tacotruck CLI. You just need to install the popular pytest , and install tacotruck cli or use Github action. Check out simple RSpec example.

Configuration

To generate xml file report, report file path should be included in command.

bundle exec rspec --format documentation --format RspecJunitFormatter --out spec/reports/test-results.xml

Install Tacotruck CLI

$ npm install -g @testfiesta/tacotruck

Submit test results

tacotruck testfiesta \
  run:submit \
  --token testfiesta_... \
  --handle orgHandle \
  --key projectKey \
  --name runName \
  --data results-path/*.xml

Github Action

name: ruby rspec

on:
  pull_request:
    branches:
      - main
  push:
    branches:
      - main

jobs:
  test:
    runs-on: ubuntu-latest
    name: Test
    steps:
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: 3.4.5

    - name: Checkout code
      uses: actions/checkout@v4

    - name: Install dependencies
      run: bundle install

    - name: Run tests
      run: bundle exec rspec --format documentation --format RspecJunitFormatter --out spec/test-reports/test-results.xml

    - name: Report Results
      uses: testfiesta/tacotruck-action@v1
      with:
         provider: testfiesta
         handle: handle
         project: project
         base-url: https://api.testfiesta.com

Support and Resources

Last updated