Skip to content

Use unique package names in QA specs

🔦 Context

During gitlab-com/gl-infra/production#5908 (closed), we discovered that in package QA specs, fixed package names were used.

The problem is that those specs could run concurrently and so the same package name is used twice. This is usually ok because the name of the project (that hosts the package) is unique per spec execution.

Having said that, some package formats, such as NPM, have more restrictions with the root group. Among other things, packages following the naming convention must be unique within a root group.

This is no longer the case if spec can run concurrently. The exact same NPM package can be uploaded to different projects of the same root group = the second upload will be rejected.

This introduce flaky specs that will succeed only if they are not run concurrently.

To solve this issue at hand and any future issues, we opened #345521 (closed) in order to update all packages QA specs to use unique package names. This will ensure that they can be executed concurrently without risking hitting a duplicate restriction.

🔨 What does this MR do and why?

  • Update all QA specs to use unique package names using SecureRandom.hex(8)
    • Some specs needed more rework so that the same package name set by a let var is used.
  • Unquarantine the NPM project level QA specs.
    • They were quarantined because they were flaky. This MR should solve this.

🎥 Screenshots or screen recordings

n / a

🥋 How to set up and validate locally

  1. Follow https://about.gitlab.com/handbook/engineering/development/ops/package/quality/#how-to-run-them-locally
  2. Run the maven scenario:
    $ WEBDRIVER_HEADLESS=false bundle exec bin/qa Test::Instance::All http://172.16.123.1:8000 -- qa/specs/features/browser_ui/5_package/package_registry/npm/npm_project_level_spec.rb --tag orchestrated --tag packages
    • npm/npm_project_level_spec.rb is an example here. You can run any of the specs for the packages registry.

🍅 MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by David Fernandez

Merge request reports