Skip to content

Adjusts total size expectation to be within 0.1 difference

Richard Chong requested to merge g465190-adjust-expected-value into master

What does this MR do and why?

The namespace usage total can sometimes be off by 0.1 due to calculations being based on rounded values while the one displayed in the UI used unrounded ones from the backend. Since the E2E test can only use what is provided in the UI, we couldn't avoid not using the rounded values for calculations so this change updates the expectations for the test and splits it into 2 separate validations.

  1. It relaxes the original validation by only checking that the total size text (ignoring the decimal value) matches the correct whole number and size unit (B, KiB, MiB, or GiB).
  2. It adds an additional validation that checks that the total size displayed and the total size calculated using the rounded values are within a 0.1 difference.

Closes https://gitlab.com/gitlab-org/gitlab/-/issues/465190

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  1. Configure the necessary environment variables to run this against staging.
  2. Run the spec bundle exec rspec qa/specs/features/ee/browser_ui/11_fulfillment/utilization/free_namespace_storage_spec.rb
Edited by Richard Chong

Merge request reports