Skip to content

Refactor spec using cache, use let

Fabien Catteau requested to merge refactor-spec-cache-reports into master

What does this MR do?

Refactor image spec and shared examples using let, get rid of before(:context), make the code more idiomatic.

Prior to this MR, before(:context) and instance variables are used to cache execution of docker run. In this MR, TestProjectScan.run_with_cache does the caching, and it's possible to use let.

Executions that have a mutate_project proc won't be cache unless the exact same proc is reused. That said, a next step would be to add the test projects to the analyzer project, and get rid of this mutate_project option. See !206 (merged)

  • execution time for source branch: 67 seconds, see job
  • execution time for target branch: 30 seconds, see job

What are the relevant issue numbers?

This somehow relates to gitlab-org/gitlab#299038 (closed) because these specs need to be more generic before they can be reused in job integration tests AKA "QA jobs".

Does this MR meet the acceptance criteria?

Edited by Fabien Catteau

Merge request reports