Skip to content

[doc] Add special case for unsupported test #78858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 25, 2024
Merged

Conversation

hiraditya
Copy link
Collaborator

That helps disable the test for all the targets

@llvmbot
Copy link
Member

llvmbot commented Jan 20, 2024

@llvm/pr-subscribers-testing-tools

Author: AdityaK (hiraditya)

Changes

That helps disable the test for all the targets


Full diff: https://github.com/llvm/llvm-project/pull/78858.diff

1 Files Affected:

  • (modified) llvm/docs/TestingGuide.rst (+2-1)
diff --git a/llvm/docs/TestingGuide.rst b/llvm/docs/TestingGuide.rst
index a692e301fa2c41..802cb8d2e6db04 100644
--- a/llvm/docs/TestingGuide.rst
+++ b/llvm/docs/TestingGuide.rst
@@ -568,7 +568,8 @@ list of boolean expressions. The values in each expression may be:
 | ``UNSUPPORTED`` disables the test if any expression is true.
 | ``XFAIL`` expects the test to fail if any expression is true.
 
-As a special case, ``XFAIL: *`` is expected to fail everywhere.
+As a special case, ``XFAIL: *`` is expected to fail everywhere. Similarly,
+``UNSUPPORTED: target={{.*}}`` will disable the test everywhere.
 
 .. code-block:: llvm
 

@hiraditya hiraditya requested a review from compnerd January 20, 2024 20:23
Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestion to improve the docs further.

@@ -568,7 +568,8 @@ list of boolean expressions. The values in each expression may be:
| ``UNSUPPORTED`` disables the test if any expression is true.
| ``XFAIL`` expects the test to fail if any expression is true.

As a special case, ``XFAIL: *`` is expected to fail everywhere.
As a special case, ``XFAIL: *`` is expected to fail everywhere. Similarly,
``UNSUPPORTED: target={{.*}}`` will disable the test everywhere.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be a good idea to expand on this a bit and explain that XFAIL runs the test but expects it to fail, where as UNSUPPORTED will skip the test entirely so you would never know if the state changes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coincidentally, this is documented exactly as you mentioned in https://github.com/llvm/llvm-project/blob/main/llvm/docs/TestingGuide.rst?plain=1#L596

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure UNSUPPORTED: target={{.*}} is really a "special case": it's just a natural consequence of the use of a regex with the target= method. XFAIL: * on the other hand IS a special case, because it isn't a regex.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it is however useful to disable the test in all cases. lmk if you think this is still an interesting thing to document.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jh7370 I agree with you, but I guess I didn't read it as "this is also a special case", but rather as "this is another way to do this". I think that having the pointer to the fact that this is not great is important since we don't want to encourage people to disable tests I think.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we rephrase this as: "To mark a test expected failing or unsupported for all cases, use XFAIL: * or UNSUPPORTED: target={{.}} as appropriate" or something to that effect (most importantly, simply drop the "as a special case" bit)?

I've definitely seen a use-case downstream for marking something as UNSUPPORTED for all cases: if a test from upstream has come down and is flaky (so doesn't pass/fail consistently and thus XFAIL won't work), it's important to mark it as such whilst it gets reported upstream, so that our continuous merge process doesn't get blocked.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that suggestion @jh7370

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've definitely seen a use-case downstream for marking something as UNSUPPORTED for all cases

Same. it took me a bit to find this trick with UNSUPPORTED.

Copy link
Collaborator

@jh7370 jh7370 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add [doc] to the start of the commit title, please? The way the title is currently it makes it look like there's some functional change to the testing infrastructure in this patch.

@@ -568,7 +568,8 @@ list of boolean expressions. The values in each expression may be:
| ``UNSUPPORTED`` disables the test if any expression is true.
| ``XFAIL`` expects the test to fail if any expression is true.

As a special case, ``XFAIL: *`` is expected to fail everywhere.
As a special case, ``XFAIL: *`` is expected to fail everywhere. Similarly,
``UNSUPPORTED: target={{.*}}`` will disable the test everywhere.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure UNSUPPORTED: target={{.*}} is really a "special case": it's just a natural consequence of the use of a regex with the target= method. XFAIL: * on the other hand IS a special case, because it isn't a regex.

@hiraditya hiraditya changed the title Add special case for unsupported test [doc] Add special case for unsupported test Jan 22, 2024
That helps disable the test for all the targets
@hiraditya
Copy link
Collaborator Author

Merging it, assuming there are no further suggestions. Let me know if it can be improved further and I can follow up with another PR.

@hiraditya hiraditya merged commit 5377fa7 into llvm:main Jan 25, 2024
@@ -568,7 +568,8 @@ list of boolean expressions. The values in each expression may be:
| ``UNSUPPORTED`` disables the test if any expression is true.
| ``XFAIL`` expects the test to fail if any expression is true.
As a special case, ``XFAIL: *`` is expected to fail everywhere.
Use, ``XFAIL: *`` if the test is expected to fail everywhere. Similarly, use
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: delete the "," after "Use"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants