Skip to content

Optest: Allow parametrized names for xfails checks#111797

Closed
NicolasHug wants to merge 3 commits intomainfrom
NicolasHug-patch-1
Closed

Optest: Allow parametrized names for xfails checks#111797
NicolasHug wants to merge 3 commits intomainfrom
NicolasHug-patch-1

Conversation

@NicolasHug
Copy link
Copy Markdown
Member

@NicolasHug NicolasHug commented Oct 23, 2023

CC @zou3519

This is hopefully a fix for https://github.com/pytorch/vision/pull/8058/files#r1368570541. It seems to work for me locally, but maybe there's a more elegant way of handling this?

@NicolasHug NicolasHug requested a review from zou3519 October 23, 2023 12:19
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Oct 23, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/111797

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 73b7739 with merge base 1eb6c43 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

if not actual_test_name.startswith(test):
continue
base_test_name = actual_test_name[len(test) + 2 :]
base_test_name = base_test_name.split("[")[0] # remove potential pytest parametrization suffix
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if there's a way to detect if we're using pytest and apply this only then. If not, then this PR seems fine to me.

Also, the full regex on the two brackets "test_name[.*]" would be more robust.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

a way to detect if we're using pytest

The documented way is to create a global variable on the module that gets set to True in conftest.py. There are other suggested ways on SO, but they may not all apply here.

Is it worth it though? Brackets can't be part of test names anyway, so if there are brackets, they must come from pytest?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Also, the full regex on the two brackets "test_name[.*]" would be more robust.

done!

@NicolasHug
Copy link
Copy Markdown
Member Author

@pytorchmergebot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 24, 2023
@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@NicolasHug NicolasHug deleted the NicolasHug-patch-1 branch October 25, 2023 08:42
xuhancn pushed a commit to xuhancn/pytorch that referenced this pull request Nov 7, 2023
CC @zou3519

This is hopefully a fix for https://github.com/pytorch/vision/pull/8058/files#r1368570541. It seems to work for me locally, but maybe there's a more elegant way of handling this?
Pull Request resolved: pytorch#111797
Approved by: https://github.com/zou3519
Skylion007 pushed a commit to Skylion007/pytorch that referenced this pull request Nov 14, 2023
CC @zou3519

This is hopefully a fix for https://github.com/pytorch/vision/pull/8058/files#r1368570541. It seems to work for me locally, but maybe there's a more elegant way of handling this?
Pull Request resolved: pytorch#111797
Approved by: https://github.com/zou3519
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants