72 Commits
Author SHA1 Message Date
Timothy Andrew eb16e1e3c2 Improve the error message displayed when branch creation fails.
Note: This feature was developed independently on master while this was
in review. I've removed the conflicting bits and left the relevant
additions, mainly a test for `Gitlab::Git::Hook`. The original commit
message follows:

1. `gitlab-shell` outputs errors to `stderr`, but we weren't using this
   information, prior to this commit. Now we capture the `stderr`, and
   display it in the flash message when branch creation fails.

2. This can be used to display better errors for other git operation
   failures with small tweaks.

3. The return value of `Gitlab::Git::Hook#trigger` is changed from a
   simple `true`/`false` to a tuple of `[status, errors]`. All usages
   and tests have been updated to reflect this change.

4. This is only relevant to branch creation _from the Web UI_, since SSH
   and HTTP pushes access `gitlab-shell` either directly or through
   `gitlab-workhorse`.

5. A few minor changes need to be made on the `gitlab-shell` end. Right
   now, the `stderr` message it outputs is prefixed by "GitLab: ", which
   shows up in our flash message. This is better removed.
2016-07-05 11:05:16 +05:30
Alejandro Rodríguez e8a8b0b818 Remove hardcoded gitlab-shell version in test env now that the required tag is published 2016-06-30 11:52:38 -04:00
Alejandro Rodríguez 86359ec854 Refactor repository paths handling to allow multiple git mount points 2016-06-29 22:30:31 -04:00
http://jneen.net/ 66b37149eb support cgi style options, such as erb?parent=json 2016-06-27 14:17:49 -07:00
http://jneen.net/ cd9bea770b fix the spec, using project.change_head 2016-06-27 14:17:49 -07:00
http://jneen.net/ 8d24ca157d Revert "bump the master sha for gitlab-test!9"
This reverts commit b435d7405364d28ec364072f4437512da2876762.
2016-06-27 14:17:49 -07:00
http://jneen.net/ d76a89bf7f bump the master sha for gitlab-test!9 2016-06-27 14:17:49 -07:00
Stan Hu 0fdfd2dd6e Fix Error 500 when viewing a blob with binary characters after the 1024-byte mark
Here was the problem:

1. When determining whether a given blob is viewable text, gitlab_git reads the first 1024 bytes and checks with Linguist whether it is a text or binary file.
2. If the blob is text, GitLab will attempt to display it.
3. However, if the text has binary characters after the first 1024 bytes, then GitLab will attempt to load the entire contents, but the encoding will be ASCII-8BIT since there are binary characters.
4. The Error 500 results when GitLab attempts to display a mix UTF-8 and ASCII-8BIT.

To fix this, we load as much data as we are willing to display so that the detection will work properly. Requires
an update to gitlab_git: gitlab-org/gitlab_git!86

Closes #13826
2016-06-12 07:36:25 -07:00
Stan Hu 7877138958 Fix creation of merge requests for orphaned branches
Closes #14875
2016-04-04 04:51:05 -07:00
Robert Speicher bbe0fa91d0 Prevent transient Capybara timeouts during feature tests
The problem occurred because asset compilation takes a long time, so
when the asset cache didn't exist and the first test ran, it would often
(randomly) time out during the generation before the actual test even
had a chance to run.

Now we check if the cache exists before the suite runs, and if not, we
manually fire a request to the root URL in order to generate it. This
should allow subsequent tests to use the cached assets.
2016-01-28 20:56:49 -05:00
Douwe Maan 51ed5225ad Merge branch 'serve_lfs_object' into 'master'
Serve LFS object

Depends on gitlab-org/gitlab_git!57

See merge request !1976
2015-12-08 14:19:52 +00:00
Marin Jankovski 9bf51ae47d Fix specs caused by update of gitlab-test repo. 2015-12-08 10:58:15 +01:00
Marin Jankovski e53b350cb6 Add specs for showing lfs object in UI. 2015-12-07 15:03:50 +01:00
Douglas Barbosa Alexandre 12fdc13ad3 Fix 500 error when creating a merge request that removes a submodule 2015-12-04 17:35:14 -02:00
Robert Speicher d09d62b6b8 Replace all usages of git command with configurable binary path
Closes #3311
2015-11-03 17:11:09 -05:00
Stan Hu d02d02c672 Fix error preventing displaying of commit data for a directory with a leading dot
Closes https://github.com/gitlabhq/gitlabhq/issues/8763
2015-10-12 22:24:19 -07:00
Dmitriy Zaporozhets 4e4866f255 Refactor pre/post receive commit services into one class 2015-08-14 16:04:17 +02:00
Dmitriy Zaporozhets 9649f9387a Fix tests for web editor 2015-08-14 15:08:31 +02:00
Dmitriy Zaporozhets 9011a32234 Disable pre-receive check in test env
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-14 13:27:51 +02:00
Jacob Vosmaer 05b518aa4d Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into backup-archive-permissions 2015-07-29 15:44:04 +02:00
Jacob Vosmaer 0be6debb0b Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into backup-archive-permissions 2015-07-27 11:22:35 +02:00
Stan Hu 562242cb9d Fix commit data retrieval when branch name has single quotes
Closes #1724
2015-07-26 03:47:01 -07:00
Jacob Vosmaer 39a7e210a3 Use a separate backup test directory and nuke its contents 2015-07-24 18:54:06 +02:00
Stan Hu 643557dabc Fix 404 error in files view after deleting the last file in a repository
Closes #1362
2015-07-21 14:12:43 -07:00
Robert SpeicherandDmitriy Zaporozhets 5a9ede4721 Update mock and stub syntax for specs 2015-06-22 12:13:46 +02:00
Robert Speicher 1c49809bf8 Don't delete gitlab-test-fork folder after every test run 2015-05-02 16:01:33 -04:00
Stan Hu 72a7febead Fix "Revspec not found" errors when viewing diffs in a forked project with submodules
Closes #1413
2015-04-27 20:42:38 -07:00
Robert Speicher 0f1d8e771f Define GIT_TEMPLATE_DIR environment variable in TestEnv
See http://schacon.github.io/git/git-init.html#_template_directory

