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

Only clone GitLab Shell on tests if necessary. #7823

Merged
merged 1 commit into from
Sep 24, 2014

Conversation

cirosantilli
Copy link
Contributor

Before this change, tmp/test got removed before every time we started running tests, and we had to clone GitLab Shell again.

Now:

  • tmp/test/gitlab-shell is not removed before tests, only the other siblings
  • it only gets cloned if the repo does not exist already
  • if the repo and the correct shell version exist, it only checks out
  • otherwise do a git fetch instead of a clone

Use case: allow to run tests without the Internet (airplane, commuting, internet problems, GitLab.com downtime, etc.)

There is only one more Internet dependency: cloning gitlab-test, but that one is harder to deal with since all branches must be synced.

Still, this change already makes testing a bit faster and walks towards that goal.

Implementation notes:

  • unless File.directory?: removed because was never used because rm_rf always removed tests, and should not be used in theory either, since if the repository is there we might want to fetch.

@TeatroIO
Copy link

I've prepared a stage. Click to open.

unless File.directory?(Gitlab.config.gitlab_shell.path)
%x[rake gitlab:shell:install]
end
%x[rake gitlab:shell:install]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use %x unless the command string contains backquotes.

@dzaporozhets
Copy link
Member

@cirosantilli nice!

dzaporozhets added a commit that referenced this pull request Sep 24, 2014
Only clone GitLab Shell on tests if necessary.
@dzaporozhets dzaporozhets merged commit 28b6f09 into gitlabhq:master Sep 24, 2014
@cirosantilli cirosantilli deleted the test-fetch-shell branch September 24, 2014 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants