मैं एक छोटी प्लगइन पर काम कर रहा हूं और सरलकोव शामिल कर रहा हूं। मैं फ़ाइल के शीर्ष पर लाइन require "projectname/devuntil/rspec/spec_helper"
डाल अपने परीक्षण फ़ाइल मेंसरलकोव रिपोर्ट 0.0% कवर
gem 'simplecov', :require => false, :group => :test
:
मेरी मणि फ़ाइल में मैं रेखा है।
मेरी spec_helper.rb फ़ाइल में मैं फ़ाइल
if ENV['COVERAGE']
require 'simplecov'
require 'coveralls'
puts "require simplecov and coveralls"
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
]
SimpleCov.start do
add_filter 'spec/'
add_filter 'vendor/'
puts "Start simple coverage"
end
end
के शीर्ष पर simplecov जोड़ने जब मैं कमांड COVERAGE=true bundle exec rspec
के साथ परीक्षण चलाने के लिए यह पता चलता है की कोशिश: मेरे समारोह में यह कहा जाता है लेकिन
[[email protected] logstash-input-imap]# COVERAGE=true bundle exec rspec
Coverage may be inaccurate; set the "--debug" command line option, or do JRUBY_OPTS="--debug" or set the "debug.fullTrace=true" option in your .jrubyrc
require simplecov and coveralls
/usr/local/rvm/gems/jruby-9.1.7.0/gems/logstash-devutils-1.3.3-java/lib/logstash/devutils/rspec/spec_helper.rb:6:in `<main>': [DEPRECATION] ::[] is deprecated. Use ::new instead.
Start simple coverage
/usr/local/rvm/gems/jruby-9.1.7.0/gems/simplecov-0.15.0/lib/simplecov.rb:48: warning: tracing (e.g. set_trace_func) will not capture all events without --debug flag
--- jar coordinate com.fasterxml.jackson.core:jackson-databind already loaded with version 2.7.4 - omit version 2.7.3
--- jar coordinate com.fasterxml.jackson.core:jackson-annotations already loaded with version 2.7.0 - omit version 2.7.3
--- jar coordinate com.fasterxml.jackson.module:jackson-module-afterburner already loaded with version 2.7.4 - omit version 2.7.3
--- jar coordinate com.fasterxml.jackson.core:jackson-core already loaded with version 2.7.4 - omit version 2.7.3
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
Sending Logstash's logs to which is now configured via log4j2.properties
Run options: exclude {:redis=>true, :socket=>true, :performance=>true, :couchdb=>true, :elasticsearch=>true, :elasticsearch_secure=>true, :export_cypher=>true, :integration=>true, :windows=>true}
Randomized with seed 6877
.function called
.function called
.function called
.function called
.function called
.function called
.
Finished in 4.04 seconds (files took 16.56 seconds to load)
7 examples, 0 failures
Randomized with seed 6877
Coverage report generated for RSpec to /root/Downloads/logstash-input-imap/coverage. 0/88 LOC (0.0%) covered.
[Coveralls] Outside the Travis environment, not sending data.
हालांकि अभी भी 0.0% कवर किया गया।
यहां समस्या क्या हो सकती है और इसे कैसे ठीक किया जाए? धन्यवाद
आप पूर्ण 'spec_helper' साझा कर सकते हैं और आप जिस स्पेक फ़ाइल को चला रहे हैं? – meta
यह मेरी spec_helper फ़ाइल है। यह एक खुला स्रोत है। https://github.com/elastic/logstash-devutils/blob/master/lib/logstash/devutils/rspec/spec_helper.rb –
और यह मेरी spec फ़ाइल है https://github.com/logstash-plugins/logstash- इनपुट-आईमैप/ब्लॉब/मास्टर/स्पेक/इनपुट/imap_spec.rb –