GithubHelp home page GithubHelp logo

Version 1.2.0 won't run tests -- but using version 1.0 all tests are executed (in the same environment) about minitest-handler-cookbook HOT 16 CLOSED

btm avatar btm commented on July 22, 2024
Version 1.2.0 won't run tests -- but using version 1.0 all tests are executed (in the same environment)

from minitest-handler-cookbook.

Comments (16)

dpetzel avatar dpetzel commented on July 22, 2024

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.

dpetzel avatar dpetzel commented on July 22, 2024

Also Chef version might be useful if it turns out to be specific to a version of Chef.

from minitest-handler-cookbook.

dpetzel avatar dpetzel commented on July 22, 2024

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.

backslash-f avatar backslash-f commented on July 22, 2024

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.

dpetzel avatar dpetzel commented on July 22, 2024

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.

backslash-f avatar backslash-f commented on July 22, 2024

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.

dpetzel avatar dpetzel commented on July 22, 2024

@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.

backslash-f avatar backslash-f commented on July 22, 2024

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:

tree

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.

dpetzel avatar dpetzel commented on July 22, 2024

@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.

backslash-f avatar backslash-f commented on July 22, 2024

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.

dpetzel avatar dpetzel commented on July 22, 2024

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.

dpetzel avatar dpetzel commented on July 22, 2024

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.

backslash-f avatar backslash-f commented on July 22, 2024

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.

backslash-f avatar backslash-f commented on July 22, 2024

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.

dpetzel avatar dpetzel commented on July 22, 2024

@Conaaando Seems fair.

from minitest-handler-cookbook.

johnsmyth avatar johnsmyth commented on July 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.