Created
October 17, 2012 08:35
-
-
Save georgebrock/3904432 to your computer and use it in GitHub Desktop.
git bisect script for Rails issue 7950
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
date=`git log -n1 --pretty=format:%ai` | |
cd ../activerecord-deprecated_finders | |
git checkout `git rev-list -n1 --before="$date" master` | |
cd ../rails | |
unset AR_DEPRECATED_FINDERS | |
grep active_record_deprecated_finders Gemfile && export AR_DEPRECATED_FINDERS=../activerecord-deprecated_finders | |
export JOURNEY=../journey | |
cd ../journey | |
git checkout `git rev-list -n1 --before="$date" master` | |
cd ../rails | |
bundle check || bundle install || bundle update | |
ruby -Iactiverecord/test activerecord/test/cases/temp_test.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'cases/helper' | |
require 'models/company' | |
class TempTest < ActiveRecord::TestCase | |
def test_included_in_collection_for_new_records | |
client = Client.create(:name => 'Persisted') | |
assert_nil client.client_of | |
# Note the test passes when the bug is present and fails when it is fixed | |
# git bisect is easier to use this way round | |
assert Firm.new.clients_of_firm.include?(client) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From the root directory of the Rails repo | |
cd .. | |
git clone git://github.com/rails/journey.git | |
git clone git://github.com/rails/activerecord-deprecated_finders.git | |
cd rails | |
git checkout `git merge-base origin/master origin/3-2-stable` | |
git bisect start HEAD origin/master | |
git bisect run ./bisecttest.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment