bhenderson / minitest-ci Goto Github PK
View Code? Open in Web Editor NEWThis has been moved to circleci.
Home Page: https://github.com/circleci/minitest-ci
This has been moved to circleci.
Home Page: https://github.com/circleci/minitest-ci
= 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.
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.
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?
I just realized that M::Unit#status can be called by siginfo, and I don't want it to run then.
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
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
if failure = result.failure
should the conditional operator be '==' instead of '='?
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.
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?
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.