Skip to content
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

Ignore live-only tests when in Playback or Record modes #7430

Merged
merged 2 commits into from
Sep 3, 2019

Conversation

heaths
Copy link
Member

@heaths heaths commented Aug 29, 2019

Partially fixes #7416. This is currently only applied to keyvault but would be applied to other services once the design is approved.

This ignores live-only tests when not using live test mode, which then doesn't simply cause live tests (like samples) to fail, potentially even taking some time before they do since they may partially run.

image

As you can see from the screenshot, a reason is given, and "Live" is still emitted as a category. I just made a single attribute to do that all for ease.

@heaths heaths requested a review from pakrym as a code owner August 29, 2019 21:43
/// <summary>
/// Attribute on test assemblies, classes, or methods that run only against live resources.
/// </summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly, AllowMultiple = true, Inherited = true)]
Copy link
Contributor

Choose a reason for hiding this comment

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

AllowMultiple?

Copy link
Member Author

Choose a reason for hiding this comment

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

Originally it wasn't, but since samples are often split across partial classes - both of which were attributed with [Category("Live")] - I did this to be able to attribute both classes as well. It shouldn't hurt anything, though I'm totally willing to disallow multiple and remove it from one class (probably the sync classes, since async is better to use/recommend).

@pakrym
Copy link
Contributor

pakrym commented Aug 30, 2019

LGTM

@heaths heaths requested a review from annelo-msft as a code owner August 30, 2019 18:01
@heaths heaths merged commit 9be3f20 into Azure:master Sep 3, 2019
@heaths heaths deleted the issue7416 branch September 3, 2019 20:40
JoshLove-msft pushed a commit to JoshLove-msft/azure-sdk-for-net that referenced this pull request Sep 10, 2019
Fixes Azure#7416

* Ignore live-only tests when in Playback or Record modes
* Attribute to other live-only tests throughout repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conditionally exclude samples (live-only tests)
3 participants