/specmon

Monitor your specs runtime over the time.

Primary LanguageRubyMIT LicenseMIT

specmon

Monitor your specs runtime.

Try it out

Screenshot

🍊 Battle-tested at Instacart

✉️ Subscribe to releases

Docs

Installation

Add this line to your application’s Gemfile:

gem 'specmon'

Run:

rails g specmon:install
rake db:migrate

And mount the dashboard in your config/routes.rb:

mount Specmon::Engine, at: "specmon"

Add to assets/javascript/application.js

//= require specmon/application

Add to assets/stylesheet/application.scss

 *= require specmon/application

Configuration

Specmon supports multiple projects 🎉

Add additional projects in config/specmon.yml:

projects:
  project-1-master:
    url: <%= ENV["SPECMON_DATABASE_URL"] %>
    name: <%= ENV["PROJECT_1_CIRCLE_NAME"] %>
    username: <%= ENV["PROJECT_1_CIRCLE_USERNAME"] %>
    token: <%= ENV["PROJECT_1_CIRCLE_TOKEN"] %>
    branch: master
    show_owners: true
    adapter: circleci
  project-2-master:
    url: <%= ENV["SPECMON_DATABASE_URL"] %>
    name: <%= ENV["PROJECT_2_CIRCLE_NAME"] %>
    username: <%= ENV["PROJECT_2_CIRCLE_USERNAME"] %>
    token: <%= ENV["PROJECT_2_CIRCLE_TOKEN"] %>
    branch: master
    show_owners: false
    adapter: circleci

# change the time zone
# time_zone: "Pacific Time (US & Canada)"

Adapters

Specmon supports CircleCI

Override test section in your circle.yml file to generate a rspec.xml file

test:
  override:
    - bundle exec rspec --backtrace --color --profile --format documentation --format RspecJunitFormatter --out $CIRCLE_TEST_REPORTS/rspec.xml

And in your Gemfile

group :test do
  gem 'rspec_junit_formatter', github: 'instacart/rspec_junit_formatter'
end

Owners

By using show_owners and instacart/rspec_junit_formatter, you can assign a ownerto your spec and display runtime per owner.

describe 'team1', owner: :team1 do
  it 'It success' do
     expect(true).to eq(true)
  end
end

Fetching data

You can fetch data from circle by adding in your cron file:

*/5 * * * * rake specmon:project-1-master:recent_builds
*/5 * * * * rake specmon:project-2-master:recent_builds

Thanks

Specmon uses a number of awesome, open source projects.

Created by rahilsondhi and kwent

Want to Make Specmon Better?

That’s awesome! Here are a few ways you can help: