Skip to content

Commit f7a5526

Browse files
sharwellTomFinley
authored andcommitted
Fix failure to validate XML comments in test sources during builds (#499)
1 parent 828dc22 commit f7a5526

File tree

4 files changed

+27
-14
lines changed

4 files changed

+27
-14
lines changed

test/Directory.Build.props

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
<Project>
22
<Import Project="..\Directory.Build.props" />
33

4+
<PropertyGroup>
5+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
6+
7+
<!--
8+
Don't warn about missing documentation in test projects.
9+
10+
CS1573: Parameter 'parameter' has no matching param tag in the XML comment for 'parameter' (but other parameters do)
11+
CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
12+
CS1712: Type parameter 'parameter' has no matching typeparam tag in the XML comment on 'Type_or_Member' (but other type parameters do)
13+
-->
14+
<NoWarn>$(NoWarn),1573,1591,1712</NoWarn>
15+
</PropertyGroup>
16+
417
<PropertyGroup>
518
<VSTestLogger>trx</VSTestLogger>
619
<VSTestResultsDirectory>$(OutputPath)</VSTestResultsDirectory>

test/Microsoft.ML.TestFramework/CopyAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ private static void CopyAll(string sourcePath, string destinationPath)
3838
/// <summary>
3939
/// Since test folder doesn't have libraries from AutoLoad folder and Win libraries,
4040
/// we copy them for each test (only newest one).
41-
// This allow execute tests locally.
41+
/// This allow execute tests locally.
4242
/// </summary>
4343
public static void Execute()
4444
{

test/Microsoft.ML.TestFramework/TestCategory.cs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,18 @@
88
using Xunit.Abstractions;
99
using Xunit.Sdk;
1010

11-
/// <summary>
12-
/// This is a replacement for the MSTest [TestCategoryAttribute] on xunit
13-
/// xunit does not have the concept of Category for tests and instead, the have [TraitAttribute(string key, string value)]
14-
/// If we replace the MSTest [TestCategoryAttribute] for the [Trait("Category", "BVT")], we will surely fall at some time in cases
15-
/// where people will typo on the "Category" key part of the Trait.
16-
/// On order to achieve the same behaviour as on MSTest, a custom [TestCategory] was created
17-
/// to mimic the MSTest one and avoid replace it on every existent test.
18-
/// The tests can be filtered by xunit runners by usage of "-trait" on the command line with the expresion like
19-
/// <code>-trait "Category=BVT"</code> for example that will only run the tests with [TestCategory("BVT")] on it.
20-
/// </summary>
21-
2211
namespace Xunit
2312
{
13+
/// <summary>
14+
/// This is a replacement for the MSTest [TestCategoryAttribute] on xunit
15+
/// xunit does not have the concept of Category for tests and instead, the have [TraitAttribute(string key, string value)]
16+
/// If we replace the MSTest [TestCategoryAttribute] for the [Trait("Category", "BVT")], we will surely fall at some time in cases
17+
/// where people will typo on the "Category" key part of the Trait.
18+
/// On order to achieve the same behaviour as on MSTest, a custom [TestCategory] was created
19+
/// to mimic the MSTest one and avoid replace it on every existent test.
20+
/// The tests can be filtered by xunit runners by usage of "-trait" on the command line with the expresion like
21+
/// <code>-trait "Category=BVT"</code> for example that will only run the tests with [TestCategory("BVT")] on it.
22+
/// </summary>
2423
[TraitDiscoverer("CategoryDiscoverer", "TestExtensions")]
2524
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
2625
public class TestCategoryAttribute : Attribute, ITraitAttribute

test/Microsoft.ML.TestFramework/TestCommandBase.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.IO;
88
using System.Linq;
99
using Microsoft.ML.Runtime;
10+
using Microsoft.ML.Runtime.Command;
1011
using Microsoft.ML.Runtime.Data;
1112
using Microsoft.ML.Runtime.EntryPoints;
1213
using Microsoft.ML.Runtime.Internal.Utilities;
@@ -308,7 +309,7 @@ protected bool TestCore(RunContextBase ctx, string cmdName, string args, params
308309
/// </summary>
309310
/// <param name="env">The environment to use.</param>
310311
/// <param name="writer">
311-
/// The writer to print the <see cref="ProgressLogLine"/>. Usually this should be the same writer that is used in <paramref name="env"/>.
312+
/// The writer to print the <see cref="BaseTestBaseline.ProgressLogLine"/>. Usually this should be the same writer that is used in <paramref name="env"/>.
312313
/// </param>
313314
/// <param name="args">The arguments for MAML.</param>
314315
/// <param name="printProgress">Whether to print the progress summary. If true, progress summary will appear in the end of baseline output file.</param>
@@ -591,7 +592,7 @@ protected OutputPath FoldModelPath(int fold)
591592

592593
/// <summary>
593594
/// Creates an output path with a suffix based on the test name. For new tests please
594-
/// do not use this, but instead utilize the <see cref="RunContextBase.InitPath"/>
595+
/// do not use this, but instead utilize the <see cref="TestCommandBase.RunContextBase.InitPath"/>
595596
/// method.
596597
/// </summary>
597598
protected OutputPath CreateOutputPath(string suffix)

0 commit comments

Comments
 (0)