Exit navigation test script early
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.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md. -
Check out this branch. -
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, addindex.html
to entry at line 54: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/940b4e3eb7f385c57e065122187875dfc1d3692b/content/_data/navigation.yaml#L54. -
Run make check-global-navigation
. Note failure. -
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.
-
I have evaluated the MR acceptance checklist for this merge request.
Edited by Kati Paizee