Commit 3095483e authored by Robert Speicher's avatar Robert Speicher

Speed up the "Project Network Graph" cucumber feature

This change involves stubbing out the call to `Grit::Commit.find_all`
and limiting the number of commits to 10 vs. the standard of 650 used by
`Gitlab::GraphCommit.to_graph`.

Prior to this change, this single feature required almost 3 minutes of
running time and over 2 GB of memory on my machine. Now it takes less
than 3 seconds.
parent 3784f134
......@@ -8,5 +8,3 @@ Feature: Project Network Graph
Scenario: I should see project network
Then page should have network graph
......@@ -57,6 +57,11 @@ end
Given /^I visit project "(.*?)" network page$/ do |arg1|
project = Project.find_by_name(arg1)
# Stub out find_all to speed this up (10 commits vs. 650)
commits = Grit::Commit.find_all(project.repo, nil, {max_count: 10})
Grit::Commit.stub(:find_all).and_return(commits)
visit graph_project_path(project)
end
......@@ -67,8 +72,9 @@ end
Given /^page should have network graph$/ do
page.should have_content "Project Network Graph"
within ".graph" do
page.should have_content "stable"
page.should have_content "notes_refacto..."
page.should have_content "master"
page.should have_content "github"
page.should have_content "scss_refactor..."
end
end
......
......@@ -44,3 +44,5 @@ require 'headless'
headless = Headless.new
headless.start
require 'cucumber/rspec/doubles'
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment