Skip to content

Resolves confusion within spec rake tasks.

Jeremy Jackson requested to merge cleanup/spec-tasks into master

What does this MR do?

This adjusts and removes some spec rake tasks because they were incorrectly deprecated and may have been inadvertently instructing developers to run the wrong test criteria for certain things. Here forward we'll reference the rake cli and not rails to avoid confusion. This also addresses:

  • removing an unneeded invocation of the gitlab:setup rake task which is currently failing in the test environment.
  • adds a missing "unit" level path for haml_lint specs.
  • fixes the rake and rake spec default tasks.

There were some scenarios that indicated incorrect information:

rake spec:services said that it was deprecated in favor of bin/rspec spec/services but ran rspec spec --tag @services. By removing this deprecated rake task and allowing it to utilize the default rake task as provided by rspec, it works as the deprecation notice would migrate users towards.

Does this MR meet the acceptance criteria?

Thought process

When onboarding my expectation was

  1. get it setup and do a smoke test in development
  2. run rake or rake spec to see if everything else worked

When I did this, I was seeing an error that gitaly couldn't be connected to, which was confusing to me. I eventually tracked it down to the fact that RAILS_ENV=test rake gitlab:setup doesn't work because it attempts to connect to gitaly before starting it. This was the thing that led me down the path of confusion around the rake tasks and spec tagging in general. This will hopefully be more accurate, removes the deprecation warnings, and provides clear documentation when running rake -T.

Conformity

There are no documentation updates required, and this brings things closer to being in line with the existing documentation.

Risks

The main risk here would be that tests are missed locally or on CI. I spent some time making sure this doesn't appear to be the case, but more eyes is always useful.

Merge request reports