Comments (15)
Still seeing randomness in failures, this needs to be much better.
from minimart.
Minimart::Mirror::InventoryBuilder#build errors should not happen any longer, there was wrong/new uri to match in tests. Now these tests do not fail (at least for me).
Somehow randomness affects testing results, so to have consistent failures that do not change from one run to another I removed
--order rand
from .rspec.
and now I am getting:
rspec ./spec/lib/minimart/inventory_requirement/git_requirement_spec.rb:53 # Minimart::InventoryRequirement::GitRequirement#requirements should not eq {"yum"=>"> 3.0.0"}
rspec ./spec/lib/minimart/mirror/dependency_graph_spec.rb:26 # Minimart::Mirror::DependencyGraph#add_artifact should not have any dependencies
rspec ./spec/lib/minimart/mirror/dependency_graph_spec.rb:30 # Minimart::Mirror::DependencyGraph#add_artifact should not add any possible dependencies to the graph
rspec ./spec/lib/minimart/mirror/dependency_graph_spec.rb:102 # Minimart::Mirror::DependencyGraph#resolved_requirements when all dependencies are met should not return a resolved yum version for the mysql dependency
rspec ./spec/lib/minimart/mirror/dependency_graph_spec.rb:114 # Minimart::Mirror::DependencyGraph#resolved_requirements when a dependency cannot be resolved should not raise an error
The only thing that puzzles me is when you perform the only one block it always succeeds:
$ bundle exec rspec ./spec/lib/minimart/mirror/dependency_graph_spec.rb
Minimart::Mirror::DependencyGraph
#add_artifact
should add the cookbook to the graph
should not have any dependencies
should not add any possible dependencies to the graph
when the cookbook has already been added
should not add any new dependencies
#source_cookbook_added?
when the cookbook has been added
should return true
when the cookbook has not been added
should return false
#add_requirement
should add the requirement
#resolved_requirements
when all dependencies are met
should not return a resolved mysql version
should not return a resolved apt version
should not return a resolved yum version for the mysql dependency
when a dependency cannot be resolved
should not raise an error
Finished in 0.03031 seconds (files took 0.76827 seconds to load)
11 examples, 0 failures
from minimart.
interesting I just ran that and saw the same results as well with just the single spec running.
from minimart.
Then when running the full suite the number of failures jumps from 3 to 5.
I hate tests that fail randomly. I would like to keep the random option in the .rspec as our tests should pass no matter what the order. I created a branch for this lets-fix-the-tests
from minimart.
I would like to keep the random option in the .rspec as our tests should pass no matter what the order.
Sure! Just for debugging/troubleshooting - all what I am saying is disabling randomness gives me consistent results - always 5 failures and I love consistency -) Will dig further when have some time.
from minimart.
If I run bundle exec rspec ./spec/lib/minimart/inventory_requirement/git_requirement_spec.rb
then all those specs pass but running the full suite rspec ./spec/lib/minimart/inventory_requirement/git_requirement_spec.rb:53 # Minimart::InventoryRequirement::GitRequirement#requirements should not eq {"yum"=>"> 3.0.0"}
fails :(
from minimart.
Cool @EYurchenko thank you for your help with this.
from minimart.
Finished in 16.01 seconds (files took 1.01 seconds to load) 260 examples, 0 failures, 3 pending
Lols Rspec you so silly.
from minimart.
somehow the one who feels silly is me -(
I was taught that computers do exactly what they are told to do, it's silly we humans break things -)
from minimart.
Lol it's silly that the test suite was not written better to begin with.
from minimart.
Please take a look at the last two commits at https://github.com/EYurchenko/minimart/commits/master . The problem we are seeing is because @load_deps is a class variable and depending on the order of tests execution it may go uninitialized ever which lead to weird results. If I get the logic right we want Minimart by default resolve all dependencies so my commit should be correct. It makes behavior persistent at least.
Then we get bunch of tests failing at Minimart::Mirror::DependencyGraph. They all fail now because we assume here that dependencies should not be added. Who wrote this tests? I don't understand why by default want no dependencies??? So I can easily fix these tests if they indeed want no dependencies added.
from minimart.
That is true, originally this was designed to load all dependencies by default but there was a lot of users wanting this as an option. We decided to change to have it not load the cookbooks dependencies by default but only when it is passed the load_deps option from the cli during the mirror call.
from minimart.
@EYurchenko thank you for finding that, I believe that will resolve this testing issue.
from minimart.
Ok, sorry for misunderstanding. I believe it is good now.
from minimart.
Thank you @EYurchenko for your work on this.
from minimart.
Related Issues (20)
- Minimart crashes when trying to download 'bad' cookbook HOT 5
- Cookbook with a name containing only digits causes pain HOT 1
- Publish 1.1.0 gem please HOT 4
- Source and issues links in cookbook detail HOT 1
- Minify CSS and JS in HTMLGenerator HOT 4
- support for incremental updates to inventory HOT 2
- Gem Release? HOT 2
- RubyGems deployment broken
- Encoding issues when generating Minimart HTML HOT 2
- ruby required version constraint HOT 8
- (ExecJS::RuntimeUnavailable) HOT 3
- Dependency handling (chicken and egg) HOT 1
- unable to download cookbooks with nonstandard versioning conventions HOT 3
- dont stop downloading cookbooks
- Minimart Badges HOT 1
- Migration to ridley 5
- Ability to find contingent cookbook dependencies when viewing cookbook on minimart
- Fix Minitar vulnerability
- Can this be used when authentication to github is required? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minimart.