Commit 32b5bce7 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

RSpec: request and store HGitaly version on configuration object

With this, the HGitaly version will be accessible as
`RSpec.configuration.hgitaly_version`, and mostly used
for conditional skipping, making hooking in Rails and
landing in HGitaly less interdependent, provided new
features in HGitaly come with an appropriate version
change (doesn't have to be pushed to PyPI because the
CI always run HGitaly from the head of the `default` or
`stable` branch).

The simplest syntax to skip RSpec tests is


  if 'does something', skip: boolean_method


but `boolean_method` would have to be a class method, and
would turn out to be executed before `TestEnv`, hence before
HGitaly is started. Therefore the `skip` method will have to
be run from examples (and `before` hooks). The new
`RSpec.configuration` method is a good way to access the version
information. It's not lazy, but it's expected to be negligible
compared to the huge startup time.

branch : heptapod
parent d1704dedec2a
......@@ -198,6 +198,11 @@
# Enable all features by default for testing
# Reset any changes in after hook.
hg_storage = Gitlab::GitalyClient.vcs_qualified_storage('default', 'hg')
config.hgitaly_version =
config.after(:all) do
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