Comments (6)
Hmm interesting.... I'll try and get a test case put together to flush this out. My initial thoughts/concerns are:
/
might break Windows nodes. I don't recall if we do any sanitation or if its possible to have//
in the path.- The block of code should only be considering test files within the scope of a single cookbook. It should not even be aware of test from a different cookbook. So while your recommendation may just work, I think there might be a larger issues if the test loader is finding tests from a different cookbook than the one it is evaluating. IE it loops through each cookbook one at a time and finds the test files for that cookbook, when working on any single cookbook the list of available test files should only include ones from that cookbook.
from minitest-handler-cookbook.
Hi,
I don't think it was matching cross cookbook. The issue was one of tail-matching where one recipe name was a substring of another. To require recipe names to bear that restriction seems undesirable. Perhaps use ruby's File methods to pull apart the test file path for a more direct match against "#{recipe_name}_test.rb". That should be Windows-safe...
Sent from my HTC One X on O2
----- Reply message -----
From: "dpetzel" [email protected]
To: "btm/minitest-handler-cookbook" [email protected]
Cc: "ghostflame" [email protected]
Subject: [minitest-handler-cookbook] Problem with over-keen test file detection in libraries/test_loader.rb (#67)
Date: Wed, Aug 6, 2014 14:57
Hmm interesting.... I'll try and get a test case put together to flush this out. My initial thoughts/concerns are:
/ might break Windows nodes. I don't recall if we do any sanitation or if its possible to have // in the path.
The block of code should only be considering test files within the scope of a single cookbook. It should not even be aware of test from a different cookbook. So while your recommendation may just work, I think there might be a larger issues if the test loader is finding tests from a different cookbook than the one it is evaluating. IE it loops through each cookbook one at a time and finds the test files for that cookbook, when working on any single cookbook the list of available test files should only include ones from that cookbook.
—
Reply to this email directly or view it on GitHub.
from minitest-handler-cookbook.
I'm not entirely sure I'm understanding the problem context then. The match is confined to a cookbook, so if another cookbook has a similarly named recipe, it shouldn't matter. I'm guessing it somehow is mattering based on your suggestions though. Would it be possible to pass along the error message?
from minitest-handler-cookbook.
I've seen this issue.
Say you have a cookbook used for users 'users_cookbook'.In this cookbook you have a two recipe's.
'third-party-users.rb' & 'users.rb'. Then you assign tests with the names 'third-party-users_test.rb' and 'users_test.rb'.
Your building a host and you included say just the 'users_cookbook::users recipe on a hosts run-list then it matches both because the filename of both tests end with 'users_test.rb'. The match is ignoring the recipe name as a whole and just looking for files ending with the 'recipename_test.rb' Currently it's too ambiguous and should probably be constrained to match the whole filename.
from minitest-handler-cookbook.
ahh.. That makes sense, I totally misread the original report :( I believe I should be able to work up some tests and fix in the not to distant future.
from minitest-handler-cookbook.
@ghostflame @superted666 Can you give the version on master a spin and see if it solves the problem for you?
Thanks
from minitest-handler-cookbook.
Related Issues (20)
- Tests not running, and what looks like won't get copied into the correct location. HOT 3
- Test files not copied from a Private Chef cookbook to chef-client host HOT 25
- FATAL: LoadError: cannot load such file -- minitest-chef-handler HOT 4
- using BATS as the testing implementation alienates Windows Use HOT 6
- Support specifying minitest-chef-handler gem version
- Minitest performance - Gem files HOT 10
- test-kitchen run fails with minitest-handler-cookbook v1.0.1 but not 0.2.1 HOT 3
- Graphing Output HOT 4
- Only load filtered tests HOT 7
- Version 1.2.0 won't run tests -- but using version 1.0 all tests are executed (in the same environment) HOT 16
- Unreleased version 1.2.0 has been pushed to the community site? HOT 3
- default version of chef handler gem
- Tests don't run from chef-client HOT 32
- Remove recipe name matching requirement HOT 3
- FEATURE: Disable flag HOT 2
- do not install dependencies of minitest-chef-handler gem HOT 3
- No longer works with chef 12 HOT 2
- too short control escape HOT 4
- Error executing action `run` on resource 'ruby_block[load_tests_and_register_handler]'
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 minitest-handler-cookbook.