Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix version of test seed branches to specific revisions. Only clone if necessary. #7903

Merged
merged 1 commit into from Nov 5, 2014

Conversation

6 participants
@cirosantilli
Copy link
Contributor

commented Sep 29, 2014

This PR tries to do update-ref on each branch of gitlab-test to fixed versions, and only then fetches. This achieves the following goals:

  • no more need to use the network to run tests. Continuation of and rationale at: #7823 . Running a single test 15s for me, and just cloning gitlab-test takes 6.

  • tests cannot break spuriously on old branches. Before this pull, changes to gitlab-test could break your tests at any time. Not anymore since we use update-ref to determined versions. This is only possible because we have fixed the versions of each branch.

  • makes it easier to develop gitlab-test together with new tests: this PR generates a non bare version of gitlab-test at tmp/test/gitlab-test which you can edit and use with new test cases immediately.

    In order to develop gitlab-test, you must comment out the corresponding branch line from BRANCH_SHA before you are done, since you cannot know the SHA, and after you are done you must update it.

@TeatroIO

This comment has been minimized.

Copy link

commented Sep 29, 2014

I've prepared a stage. Click to open.

raise 'Could not fetch test seed repository.'
else
unless system(*reset)
raise 'The fetched test seed does not contain the required revision.'

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Sep 29, 2014

Line is too long. [83/80]

# Try to reset without fetching to avoid using the network.
reset = %W(git update-ref refs/heads/#{branch} #{sha})
unless system(*reset)
unless system(*%W(git fetch origin))

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Sep 29, 2014

Never use unless with else. Rewrite these with the positive case first.
Do not use %W unless interpolation is needed. If not, use %w.

@cirosantilli cirosantilli force-pushed the cirosantilli:test-seed-reset branch from 2161214 to 3987405 Sep 29, 2014

@cirosantilli cirosantilli changed the title Fix version of test seed branches to specific revisions. Only clone if necessary. [WIP] Fix version of test seed branches to specific revisions. Only clone if necessary. Sep 30, 2014

@cirosantilli cirosantilli force-pushed the cirosantilli:test-seed-reset branch 3 times, most recently from 2092826 to f5641cc Sep 30, 2014

@cirosantilli cirosantilli changed the title [WIP] Fix version of test seed branches to specific revisions. Only clone if necessary. Fix version of test seed branches to specific revisions. Only clone if necessary. Sep 30, 2014

@cirosantilli cirosantilli force-pushed the cirosantilli:test-seed-reset branch from f5641cc to 93ba1a3 Sep 30, 2014

@cirosantilli cirosantilli changed the title Fix version of test seed branches to specific revisions. Only clone if necessary. [WIP] Fix version of test seed branches to specific revisions. Only clone if necessary. Sep 30, 2014

@cirosantilli cirosantilli force-pushed the cirosantilli:test-seed-reset branch from 93ba1a3 to 9567778 Oct 1, 2014

@cirosantilli cirosantilli changed the title [WIP] Fix version of test seed branches to specific revisions. Only clone if necessary. Fix version of test seed branches to specific revisions. Only clone if necessary. Oct 1, 2014

@Razer6

This comment has been minimized.

Copy link
Member

commented Oct 8, 2014

@randx Looks good!

@Razer6 Razer6 added this to the 7.4 milestone Oct 8, 2014

@dzaporozhets dzaporozhets modified the milestones: 7.4, 7.5 Oct 15, 2014

@@ -49,13 +59,32 @@ def setup_factory_repo
clone_url = "https://gitlab.com/gitlab-org/#{factory_repo_name}.git"

unless File.directory?(factory_repo_path)
git_cmd = %W(git clone --bare #{clone_url} #{factory_repo_path})
system(*git_cmd)
system(*%W(git clone #{clone_url} #{factory_repo_path}))

This comment has been minimized.

Copy link
@vsizov

vsizov Nov 5, 2014

Contributor

Why this repository can't be bare anymore?

This comment has been minimized.

Copy link
@cirosantilli

cirosantilli Nov 5, 2014

Author Contributor

There are now 2 factories: one non-bare, which you can edit directly to update gitlab-test for the new tests if needed, and one bare, cloned from that one every time.

vsizov added a commit that referenced this pull request Nov 5, 2014

Merge pull request #7903 from cirosantilli/test-seed-reset
Fix version of test seed branches to specific revisions. Only clone if necessary.

@vsizov vsizov merged commit 70122e4 into gitlabhq:master Nov 5, 2014

1 check passed

default The build passed on Semaphore.
Details
@vsizov

This comment has been minimized.

Copy link
Contributor

commented Nov 5, 2014

thank you @cirosantilli

@cirosantilli cirosantilli deleted the cirosantilli:test-seed-reset branch Nov 5, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.