Comments (16)
hrmm not a known issue, but certainly sounds less than ideal. The intention was to catch files outside the two documented directories, but sounds like that logic may not be working exactly as required. Could you give me a dir listing of 'files/default/test' so I can update the existing tests?
Also do you get this for ALL files, or just some?
from minitest-handler-cookbook.
Also Chef version might be useful if it turns out to be specific to a version of Chef.
from minitest-handler-cookbook.
One more thing to check. Do you have a file in the root of files/default
that would match the pattern of *_test.rb? Looking at the code I would expect there to be some sort of file name/path after the word at. In your output above there is nothing, which is making me wonder if there is some file in the root of files/default triggering this warning?
from minitest-handler-cookbook.
Sure.
dir listing of 'files/default/test:
user@machine:~/repo/project/cookbooks$ ls -la files/default/test/
drwxrwxr-x 2 root root 4096 May 7 10:41 ./
drwxrwxr-x 5 root root 4096 May 7 10:41 ../
-rw-rw-r-- 1 root root 483 May 7 10:41 database_client.rb
-rw-rw-r-- 1 root root 363 May 7 10:41 default_helper.rb
-rw-rw-r-- 1 root root 463 May 7 10:41 install_cloudify_recipes_test.rb
-rwxrwxr-x 1 root root 2130 May 7 10:41 integration_test_test.rb
-rw-rw-r-- 1 root root 472 May 7 10:41 jackrabbit_helper.rb
-rwxrwxr-x 1 root root 4963 May 7 10:41 jackrabbit_test.rb
-rwxrwxr-x 1 root root 5293 May 7 10:41 webserver_test.rb
Chef version:
user@machine:~$ chef-client --version
Chef: 11.6.2
Also do you get this for ALL files, or just some?
I'm getting the warning for all files.
Do you have a file in the root of files/default...
I have two directories there:
user@machine:~/repo/project/cookbooks$ ls -la files/default/
total 2
drwxr-xr-x 1 root root 0 Apr 11 13:35 .
drwxr-xr-x 1 root root 0 Apr 11 13:00 ..
drwxr-xr-x 1 root root 0 Apr 11 13:35 apps
drwxr-xr-x 1 root root 0 Apr 11 13:35 properties
drwxr-xr-x 1 root root 4096 Apr 11 13:35 test
from minitest-handler-cookbook.
Thanks for this, I'll try and repro this tonight and see what I can learn. Just to confirm you DON'T get this message for files in apps or properties, just the files in the test directory?
from minitest-handler-cookbook.
That is correct. I do NOT get the warning for files inside apps or properties. Just the files in the test directory.
Thanks for taking a look. Take your time. ;-)
from minitest-handler-cookbook.
@Conaaando I'm having trouble reproducing this. I've tested with chef client and chef solo and in both cases I'm not seeing that warning. I added all the files in your example and they were each copied into the testing directory.
Any chance you could gist the actual log messages as well as the portion of the log that starts with # Running tests:
Additionally looking at your directory structure I'm a little confused. You have a files/default
in the ROOT of your cookbooks directory as opposed to in an actual cookbook? IE
user@machine:~/repo/project/cookbooks$ ls -la files/default/
rather than
user@machine:~/repo/project/cookbooks/my_cookbook$ ls -la files/default/
from minitest-handler-cookbook.
Hey, @dpetzel. Mm, ok. Well, it may be something related to this environment, then.
I can't past the entire log because it's triggered by Jenkins in a huge pipeline. But I can paste here some snippets related to it (below).
Regarding the directory structure, here is the output of the 'tree' command:
Do you think this structure can be a problem?
(I just want to reinforce that it works fine in version 1.0)
Log
<ip> [2014-05-15T03:33:30+00:00] WARN: A test file was detected at database_client.rb in the files directory of the crs cookbook. As of version 1.2.0 of the minitest-handler-cookbook storing test files in this location is not supported. If you would like these tests executed you should move them into files/default/test/
<ip> [2014-05-15T03:33:30+00:00] WARN: A test file was detected at default_helper.rb in the files directory of the crs cookbook. As of version 1.2.0 of the minitest-handler-cookbook storing test files in this location is not supported. If you would like these tests executed you should move them into files/default/test/
<ip> [2014-05-15T03:33:30+00:00] WARN: A test file was detected at install_cloudify_recipes_test.rb in the files directory of the crs cookbook. As of version 1.2.0 of the minitest-handler-cookbook storing test files in this location is not supported. If you would like these tests executed you should move them into files/default/test/
<ip> [2014-05-15T03:33:30+00:00] WARN: A test file was detected at integration_test_test.rb in the files directory of the crs cookbook. As of version 1.2.0 of the minitest-handler-cookbook storing test files in this location is not supported. If you would like these tests executed you should move them into files/default/test/
<ip> [2014-05-15T03:33:30+00:00] WARN: A test file was detected at jackrabbit_helper.rb in the files directory of the ccpbase cookbook. As of version 1.2.0 of the minitest-handler-cookbook storing test files in this location is not supported. If you would like these tests executed you should move them into files/default/test/
<ip> [2014-05-15T03:33:30+00:00] WARN: A test file was detected at jackrabbit_test.rb in the files directory of the haproxy-hp cookbook. As of version 1.2.0 of the minitest-handler-cookbook storing test files in this location is not supported. If you would like these tests executed you should move them into files/default/test/
<ip> [2014-05-15T03:33:30+00:00] WARN: A test file was detected at webserver_test.rb in the files directory of the haproxy-hp cookbook. As of version 1.2.0 of the minitest-handler-cookbook storing test files in this location is not supported. If you would like these tests executed you should move them into files/default/test/
<ip> # Running tests:
<ip> Finished tests in 0.000690s, 0.0000 tests/s, 0.0000 assertions/s.
<ip> 0 tests, 0 assertions, 0 failures, 0 errors, 0 skips
Thanks, man!
from minitest-handler-cookbook.
@Conaaando Totally understand it was working before, and I do believe its a bug in the cookbook, I just need to figure out where :)
Is this under chef-solo or chef-client? Do you happen to know what your cookbook path configuration (perhaps defined in your knife.rb) is?
Can you turn on debug logging and look for lines like:
"Not copying test files for recipe"
from minitest-handler-cookbook.
That's ok. :-)
It's under chef-client.
We don't use a cookbook path configuration and / or Knife. We use Berkshelf.
This is interesting and may help -- reading the instructions at Berkshelf.com, it says:
##### Chef Solo provisioner
The Chef Solo provisioner’s cookbook_path attribute is hijacked when using the Vagrant Berkshelf plugin.
Cookbooks resolved from your Berksfile will automatically be made available to your Vagrant virtual machine.
There is no need to explicitly set a value for cookbook_path attribute.
##### Chef Client provisioner
Cookbooks will automatically be uploaded to the Chef Server you have configured in the Vagrantfile’s Chef Client provisioner block.
Your Berkshelf configuration’s chef.node_name and chef.client_key credentials will be used to authenticate the upload.
Not sure if the hijack thing applies to chef-client too... But it seems to be the case, since we do not configure a cookbook_path.
Another detail that may help: we use a Hosted Chef server (enterprise Chef). I'm not sure if this is relevant, tho.
Thanks.
from minitest-handler-cookbook.
Thanks @Conaaando If you could do a run with debug logging and look for "Not copying test files for recipe" it would be a great help. If that doesn't. I've tested with Chef client and chef_zero, but not an enterprise chef installation. Its got to be something simple/silly, just a matter of weeding it out :)
Are you in a position where you print your cookbook during the run so we could confirm what it is?
from minitest-handler-cookbook.
The plot thickens. I just ran this against enterprise Chef and and Chef 11.8.0 and still couldn't reproduce it.
Maybe a silly question, but I'm running out of ideas. That dir structure you sent me is what is in your SCM repo (before the CI run)? Can you look at your jenkins workspace and if somehow these files are getting moved into into files/default
?
from minitest-handler-cookbook.
That's really weird... It must be something simple, like you said. :-)
The issue happens in my workplace. I will get back to you on Monday.
Thanks for all your help. Have a great weekend.
from minitest-handler-cookbook.
Hi, @dpetzel. So here is the thing: I won't be able to investigate this issue any further this week. As a workaround, we are going to use version 1.0, which works fine. This may be a specific environment issue, since you are not able to reproduce. I suggest us to close this bug for now. If I happen to find out more info, I can reopen it. Does that sound good? Meanwhile, I appreciate your help. Thanks.
from minitest-handler-cookbook.
@Conaaando Seems fair.
from minitest-handler-cookbook.
Have you resolved this issue?
I'm seeing this same behavior. When I run via vagrant & chef-solo, everything runs fine, all the tests are loaded and execute as expected. I berks jupload this exact cookbook to the chef server, and when running the the chef client using Chef Server, the tests do not run, and I get the warnings about moving the tests to files/default/test (which is where the tests are). Any ideas?
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
- 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
- Problem with over-keen test file detection in libraries/test_loader.rb HOT 6
- 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.