Skip to content

Commit

Permalink
Supporting specifying test run frequency (Azure#12454)
Browse files Browse the repository at this point in the history
* Add RunFrequencyAttribute to support live test run frequency

* remove workaround file sdk/core/service.projects
  • Loading branch information
erich-wang authored Jun 9, 2020
1 parent ad4f1e1 commit d0d803f
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 12 deletions.
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)]
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.

0 comments on commit d0d803f

Please sign in to comment.