The fix here is the same as originally proposed, and based on the same 
permise, that #2493 (include filename case sensitivity) was caused by
commit cddc365e9bac786c7a64240073b69bc54b6d2f2e.  But now rather than
just having to take my word for it (argument by authority, ugh) we can 
demonstrate it.

To do so put the attached test in bisect/cap_bisect.3 and run

  git bisect start
  git bisect bad   HEAD
  git bisect good  df3a8f67193c8c6089a84ea6023c84c52b3d3205
  git bisect run \
      /usr/bin/ruby1.8 -I/usr/lib/ruby/gems/1.8/gems/rspec-1.2.2/lib \
      /usr/lib/ruby/gems/1.8/gems/rspec-1.2.2/bin/spec \
      bisects/cap_bisect_3.rb --format s

You may need to adjust the paths in the bisect-run command to suit your 
system.  The tail end of the results (showing the last good & first bad 
iterations) are attached here, after the test file.

If the originally proposed two line patch (included in this patch) is applied 
to HEAD the new tests will again pass.  


------- bisect/cap_bisect_3.rb ------------------------------------------

#!/usr/bin/env ruby

require File.dirname(__FILE__) + '/../spec/spec_helper'

def tmpfile(name)
    source = Tempfile.new(name)
    path = source.path
    source.close!
    path
end

describe "the include function" do
    before :each do
        @real_dir = Dir.getwd
        @temp_dir = tmpfile('include_function_integration_test')
        Dir.mkdir @temp_dir
        Dir.chdir @temp_dir
        @parser = Puppet::Parser::Parser.new :Code => ""
        @node = Puppet::Node.new("mynode")
        @compiler = Puppet::Parser::Compiler.new(@node, @parser)
        @compiler.send(:evaluate_main)
        @scope = @compiler.topscope
        # preload our functions
        Puppet::Parser::Functions.function(:include)
        Puppet::Parser::Functions.function(:require)
    end
    after :each do
        Dir.chdir @real_dir
        Dir.rmdir @temp_dir
    end
    def with_file(filename,contents)
        path = File.join(@temp_dir,filename)
        File.open(path, "w") { |f|f.puts contents }
        yield
        File.delete(path)
    end
    it "should add a relationship between the 'included' class and our class" do
        with_file('includedclass',"class includedclass {}") {
            @scope.function_include("includedclass")
            }
        
@compiler.catalog.edge?(@scope.resource,@compiler.findresource(:class,"includedclass")).should
 be_true
    end
    it "should find a file with an all lowercase name given a mixed case name" 
do
        with_file('includedclass',"class includedclass {}") {
            @scope.function_include("IncludedClass")
            }
    end
end


------- Results of running bisect (the tail eand at least) 
---------------------------------


Bisecting: 1 revisions left to test after this
[fc1f8cdbee606da0d2a1a162942295d28cdcbf64] Adding a special class to handle 
loaded classes/defines/nodes
running /usr/bin/ruby1.8 -I/usr/lib/ruby/gems/1.8/gems/rspec-1.2.2/lib 
/usr/lib/ruby/gems/1.8/gems/rspec-1.2.2/bin/spec spec/spec_helper.rb 
markus/cap_bisect_3.rb --format s                                               
                                                                                
            
Mocha deprecation warning: Mocha::Standalone has been renamed to Mocha::API

the include function
- should add a relationship between the 'included' class and our class
- should find a file with an all lowercase name given a mixed case name

Finished in 0.035761 seconds

2 examples, 0 failures
Bisecting: 0 revisions left to test after this
[cddc365e9bac786c7a64240073b69bc54b6d2f2e] Switching to LoadedCode from ASTSet
running /usr/bin/ruby1.8 -I/usr/lib/ruby/gems/1.8/gems/rspec-1.2.2/lib 
/usr/lib/ruby/gems/1.8/gems/rspec-1.2.2/bin/spec spec/spec_helper.rb 
markus/cap_bisect_3.rb --format s
Mocha deprecation warning: Mocha::Standalone has been renamed to Mocha::API

the include function
- should add a relationship between the 'included' class and our class
- should find a file with an all lowercase name given a mixed case name (FAILED 
- 1)

1)
Puppet::ParseError in 'the include function should find a file with an all 
lowercase name given a mixed case name'
Could not find class IncludedClass
/home/markus/projects/puppet/puppet/lib/puppet/util/errors.rb:51:in `fail'
/home/markus/projects/puppet/puppet/spec/../lib/puppet/parser/functions/include.rb:24:in
 `function_include'
./markus/cap_bisect_3.rb:51:
./markus/cap_bisect_3.rb:38:in `with_file'
./markus/cap_bisect_3.rb:50:
/home/markus/projects/puppet/puppet/spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in
 `run'
/home/markus/projects/puppet/puppet/spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in
 `each'
/home/markus/projects/puppet/puppet/spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in
 `run'

Finished in 0.016872 seconds

2 examples, 1 failure
cddc365e9bac786c7a64240073b69bc54b6d2f2e is first bad commit
commit cddc365e9bac786c7a64240073b69bc54b6d2f2e
Author: Luke Kanies <[email protected]>
Date:   Thu Jun 4 00:33:25 2009 -0500

    Switching to LoadedCode from ASTSet

    I also took the opportunity to clean up and simplify
    the interface to the parts of the parser that interact
    with this.  Mostly it was method renames.

    Signed-off-by: Luke Kanies <[email protected]>

:040000 040000 5f47b6ed311713589107a98672955e5c5421f0d5 
01e8b65b6f74bbeb6c516da9bb18a4c6c2a72a1a M      lib
:040000 040000 b00af153d439bed373a8df11ef94d07cf523f4c3 
229d9eb26b0d77246a01596ac401105ed27947b6 M      spec
:040000 040000 40e5c40b3eccd9176a49d7d325e2d30e30d0c397 
244acded118948abaaa8dcb460b2286c21221095 M      test
bisect run success




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to