Coder Social home page Coder Social logo

minitest-ci's Introduction

= minitest-ci

* https://github.com/circleci/minitest-ci

== DESCRIPTION:

*** NOTE ***
I've passed ownership over to
circleci[https://github.com/circleci/minitest-ci]. Thank you all so much for
using this.
*** NOTE ***

CI reporter plugin for Minitest

This gem was made possible by YP.com

== FEATURES/PROBLEMS:

* Uses Minitest::Reporter which is only available since version 5

== SYNOPSIS:

  require 'minitest/ci'

Records test results and generates XML files (for junit hudson plugin
for example) at the end of the test run. The report directory is cleaned
between test runs. To disable:

  # test/helper.rb
  Minitest::Ci.clean = false

  # Rakefile (optional, but recommended!)
  task :ci_cleanup do
    require 'minitest/ci'
    Minitest::Ci.new.start
  end
  task :test => %w[ci_cleanup test:one test:two]

== REQUIREMENTS:

* See Rakefile

== INSTALL:

* gem install minitest-ci

== DEVELOPERS:

After checking out the source, run:

  $ rake newb

This task will install any missing dependencies, run the tests/specs,
and generate the RDoc.

== LICENSE:

(The MIT License)

Copyright (c) 2011 bhenderson

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

minitest-ci's People

Contributors

bhenderson avatar mschuerig avatar zcrowell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

minitest-ci's Issues

generate_suite: escape the suite name in filename

I've started to write view tests with MiniTest::Spec whose names contain slashes. This breaks MiniTest::Ci as it currently just uses the raw name of the test suite as part of the filenames it generates. When this name contains a "/", the part before it is interpreted as the name of a directory. Which does not exist and is not meant to.

As a simple fix, please CGI.escape the name of the suite.

Can't seem to *not* require minitest/ci

I have this in my Gemfile:

group :test do
    gem 'minitest-ci', require: false
end

And this in my test_helper.rb

if ENV["CI"]
  require 'minitest/ci'
else
  require 'pry'
end

However this doesn't seem to work, it always seems to require minitest/ci and generates the ci files, even when ENV["CI"] is not set and require 'minitest/ci' is never called. The only way to prevent it is to remove it from the Gemfile.

Anyone have any ideas?

License missing from gemspec

Some companies will only use gems with a certain license.
The canonical and easy way to check is via the gemspec
via e.g.

spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']

There is even a License Finder to help companies ensure all gems they use
meet their licensing needs. This tool depends on license information being available in the gemspec.
Including a license in your gemspec is a good practice, in any case.

How did I find you?

I'm using a script to collect stats on gems, originally looking for download data, but decided to collect licenses too,
and make issues for missing ones as a public service :)
https://gist.github.com/bf4/5952053#file-license_issue-rb-L13 So far it's going pretty well

testsuite errors value is incorrect, passed test are counted as error tests

ci.rb
I added "errors += 1 unless e.nil?" to the generate_suite method suite.each do loop, else case statement

test_minitest_ci.rb
def test_testsuite
assert_equal "1", @doc['skipped']
assert_equal "2", @doc['failures']
assert_equal "4", @doc['errors'] - I think this should be assert_equal "3", @doc['errors'] based on the number of tests in MockTestSuite
assert_equal "3", @doc['assertions']
assert_equal "7", @doc['tests']
assert_equal "MockTestSuite", @doc['name']
end

Only run in CI environment

As the name implies, the plugin should run in a CI environment. So why not only run when the env var CI exists? This is a common env var set by all continuous integration providers.

Report files are removed between test suites during "rake test"

Not sure if there is a better way to discuss this, but I am trying to use minitest-ci to generate XML files for Jenkins to consume.

We have a brand new Rails 3.2.3 application and Ruby 1.9.3 and minitest.

When I run "rake test", it actually runs 3 types of tests in our application: models, controllers and integration. It looks like minitest-ci is generating report files, but cleaning them right before moving on to the next set of tests. I was able to get around this by manually adding a cleanup hook to the "test" task, and adding the following to my minitest_helper.rb:

if ENV['CI']
  require 'minitest/ci'
  # stop CI reporter from cleaning generated files for each suite
  module MiniTest
    module Ci
      private
      def clean; end
    end
  end
end

I wonder if there is a better way?

bad gemspec

Someone emailed me saying that with the release of bundler 1.1.0, they were getting an invalid gemspec issue (psych) with version 1.0.0 even though they were trying to install 1.0.4.

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.