[DOCS-13406] Add guide for conditional logic in Synthetic tests#34792
Open
git-thuerk-done wants to merge 6 commits intomasterfrom
Open
[DOCS-13406] Add guide for conditional logic in Synthetic tests#34792git-thuerk-done wants to merge 6 commits intomasterfrom
git-thuerk-done wants to merge 6 commits intomasterfrom
Conversation
Contributor
Preview links (active after the
|
domalessi
reviewed
Mar 2, 2026
Co-authored-by: domalessi <111786334+domalessi@users.noreply.github.com>
domalessi
reviewed
Mar 2, 2026
Contributor
domalessi
left a comment
There was a problem hiding this comment.
Left some comments and suggestions! Hit me up if you have Qs, and let me know when this is ready for another look :)
|
|
||
| 1. Add a subtest at the end of your test that contains only the cleanup or teardown steps. | ||
| 2. In the subtest's advanced options, enable **Always run this step**. | ||
| 3. Save the test. The cleanup subtest runs even when earlier steps have failed. |
Contributor
There was a problem hiding this comment.
Does the "always run this step" apply even if we have "If this step succeeds, stop this test and mark it as passed" earlier up in the chain?
Contributor
Author
There was a problem hiding this comment.
Yes for this we want to capture the error and continue directly to step X from the step where it failed (i.e. in this pattern we don't want the "If this step succeeds, stop this test and mark it as passed" condition). hope that makes sense!
Co-authored-by: domalessi <111786334+domalessi@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do? What is the motivation?
This stems from many support tickets and feature requests from customers requesting more information on conditional branching.
Fixes DOCS-13406
Adds a new guide covering how to implement conditional logic in Synthetic tests using subtests and step execution options. The guide addresses a documentation gap around the existing step execution options (allowFailure, exitIfSucceed,
alwaysExecute), which are available in the product but hard to discover and understand.
The guide covers three patterns for Browser, Multistep API, and Mobile App tests:
Merge instructions
Merge readiness:
For Datadog employees:
Your branch name MUST follow the
<name>/<description>convention and include the forward slash (/). Without this format, your pull request will not pass CI, the GitLab pipeline will not run, and you won't get a branch preview. Getting a branch preview makes it easier for us to check any issues with your PR, such as broken links.If your branch doesn't follow this format, rename it or create a new branch and PR.
[6/5/2025] Merge queue has been disabled on the documentation repo. If you have write access to the repo, the PR has been reviewed by a Documentation team member, and all of the required checks have passed, you can use the Squash and Merge button to merge the PR. If you don't have write access, or you need help, reach out in the #documentation channel in Slack.
Additional notes