Skip to content

Test CI job dependency with rspec

Jennifer Li requested to merge jennli-job-dependency-rspec into master

What does this MR do and why?

Test CI job dependency with RSpec.

Previously we have a danger to verify job dependencies on selective jobs. That approach requires the branch to be pushed and MR to be created before it can run. It also doesn't cover a few use cases outlined in #34040 (comment 1979302048).

In this MR, we will leverage rspec to simulate pipeline creation and give us another way of testing job dependencies locally.

Re: #34040

Thanks @splattael for providing the snippets that laid the foundation for this test

How to review this MR

To verify that the test cases are actually useful, I have suggested inline with ideas to break our CI in order to force a spec failures.

steps:

  1. pull this branch locally and alter the CI yaml following the inline suggestion (Or you can come up with your own ideas to break CI)
  2. run the spec
  3. If tests are failing, that means we are covering the right use case .

What to iterate on

  1. The test cases are meant as starters and far from complete. We should revisit all the prior master-brokenci-config and build more test cases to ensure that previous bugs won't occur.
  2. The test is quarantined for now because of performance concerns. We need to prioritize Proposal: run tooling specs in a separate job (#443860) so the spec I added in the MR can run in a different job that will hopefully only run in pipelinetier-1 .
  3. We should consider adding this to lefthook when contributors changing CI config, to encourage early feedback.

Note: it does cover master pipeline, which is important for the first iteration, so we should just merge this asap.

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

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

Edited by Jennifer Li

Merge request reports