Skip to content

Exit navigation test script early

Evan Read requested to merge eread/exit-navigation-test-script-early into main

What does this MR do and why?

When we added another test for navigation: !3628 (merged), we interrupted the flow of the script so that earlier test could fail, but we could end up with a pass right at the end. This made spotting violations (such as those added in !3783 (merged)) hard because the script wouldn't return an error code.

This MR makes the script bail out as soon as there's an error. That means we can do what we like to RETURN_CODE later in the script because we can assume earlier tests have passed.

CC @axil @kpaizee @jglassman1

How to set up and validate locally

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

  1. Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md.
  2. Check out this branch.
  3. Open content/_data/navigation.yaml and add an entry that breaks the rule at: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/940b4e3eb7f385c57e065122187875dfc1d3692b/content/_data/navigation.yaml#L8. For example, add index.html to entry at line 54: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/940b4e3eb7f385c57e065122187875dfc1d3692b/content/_data/navigation.yaml#L54.
  4. Run make check-global-navigation. Note failure.
  5. Reverse change to entry made earlier and run make check-global-navigation. Note success.

Merge request 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 Kati Paizee

Merge request reports