Commit Graph

17 Commits

Author SHA1 Message Date
Jacob Vosmaer 008a6a6ce6 Route path lookups through legacy_disk_path 2018-03-21 18:18:32 +01:00
Sean McGivern 10885edf22 Don't use Markdown cache for stubbed settings in specs
The ApplicationSetting model uses the CacheMarkdownField concern, which updates
the cached HTML when the field is updated in the database. However, in specs,
when we want to test conditions using ApplicationSetting, we stub it, because
this is accessed in different ways throughout the application.

This means that if a spec runs that caches one of the Markdown fields, and a
later spec uses `stub_application_setting` to set the raw value of that field,
the cached value was still the original one. We can work around this by ignoring
the Markdown cache in contexts where we're using `stub_application_setting`.

We could be smarter, and only do this on the Markdown fields of the model, but
this is probably fine.
2017-12-15 10:23:11 +00:00
Bob Van Landuyt f1ae1e39ce Move the circuitbreaker check out in a separate process
Moving the check out of the general requests, makes sure we don't have
any slowdown in the regular requests.

To keep the process performing this checks small, the check is still
performed inside a unicorn. But that is called from a process running
on the same server.

Because the checks are now done outside normal request, we can have a
simpler failure strategy:

The check is now performed in the background every
`circuitbreaker_check_interval`. Failures are logged in redis. The
failures are reset when the check succeeds. Per check we will try
`circuitbreaker_access_retries` times within
`circuitbreaker_storage_timeout` seconds.

When the number of failures exceeds
`circuitbreaker_failure_count_threshold`, we will block access to the
storage.

After `failure_reset_time` of no checks, we will clear the stored
failures. This could happen when the process that performs the checks
is not running.
2017-12-08 09:11:39 +01:00
Bob Van Landuyt 0f1d6402b9 Find the LFS-objects for a fork within a the fork network 2017-11-03 14:59:47 +01:00
Bob Van Landuyt 619021fd7a Read circuitbreaker settings from `Gitlab::CurrentSettings`
Instead of from the configuration file
2017-10-17 11:50:32 +02:00
Nick Thomas ba0ebbb510 Allow the git circuit breaker to correctly handle missing repository storages 2017-09-22 10:05:28 +01:00
Bob Van Landuyt ee603a0089 Allow a `failure_wait_time` of 0 for storage access
This allows testing every storage attempt after a failure. Which could
be useful for tests
2017-08-16 14:15:50 +02:00
Bob Van Landuyt 016522dd5f Add a helper to stub storage settings with defaults 2017-08-09 11:56:14 +02:00
Markus Koller d27dec80ce
Support custom directory in gitlab:backup:create task 2017-07-27 13:24:19 +02:00
Lin Jen-Shin 7bd5e57125 Instead of adding master, stub_not_protect_default_branch 2017-07-18 23:48:14 +08:00
Grzegorz Bizon 0430b76441 Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
Maxime Besson 9326d89623
Allow manual bypass of auto_sign_in_with_provider
This commit lets a user bypass the automatic signin on the login form,
in order to login with a technical (admin, etc) account

Closes #3786

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-06-02 20:00:11 +02:00
Rémy Coutable db8a8afc61
Add a new `stub_mattermost_setting` stub helper to properly stub Mattermost settings
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-03-28 14:12:32 +02:00
Douwe Maan ee028d9d60 Rename reply_by_email to incoming_email to prepare for the future. 2015-09-21 10:35:37 +02:00
Douwe Maan 48e25a019a Add stub_reply_by_email_setting helper. 2015-08-20 13:21:22 -07:00
Robert Speicher cf7c57aaf5 Use stub_application_setting in a few more specs
These specs also failed when run by themselves before this change, so
we've likely got some kind of cross-test contamination going on.
2015-07-06 22:39:56 -04:00
Robert Speicher 42b643f057 Fix ApplicationHelper specs
There were several specs that were failing when run by themselves.

- Use the `helper` object, as per RSpec 3 standards
- Use `assign` to assign instance variables that helpers expect
- Add `StubConfiguration` support module
2015-06-30 17:47:53 -04:00