Skip to content

Validate XML comments in test sources during builds #499

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

Merged
merged 1 commit into from
Jul 9, 2018
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
13 changes: 13 additions & 0 deletions test/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
<Project>
<Import Project="..\Directory.Build.props" />

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

<!--
Don't warn about missing documentation in test projects.

CS1573: Parameter 'parameter' has no matching param tag in the XML comment for 'parameter' (but other parameters do)
CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
CS1712: Type parameter 'parameter' has no matching typeparam tag in the XML comment on 'Type_or_Member' (but other type parameters do)
-->
<NoWarn>$(NoWarn),1573,1591,1712</NoWarn>
</PropertyGroup>

<PropertyGroup>
<VSTestLogger>trx</VSTestLogger>
<VSTestResultsDirectory>$(OutputPath)</VSTestResultsDirectory>
Expand Down
2 changes: 1 addition & 1 deletion test/Microsoft.ML.TestFramework/CopyAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private static void CopyAll(string sourcePath, string destinationPath)
/// <summary>
/// Since test folder doesn't have libraries from AutoLoad folder and Win libraries,
/// we copy them for each test (only newest one).
// This allow execute tests locally.
/// This allow execute tests locally.
/// </summary>
public static void Execute()
{
Expand Down
21 changes: 10 additions & 11 deletions test/Microsoft.ML.TestFramework/TestCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,18 @@
using Xunit.Abstractions;
using Xunit.Sdk;

/// <summary>
/// This is a replacement for the MSTest [TestCategoryAttribute] on xunit
/// xunit does not have the concept of Category for tests and instead, the have [TraitAttribute(string key, string value)]
/// If we replace the MSTest [TestCategoryAttribute] for the [Trait("Category", "BVT")], we will surely fall at some time in cases
/// where people will typo on the "Category" key part of the Trait.
/// On order to achieve the same behaviour as on MSTest, a custom [TestCategory] was created
/// to mimic the MSTest one and avoid replace it on every existent test.
/// The tests can be filtered by xunit runners by usage of "-trait" on the command line with the expresion like
/// <code>-trait "Category=BVT"</code> for example that will only run the tests with [TestCategory("BVT")] on it.
/// </summary>

namespace Xunit
{
/// <summary>
/// This is a replacement for the MSTest [TestCategoryAttribute] on xunit
/// xunit does not have the concept of Category for tests and instead, the have [TraitAttribute(string key, string value)]
/// If we replace the MSTest [TestCategoryAttribute] for the [Trait("Category", "BVT")], we will surely fall at some time in cases
/// where people will typo on the "Category" key part of the Trait.
/// On order to achieve the same behaviour as on MSTest, a custom [TestCategory] was created
/// to mimic the MSTest one and avoid replace it on every existent test.
/// The tests can be filtered by xunit runners by usage of "-trait" on the command line with the expresion like
/// <code>-trait "Category=BVT"</code> for example that will only run the tests with [TestCategory("BVT")] on it.
/// </summary>
[TraitDiscoverer("CategoryDiscoverer", "TestExtensions")]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
public class TestCategoryAttribute : Attribute, ITraitAttribute
Expand Down
5 changes: 3 additions & 2 deletions test/Microsoft.ML.TestFramework/TestCommandBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.IO;
using System.Linq;
using Microsoft.ML.Runtime;
using Microsoft.ML.Runtime.Command;
using Microsoft.ML.Runtime.Data;
using Microsoft.ML.Runtime.EntryPoints;
using Microsoft.ML.Runtime.Internal.Utilities;
Expand Down Expand Up @@ -308,7 +309,7 @@ protected bool TestCore(RunContextBase ctx, string cmdName, string args, params
/// </summary>
/// <param name="env">The environment to use.</param>
/// <param name="writer">
/// The writer to print the <see cref="ProgressLogLine"/>. Usually this should be the same writer that is used in <paramref name="env"/>.
/// The writer to print the <see cref="BaseTestBaseline.ProgressLogLine"/>. Usually this should be the same writer that is used in <paramref name="env"/>.
/// </param>
/// <param name="args">The arguments for MAML.</param>
/// <param name="printProgress">Whether to print the progress summary. If true, progress summary will appear in the end of baseline output file.</param>
Expand Down Expand Up @@ -591,7 +592,7 @@ protected OutputPath FoldModelPath(int fold)

/// <summary>
/// Creates an output path with a suffix based on the test name. For new tests please
/// do not use this, but instead utilize the <see cref="RunContextBase.InitPath"/>
/// do not use this, but instead utilize the <see cref="TestCommandBase.RunContextBase.InitPath"/>
/// method.
/// </summary>
protected OutputPath CreateOutputPath(string suffix)
Expand Down