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

Supporting specifying test run frequency #12454

Merged
merged 2 commits into from
Jun 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eng/pipelines/templates/jobs/archetype-sdk-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
- script: >
dotnet test eng/service.proj
--framework $(TestTargetFramework)
--filter "TestCategory!=Manually"
--logger "trx"
--logger:"console;verbosity=normal"
/p:ServiceDirectory=${{ parameters.ServiceDirectory }}
Expand Down
17 changes: 17 additions & 0 deletions sdk/core/Azure.Core.TestFramework/src/RunFrequencyAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using NUnit.Framework;

namespace Azure.Core.TestFramework
{
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
Copy link
Member

Choose a reason for hiding this comment

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

Why AllowMultiple=true? That would imply the condition in your archetype-sdk-tests.yml would not work if a test could have multiple values.

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch, will update it

public class RunFrequencyAttribute : CategoryAttribute
{
public RunFrequencyAttribute(RunTestFrequency frequency)
{
this.categoryName = Enum.GetName(typeof(RunTestFrequency), frequency);
}
}
}
12 changes: 12 additions & 0 deletions sdk/core/Azure.Core.TestFramework/src/RunTestFrequency.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

namespace Azure.Core.TestFramework
{
public enum RunTestFrequency
{
Daily,
Weekly,
Manually
}
}
6 changes: 0 additions & 6 deletions sdk/core/service.projects

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

namespace Azure.Management.KeyVault.Tests
{
[RunFrequency(RunTestFrequency.Manually)]
public class VaultOperationsTests : VaultOperationsTestsBase
{
public VaultOperationsTests(bool isAsync)
Expand Down
6 changes: 0 additions & 6 deletions sdk/keyvault/service.projects

This file was deleted.