GithubHelp home page GithubHelp logo

Comments (6)

dpetzel avatar dpetzel commented on August 24, 2024

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.

ghostflame avatar ghostflame commented on August 24, 2024

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.

dpetzel avatar dpetzel commented on August 24, 2024

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.

Rucknar avatar Rucknar commented on August 24, 2024

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.

dpetzel avatar dpetzel commented on August 24, 2024

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.

dpetzel avatar dpetzel commented on August 24, 2024

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

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.