I made a GitHub Action that makes it easy to understand the execution result of RSpec

Introduction

Recently, I'm using GitHub Actions as a CI / CD service, but I was dissatisfied with the fact that it was difficult to understand the execution result when RSpec failed when compared with CircleCI. Introducing the following GitHub Action created by an in-house hackathon to relieve such stress.

RSpec Report · Actions · GitHub Marketplace · GitHub

What can i do?

In the case of a PR event, the failure result is commented. Also, by commenting, the same content will be notified by email, so you can understand the content of the failed test without accessing GitHub.

a23798fbb2f0e6454bf75a0e09034eb8.png

Other than PR events, you will be notified via the Checks API.

0d3c61f6ecc3354a9734eb2b30a82211.png

How to use

test.yml


name: Build
on:
  pull_request:

jobs:
  rspec:
    steps:
      #Preparations for RSpec execution are omitted
      
      - name: Test
        run: bundle exec rspec -f j -o tmp/rspec_results.json -f p

      - name: RSpec Report
        uses: SonicGarden/rspec-report-action@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          json-path: tmp/rspec_results.json
        if: always()

Other

point

--Analyzing and commenting on the execution result of RSpec output in JSON format --The -f j -o tmp / rspec_results.json option of the rspec command is required (save destination is arbitrary) --Comments will be deleted if all tests pass --The same comment will not be posted repeatedly --Supports parallel execution of tests --In that case, please adjust so that the title is unique as follows.

with:
  token: ${{ secrets.GITHUB_TOKEN }}
  json-path: tmp/rspec_results.json
  title: "# :cold_sweat: RSpec failure ${{ matrix.ci_node_index }}"

Repository

GitHub - SonicGarden/rspec-report-action: A GitHub Action that report RSpec failure.

Please use it if you like.

Recommended Posts

I made a GitHub Action that makes it easy to understand the execution result of RSpec
I made a gem to post the text of org-mode to qiita
I made a tool to output the difference of CSV file
A story that made it as easy as possible to check the operation when automatically creating a library update PR with Github Dependabot
Created a library that makes it easy to handle Android Shared Prefences
[Ruby] I want to make a program that displays today's day of the week!
[Object-oriented] A memorandum that makes zero the best [Site summary that helped to understand the concept]
A site that was easy to understand when I was a beginner when I started learning Spring Boot
A solution that makes it easy to input Procon and Web tests to verify results
I made a reply function for the Rails Tutorial extension (Part 4): A function that makes the user unique
I tried JAX-RS and made a note of the procedure
[Action View :: Missing Template] I didn't understand the meaning of the error statement, so I looked it up.
Know the convenience of Docker (-compose) now (information list that I referred to when using it)
I tried to express the result of before and after of Date class with a number line
[Node.js] Docker-compose up makes it easy to build a development environment
I want to understand the flow of Spring processing request parameters
The story of Collectors.groupingBy that I want to keep for posterity
I examined the concept of the process to understand how Docker works
How to identify the path that is easy to make a mistake
The story of making it possible to build a project that was built by Maven with Ant
A story that I was addicted to twice with the automatic startup setting of Tomcat 8 on CentOS 8
A story that I wanted to write a process equivalent to a while statement with the Stream API of Java8
A memo that was soberly addicted to the request of multipart / form-data
Think of test code that is easy to understand through Comparator testing
It was a life I wanted to reset the thread-safe associative counter
I will expose the fucking app that I made hard to get a job as an engineer from inexperienced.
Since the image of the lock screen of Windows 10 is beautiful, I wanted to make it a slide show of wallpaper
What I tried when I wanted to get all the fields of a bean
Think of RxJava as a library that makes asynchronous processing easier to write
I was a little addicted to the S3 Checksum comparison, so I made a note.
I made a sample of how to write delegate in SwiftUI 2.0 using MapKit
I managed to get a blank when I brought the contents of Beans to the textarea
I want to recursively get the superclass and interface of a certain class
I searched for a lightweight framework that answers the sudden "make it quickly"
I want to find the MD5 checksum of a file in Java and get the result as a string in hexadecimal notation.