Microservices From Day One by Cloves Carneiro Jr. & Tim Schmelmer
Author:Cloves Carneiro Jr. & Tim Schmelmer
Language: eng
Format: epub
Publisher: Apress, Berkeley, CA
SimpleCov.start
RSpec.configure do |config|
config.after(:suite) do
simplecov = RSpec.describe('Test coverage')
example = simplecov.example('must exceed 85 percent'){
expect( SimpleCov.result.covered_percent ).to be > 85
}
simplecov.run
if example.execution_result.status != :passed
RSpec.configuration.reporter.example_failed(example)
end
end
end
Listing 8-5.spec/spec_helper.rb that fails test suite runs below 85% coverage
Continuous Integration to Improve Code Reviews
If you want to use a less forceful approach than failing the entire test suite, but still want to keep track of declining code coverage numbers, you can instead (or additionally) try and integrate coverage checks into your Continuous Integration (CI) build system.
When using the Jenkins project's CI system ( https://jenkins.io/ ), it can easily be extended with plugins to set up a workflow that processes SimpleCov-generated code coverage data. The DocLinks plugin ( https://wiki.jenkins-ci.org/display/JENKINS/DocLinks+plugin ) can be used to display formatted coverage reports, as shown in Figure 8-3.
Figure 8-3.Jenkins shows SimpleCov reports via the DocLinks plugin.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12585)
Hello! Python by Anthony Briggs(9924)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9799)
The Mikado Method by Ola Ellnestam Daniel Brolund(9783)
Dependency Injection in .NET by Mark Seemann(9347)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8308)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7770)
Grails in Action by Glen Smith Peter Ledbrook(7703)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7564)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7134)
Microservices with Go by Alexander Shuiskov(6896)
Practical Design Patterns for Java Developers by Miroslav Wengner(6813)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6755)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6422)
Angular Projects - Third Edition by Aristeidis Bampakos(6171)
The Art of Crafting User Stories by The Art of Crafting User Stories(5695)
NetSuite for Consultants - Second Edition by Peter Ries(5624)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5437)
Kotlin in Action by Dmitry Jemerov(5071)