Without this variable, any global git hooks a developer might have in
~/.git_template would be linked in the `.git/hooks` folder for every
test repository that gets checked out by TestEnv, and would cause
certain specs to fail due to pre-existing hook files.
2015-03-27 22:26:03 -04:00
Robert Speicher 7194810892 TestEnv improvements
- Simplify cleaning the temporary testing path in TestEnv
- Don't run gitlab:shell:install if it's already installed
- Run git commands quietly
2015-02-16 20:36:34 -05:00
Jeroen van Baarsen 0c4a70a306 Updated rspec to rspec 3.x syntax
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-02-12 19:17:35 +01:00
Dmitriy Zaporozhets f31a96104f Add flatten-dir branch to seed repo 2015-01-10 22:48:16 -08:00
Dmitriy Zaporozhets f7bf892cca Revert "gitlab shell works if multiple rubies installed"
This reverts commit 533f4cdf30.
2014-11-18 17:14:36 +02:00
Ciro Santilli 533f4cdf30 gitlab shell works if multiple rubies installed
Before this it would fail because git hooks automatically prepend
things to the path, which can lead the wrong Ruby version to be called
in which dependencies are not installed.

To make sure that this is correct, the forked_merge_requests commented
out test that depends on this change was uncommented.

For that test to pass, it is also necessary to setup the mock server
on port 3001 under test_env.rb.
2014-11-18 11:38:23 +01:00
Ciro Santilli 9567778f94 Fix version of test seed branches. 2014-10-01 08:56:04 +02:00
Ciro Santilli b49dd2c573 Replace testme with gitlab-test. 2014-09-27 10:11:20 +02:00
Ciro Santilli 065ab3e5f3 Only clone GitLab Shell on tests if necessary. 2014-09-22 21:37:52 +02:00
Dmitriy Zaporozhets 394ac378f8 Fix markdown tests. Use new repo for testing. Fixed gitlab-shell test setup
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-07-31 23:05:30 +03:00
Dmitriy Zaporozhets 7783f5ec73 Improve copy test repo cmd
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-07-31 21:30:35 +03:00
Dmitriy Zaporozhets a35a22ae05 Remove test dir only if exists
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-07-31 21:01:42 +03:00
Dmitriy Zaporozhets 61f70334ef Cleanup test dir before install gitlab-shell. Fix fork test scenario
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-07-31 19:35:07 +03:00
Dmitriy Zaporozhets b238b1544c Recreate tmp/tests on each test run 2014-07-31 19:24:53 +03:00
Dmitriy Zaporozhets f82b9e48ec Dont stub gitlab-shell calls. Make test environment closer to real one 2014-07-31 15:39:01 +03:00
Dmitriy Zaporozhets 2d87556847 Remove rails observers from application 2014-06-17 22:51:43 +03:00
Dmitriy Zaporozhets 1bd28994cc Use ProjectWiki instead of GollumWiki in code
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-04-09 14:35:58 +03:00
Dmitriy Zaporozhets 535339a6ab Fix tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-03-25 16:25:59 +02:00
Robert Speicher 760f827ba0 Remove code that does nothing
ping @karlhungus
2014-03-22 15:40:42 -04:00
Robert Speicher 0983438037 TestEnv.reset_satellite_dir should run 'git clean' quietly
Removes the "Removing gitlabhq" messages cluttering spec output
2014-03-13 17:25:55 -04:00
Jacob Vosmaer d6b0ac96f7 Invoke Kernel#system with separate arguments 2014-03-03 08:40:30 +01:00
Jacob Vosmaer b30b9c9c46 Replace shell commands with FileUtils 2014-03-03 08:40:30 +01:00
Dmitriy Zaporozhets 380342784d Fix MR spinach tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-01-23 12:55:43 +02:00