Skip to content

Refactor contract tests to make it easier to infer contract locations

Richard Chong requested to merge g380899-refactor-names into master

What does this MR do and why?

This is the part 2 MR spun out from !103696 (comment 1182044887).

This refactors the contract tests to improve the consistency which will allow us to easily figure out the contract's file location or url based on the file paths, consumer names, and provider names.

This MR changes the following:

  1. Updates all consumer name to use plural (for example, MergeRequests#show instead of MergeRequest#show)
  2. Updates the subfolders to use the plural form (for example, specs/project/pipelines instead of specs/project/pipeline)
  3. Updates the contract location to match the new plural subfolder naming scheme.
  4. Updates the pact_helpers to match the provider name.
  5. Updates the provider names to keep capitalizations consistent.
  6. Introduces script to determine the Pact Broker url and the local contract path based on the pact_helper file path.

Related: #380899 (closed)

Screenshots or screen recordings

With this change, I reuploaded the contracts and reverified them as well.

image

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 Richard Chong

Merge request reports

Loading