Closed maxlazio closed 12 years ago
The order of commands from README.md doesn't make any sense. Working with this:
gem install bundler
git clone https://github.com/gitlabhq/gitlab-vagrant-vm
cd gitlab-vagrant-vm
bundle install
librarian-chef install
Nothing happens after this librarian-chef install ? => Thats because on Vagrant install from the .deb file I needed to add a proper path. Easier to install vagrant via gem.
gem install vagrant
vagrant up
The host class is reporting that NFS is not supported by this host,
or `nfsd` may not be installed. Please verify that `nfsd` is installed
on your machine, and retry.
Solved with
sudo apt-get install nfs-common
Vagrant is now provisioning a box.
[vagrant] Preparing to edit /etc/exports. Administrator privileges will be required...
sudo: /etc/init.d/nfs-kernel-server: command not found
****
Mounting NFS shared folders failed. This is most often caused by the NFS
client software not being installed on the guest machine. Please verify
that the NFS client software is properly installed, and consult any resources
specific to the linux distro you're using for more information on how to
do this.
vagrant ssh sudo apt-get install nfs-kernel-server vagrant halt vagrant up
Error persists.
Looks like this is a known problem with vagrant: https://github.com/mitchellh/vagrant/issues/1149 This also didn't help: http://stackoverflow.com/questions/9697976/nfs-fails-after-packaging-a-vagrant-box "Fixed" by setting :nfs => false : https://github.com/gitlabhq/gitlabhq/issues/1498#issuecomment-9060044
Setting up vagrant box is in a branch: vagrant_vm_setup https://github.com/dosire/gitlab-vagrant-vm/tree/vagrant_vm_setup
b3592a9cf2b75ae954e03b273235ee3625de45c1
When I run vagrant up I get the following notification:
[default] Importing base box 'precise32'...
[default] The guest additions on this VM do not match the install version of
VirtualBox! This may cause things such as forwarded ports, shared
folders, and more to not work properly. If any of those things fail on
this machine, please update the guest additions and repackage the
box.
Guest Additions Version: 4.2.0
VirtualBox Version: 4.1.16
Maybe upgrade virtual box to the newest version?
When done run bundle exec rake gitlab:test
Seems work is being done on a continuous integration app https://twitter.com/dzaporozhets/status/255985298884919296/photo/1/large
Sytse after a clean install without any errors:
Error summary:
Failures (4)
Project Browse commits :: I browse commit from list :: Then I see commit info
Project Browse commits :: I compare refs :: Then I see compared refs
Project Browse files :: I browse file content :: Then I should see it content
Project Browse files :: I browse raw file :: Then I should see raw file content
Steps Summary: (624) Successful, (0) Undefined, (0) Pending, (4) Failed, (0) Error
git checkout v2.9.1
don't forget to bundle install
git checkout v2.9.1 => all green (397) Successful, (0) Undefined, (0) Pending, (0) Failed, (0) Error
on my vagrant
Confirming that on v2.9.1 all spinach and rspec tests are green.
Tests that are failing on master branch:
Failures (3)
Project Browse commits :: I browse commit from list :: Then I see commit info
Project Browse commits :: I compare refs :: Then I see compared refs
Project Browse files :: I browse raw file :: Then I should see raw file content
When running single tests that are failures:
Added @bug-1 line 13 of feature/project/source/commits.feature and ran: spinach --tags @bug-1
Scenario: I browse commit from list
✔ Given I sign in as a user # features/steps/shared/authentication.rb:7
✔ And I own a project # features/steps/shared/project.rb:5
✔ And I visit my project's commits page# features/steps/shared/paths.rb:100
✔ Given I click on commit link # features/steps/project/project_browse_commits.rb:25
✔ Then I see commit info # features/steps/project/project_browse_commits.rb:29
Scenario: I compare refs
✔ Given I sign in as a user # features/steps/shared/authentication.rb:7
✔ And I own a project # features/steps/shared/project.rb:5
✔ And I visit my project's commits page # features/steps/shared/paths.rb:100
✔ Given I visit compare refs page # features/steps/shared/paths.rb:145
✔ And I fill compare fields with refs # features/steps/project/project_browse_commits.rb:34
✔ Then I see compared refs # features/steps/project/project_browse_commits.rb:40
Added @bug-1 to line 17 of feature/project/source/browse_files.feature and ran: spinach --tags @bug-1
Scenario: I browse raw file
✔ Given I sign in as a user # features/steps/shared/authentication.rb:7
✔ And I own project "Shop" # features/steps/shared/project.rb:11
✔ Given I visit project source page # features/steps/shared/paths.rb:157
✔ Given I visit blob file from repo # features/steps/shared/paths.rb:161
✔ And I click link "raw" # features/steps/project/project_browse_files.rb:27
✔ Then I should see raw file content # features/steps/project/project_browse_files.rb:31
They pass individually.
Running bisect from v2.9.1 to master yielded the following:
git bisect log
git bisect start
# bad: [dda852a0d5c9e684b82cf20380d2b26da1798ecb] Merge pull request #1629 from riyad/show-notes- indicator-for-commits-and-merge-requests
git bisect bad dda852a0d5c9e684b82cf20380d2b26da1798ecb
# good: [a6f58b9c435e1680f102ae68a8aedea981a52486] Up to v2.9.1
git bisect good a6f58b9c435e1680f102ae68a8aedea981a52486
# bad: [9cabe04368024f44881e4269a008156f1629ab86] tests for: Profile -> History
git bisect bad 9cabe04368024f44881e4269a008156f1629ab86
# bad: [c058e3903e01b950d19fe8ce86702f24083c8395] Finalize new routes
git bisect bad c058e3903e01b950d19fe8ce86702f24083c8395
# good: [0261b0c64c9df0a1a6834fa4f31395989244c2a9] Project activity inifinite scroll paging
git bisect good 0261b0c64c9df0a1a6834fa4f31395989244c2a9
# bad: [79a02df92e18137787371468be5c8897ad2f97b0] Update usages of tree_file_project_ref_path to project_tree_path
git bisect bad 79a02df92e18137787371468be5c8897ad2f97b0
# good: [bde5088525512643434ab88b491c0ba9ad6e248b] Add routing specs for new routes
git bisect good bde5088525512643434ab88b491c0ba9ad6e248b
# bad: [6ddb35bd5e27829609e40b8dd87313a01fb6f293] Move tree-related views from refs to trees
git bisect bad 6ddb35bd5e27829609e40b8dd87313a01fb6f293
# good: [b389247c029b21f5e85abb5896d2cf22230c9cb1] Use Commit#show instead of Commits#show to view a single commit
git bisect good b389247c029b21f5e85abb5896d2cf22230c9cb1
# good: [567767bcf2af2c330c46fde820101fcf847e852f] Add ref_extractor helper module for upcoming controllers
git bisect good 567767bcf2af2c330c46fde820101fcf847e852f
Bisect final output:
git bisect good
6ddb35bd5e27829609e40b8dd87313a01fb6f293 is the first bad commit
commit 6ddb35bd5e27829609e40b8dd87313a01fb6f293
Author: Robert Speicher <rspeicher@gmail.com>
Date: Mon Sep 17 10:57:13 2012 -0400
Move tree-related views from refs to trees
:040000 040000 4b58c6f9d92d475de1eaf056340edd64ae7047e3 8f3fa0e37c587e0c85e63e5bccfe682a9ec09f7f M app
Write to mailing list, consider mentioning:
Written to the mailinglist, other people have the same problems: https://groups.google.com/forum/?fromgroups=#!topic/gitlabhq/xspT4oEVoIY
@maxlazio Maybe you can test which part of the bisected commit causes the problems?
Started with:
git checkout 6ddb35bd5e27829609e40b8dd87313a01fb6f293
To make sure that this commit is to blame I listed the log and checked out one previous commit:
git checkout 567767bcf2af2c330c46fde820101fcf847e852f
Running the tests there. => Spinach tests are passing but rspec tests are failing(not focusing on that right now).
Renaming back all files to their original names before 6ddb35bd5e27829609e40b8dd87313a01fb6f293 made no change. Removing the new file created in that commit also made no change. The tests are still failing. Checking out the previous commit again produced green tests.
Removed all changes in 6ddb35bd5e27829609e40b8dd87313a01fb6f293. => Tests fail again.
Untracked files are not included in the diff until they are add to commit either with git add . or git add -N . ( http://stackoverflow.com/questions/855767/can-i-use-git-diff-on-untracked-files)
After this the diff showed no difference between the two commits and the tests are passing.
Started from the previous commit(567767bcf2af2c330c46fde820101fcf847e852f) state where everything is working. Then move files and rename them like in the failing commit ( 6ddb35bd5e27829609e40b8dd87313a01fb6f293 ).
Renamed tree.js.haml and tree.html.haml to show.js.haml/show.html.haml and moved them both to app/views/tree/, diff between the 2 commits is shown in this gist: https://gist.github.com/b66f8999843dec4e971d and the test are failing again.
app/views/refs/tree.js.haml -> app/views/tree/show.js.haml, tests pass. app/views/refs/tree.html.haml -> app/views/tree/show.html.haml, test fail.
=> show.html.haml is the culprit.
Commented out tree partial call: #tree-holder= render partial: "tree", locals: {repo: @repo, commit: @commit, tree: @tree} => test fail
Commented out everything but the partial call => Tests fail.
Now moved the tree partial to the app/view/tree and uncommented the line in show.html.haml => tests fail Since there is nothing else in show.html.haml file started on _tree.html.haml
In _tree.html.haml commented out
= render partial: "refs/tree_file", locals: { name: tree.name, content: tree.data, file: tree } (line 13) => Tests fail
Commenting out: render "head" made no difference, tests are passing.
Actually if all files are the same and show.html.haml is moved to the refs dir, doesn't that show that it is nothing wrong with the files themselves but the way they are called?
Starting from the things we know:
Try going back from the smallest file possible and comment things out of that file.
_submodule_item.html.haml file: commented out everything => tests pass.
_tree_commit.html.haml
commented out everything => tests pass.
_tree_item.html.haml commented out everything =>
Project Browse files :: I browse file content :: Given I click on "Gemfile" file in repo
Project Browse git repo :: I blame file :: Given I click on "Gemfile" file in repo
leave in:
%strong= link_to truncate(content.name, length: 40), tree_file_project_ref_path
=> tests pass
_tree_file.html.haml
Cannot comment out everything because tests fail from missing links.
Comment out:
name.force_encoding('utf-8') (line 5) => Tests pass. markdown(file.data) (line 15) => Tests pass. raw GitHub::Markup.render(name, file.data) (line 18) => Tests pass. raw file.colorize(options: { linenos: 'True'})
Project Browse files :: I browse file content :: Then I should see it content
_tree.html.haml
Comment out:
@project.name(line 5) => Tests pass.
render partial: "refs/tree_file", locals: { name: tree.name, content: tree.data, file: tree } (line 13) => Test fail because of the missing links
Project Browse files :: I browse raw file :: And I click link "raw"
Project Browse git repo :: I blame file :: And I click blame button
content.name (line 44) => Tests pass. markdown(content.data) (line 48) => Tests pass. raw GitHub::Markup.render(content.name, content.data) => Tests pass. commented out the javascript => Tests pass.
Running all tests first => Tests fail. Running only commits.feature => Tests pass. Running only branches.feature => Tests pass. Running all tests after => Tests fail =>
Project Browse files :: I browse files from master branch :: Given I visit project source page
Project Browse files :: I browse files for specific ref :: Given I visit project source page
Project Browse files :: I browse file content :: Given I visit project source page
Project Browse files :: I browse raw file :: Given I visit project source page
Project Browse git repo :: I blame file :: Given I visit project source page
Running tests on last know good commit( 567767bcf2af2c330c46fde820101fcf847e852f ) after the tests failed => Tests pass.
Copied the app/views/tree/show.html.haml file to app/views/refs/tree.html.haml , test fail with:
https://gist.github.com/44a04040d1b03f546c9c
In feature/project/source/browse_file.feature on line 1 add: @browse, save the changes. Run the tests with
spinach --tags @browse
Now they fail even when I run only one feature.
tree.html.haml shouldn't be called at all since on the 6ddb35bd5e27829609e40b8dd87313a01fb6f293 it doesn't exist anymore.
6 comments in 2 hours, nice :zap:
Commented out everything in the tree.html.haml file. => The tests are failing with: https://gist.github.com/960cf68c642742c98299
Start raising inside of the file.
= raise "#{ controller.controller_name}".inspect
and the answer is
"refs"
and the action that calls this view is "tree".
Added render 'tree/show' to https://github.com/gitlabhq/gitlabhq/blob/6ddb35bd5e27829609e40b8dd87313a01fb6f293/app/controllers/refs_controller.rb#L47
and the raise is not being triggered anymore.
Tests are still failing but now in show.html.haml in tree.
In show.html.haml partials are still calling the old path.
How is it possible that the tests were passing with this?
Why were only we affected with this?
Fixed that and now I get a green feature.
Run all the tests to see if this makes any difference. => All tests are now passing(!?)
https://github.com/dosire/gitlabhq/commit/d04e004bca617a3868cbb2562d4d4f09addcd365
Go to master, pull. => Done. Run all tests. => All tests failing
Mysql2::Error: Unknown column 'group_id' in 'field list': SELECT group_id FROM `projects` INNER JOIN `users_projects` ON `projects`.`id` = `users_projects`.`project_id` WHERE `users_projects`.`user_id` = 1
Clean the tmp and seed again. => For RAILS_ENV=test makes no change.
If they fail again try to fix the way it was fixed in HEAD state. Run tests again.
Travis tests https://travis-ci.org/#!/gitlabhq/gitlabhq/
6ddb35bd5e27829609e40b8dd87313a01fb6f293
https://github.com/gitlabhq/gitlabhq/blob/6ddb35bd5e27829609e40b8dd87313a01fb6f293
Build of last commit of the pull request https://travis-ci.org/#!/gitlabhq/gitlabhq/builds/2575238
vagrant@precise32:/vagrant/gitlabhq$ RAILS_ENV=test rake db:migrate
== PostgresCreateIntegerCast: migrating ======================================
-- execute(" CREATE CAST (integer AS text) WITH INOUT AS IMPLICIT;\n")
== PostgresCreateIntegerCast: migrated (0.0059s) =============================
RAILS_ENV=test rake db:migrate
git diff
diff --git a/db/schema.rb b/db/schema.rb index ec4729c..00838ad 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ #
-ActiveRecord::Schema.define(:version => 20121002151033) do +ActiveRecord::Schema.define(:version => 20121009205010) do
create_table "events", :force => true do |t| t.string "target_type" @@ -116,7 +116,6 @@ ActiveRecord::Schema.define(:version => 20121002151033) do t.boolean "wall_enabled", :default => true, :null => false t.boolean "merge_requests_enabled", :default => true, :null => false t.boolean "wiki_enabled", :default => true, :null => false
t.integer "group_id" end
create_table "protected_branches", :force => true do |t|
vagrant@precise32:/vagrant/gitlabhq$ git diff
diff --git a/db/schema.rb b/db/schema.rb
index ec4729c..a703781 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20121002151033) do
+ActiveRecord::Schema.define(:version => 20121009205010) do
create_table "events", :force => true do |t|
t.string "target_type"
git remote set-url origin git://github.com/dosire/gitlabhq.git
I made a PR for the Postgres issue https://github.com/gitlabhq/gitlab-vagrant-vm/pull/6
In master problems described in comment https://github.com/dosire/gitlab-vagrant-vm/issues/1#issuecomment-9591486 do not exist anymore but the tests are failing with our original problem(https://github.com/dosire/gitlab-vagrant-vm/issues/1#issuecomment-9303445) .
However, now I can get failing tests with running one feature.
On consecutive runs of one feature test results vary, they fail and they pass.
Continued from https://github.com/dosire/gitlabhq/issues/55