Skip to content

Use meta programming to make testing remote development code easier

What does this MR do and why?

Issue: [Spike] Use meta programming to make testing RO... (#461456)

This spike is based on ideas discussed in Allow arity -1 in ROP to improve testability (!151574) specifically this thread !151574 (comment 1889597066)+

This change aims to improve testing experience by forcing all ROP chain classes to have a single entry method. This is done by adding a custom rubocop rule to warn against having more than one public ROP chain method

This change targets only the create module in the remote development lib. If changes are accepted we could apply to other modules.

What I could not get working from discussion:

  • Rubocop file in the root of the remote-development lib directory.

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.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

To validate new cop locally:

  1. add another public method to a class in the create module of the remote_development lib
  2. run rubocop and see warning raised

Numbered steps to set up and validate the change are strongly suggested.

Edited by Safwan Ahmed

Merge request reports