* Update dependencies

* Improve stability of ClassCleanup
This commit is contained in:
Gabe Stocco 2023-01-13 17:51:18 -08:00 коммит произвёл GitHub
Родитель 908ee752f1
Коммит d39172e72f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
10 изменённых файлов: 80 добавлений и 40 удалений

Просмотреть файл

@ -66,7 +66,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="DotLiquid" Version="2.2.663" />
<PackageReference Include="DotLiquid" Version="2.2.677" />
<PackageReference Include="Sarif.Sdk" Version="3.1.0" />
<PackageReference Include="Serilog" Version="2.12.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0" />

Просмотреть файл

@ -30,13 +30,13 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="gstocco.YamlDotNet.YamlPath" Version="1.0.10" />
<PackageReference Include="gstocco.YamlDotNet.YamlPath" Version="1.0.12" />
<PackageReference Include="JsonCons.JsonPath" Version="1.1.0" />
<PackageReference Include="Microsoft.CST.OAT" Version="1.2.39" />
<PackageReference Include="Microsoft.CST.RecursiveExtractor" Version="1.1.20" />
<PackageReference Include="Microsoft.CST.OAT" Version="1.2.42" />
<PackageReference Include="Microsoft.CST.RecursiveExtractor" Version="1.2.8" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="YamlDotNet" Version="12.2.0" />
<PackageReference Include="YamlDotNet" Version="12.3.1" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -18,9 +18,9 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0" />
<PackageReference Include="System.Reflection" Version="4.3.0" />
<PackageReference Include="System.Runtime.Extensions" Version="4.3.1" />

Просмотреть файл

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
@ -331,7 +332,14 @@ windows
[ClassCleanup]
public static void CleanUp()
{
Directory.Delete(TestHelpers.GetPath(TestHelpers.AppPath.testOutput), true);
try
{
Directory.Delete(TestHelpers.GetPath(TestHelpers.AppPath.testOutput), true);
}
catch (Exception e)
{
Console.Error.WriteLine(e.Message);
}
}
[DataTestMethod]

Просмотреть файл

@ -1,4 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using Microsoft.ApplicationInspector.Commands;
using Microsoft.ApplicationInspector.Common;
@ -109,7 +110,14 @@ public class TestExportTagsCmd
[ClassCleanup]
public static void CleanUp()
{
Directory.Delete(TestHelpers.GetPath(TestHelpers.AppPath.testOutput), true);
try
{
Directory.Delete(TestHelpers.GetPath(TestHelpers.AppPath.testOutput), true);
}
catch (Exception e)
{
Console.Error.WriteLine(e.Message);
}
}
[TestMethod]

Просмотреть файл

@ -107,7 +107,14 @@ windows
[ClassCleanup]
public static void CleanUp()
{
Directory.Delete(TestHelpers.GetPath(TestHelpers.AppPath.testOutput), true);
try
{
Directory.Delete(TestHelpers.GetPath(TestHelpers.AppPath.testOutput), true);
}
catch (Exception e)
{
Console.Error.WriteLine(e.Message);
}
}
[DataRow(TagTestType.Equality, TagDiffResult.ExitCode.TestPassed)]

Просмотреть файл

@ -1,5 +1,7 @@
using System.Diagnostics.CodeAnalysis;
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using CommandLine;
using Microsoft.ApplicationInspector.Commands;
using Microsoft.ApplicationInspector.Common;
using Microsoft.ApplicationInspector.Logging;
@ -20,7 +22,7 @@ public class TestVerifyRulesCmd
private readonly string _invalidFileRegexes = @"[
{
""name"": ""Platform: Microsoft Windows"",
""id"": ""AI_TEST_WINDOWS"",
""id"": ""AI_TEST_WINDOWS_INVALID_REGEX"",
""description"": ""This rule checks for the string 'windows'"",
""tags"": [
""Test.Tags.Windows""
@ -44,7 +46,7 @@ public class TestVerifyRulesCmd
private readonly string _invalidJsonValidRule = @"
{
""name"": ""Platform: Microsoft Windows"",
""id"": ""AI_TEST_WINDOWS"",
""id"": ""AI_TEST_WINDOWS_INVALID_JSON"",
""description"": ""This rule checks for the string 'windows'"",
""tags"": [
""Test.Tags.Windows""
@ -66,7 +68,7 @@ public class TestVerifyRulesCmd
private readonly string _knownLanguages = @"[
{
""name"": ""Platform: Microsoft Windows"",
""id"": ""AI_TEST_WINDOWS"",
""id"": ""AI_TEST_WINDOWS_INVALID_LANGAUGE"",
""description"": ""This rule checks for the string 'windows'"",
""tags"": [
""Test.Tags.Windows""
@ -90,7 +92,7 @@ public class TestVerifyRulesCmd
private readonly string _mustMatchRule = @"[
{
""name"": ""Platform: Microsoft Windows"",
""id"": ""AI_TEST_WINDOWS"",
""id"": ""AI_TEST_WINDOWS_MUST_MATCH"",
""description"": ""This rule checks for the string 'windows'"",
""tags"": [
""Test.Tags.Windows""
@ -115,7 +117,7 @@ public class TestVerifyRulesCmd
private readonly string _mustMatchRuleFail = @"[
{
""name"": ""Platform: Microsoft Windows"",
""id"": ""AI_TEST_WINDOWS"",
""id"": ""AI_TEST_WINDOWS_MUST_MATCH_FAIL"",
""description"": ""This rule checks for the string 'windows'"",
""tags"": [
""Test.Tags.Windows""
@ -140,7 +142,7 @@ public class TestVerifyRulesCmd
private readonly string _mustNotMatchRule = @"[
{
""name"": ""Platform: Microsoft Windows"",
""id"": ""AI_TEST_WINDOWS"",
""id"": ""AI_TEST_WINDOWS_MUST_NOT_MATCH"",
""description"": ""This rule checks for the string 'windows'"",
""tags"": [
""Test.Tags.Windows""
@ -165,7 +167,7 @@ public class TestVerifyRulesCmd
private readonly string _mustNotMatchRuleFail = @"[
{
""name"": ""Platform: Microsoft Windows"",
""id"": ""AI_TEST_WINDOWS"",
""id"": ""AI_TEST_WINDOWS_MUST_NOT_MATCH_FAIL"",
""description"": ""This rule checks for the string 'windows'"",
""tags"": [
""Test.Tags.Windows""
@ -190,7 +192,7 @@ public class TestVerifyRulesCmd
private readonly string _sameId = @"[
{
""name"": ""Platform: Microsoft Windows"",
""id"": ""AI_TEST_WINDOWS"",
""id"": ""AI_TEST_WINDOWS_SAME_ID"",
""description"": ""This rule checks for the string 'windows'"",
""tags"": [
""Test.Tags.Windows""
@ -209,7 +211,7 @@ public class TestVerifyRulesCmd
},
{
""name"": ""Platform: Linux"",
""id"": ""AI_TEST_WINDOWS"",
""id"": ""AI_TEST_WINDOWS_SAME_ID"",
""description"": ""This rule checks for the string 'linux'"",
""tags"": [
""Test.Tags.Linux""
@ -305,7 +307,14 @@ public class TestVerifyRulesCmd
[ClassCleanup]
public static void CleanUp()
{
Directory.Delete(TestHelpers.GetPath(TestHelpers.AppPath.testOutput), true);
try
{
Directory.Delete(TestHelpers.GetPath(TestHelpers.AppPath.testOutput), true);
}
catch (Exception e)
{
Console.Error.WriteLine(e.Message);
}
}
/// <summary>
@ -334,7 +343,7 @@ public class TestVerifyRulesCmd
[TestMethod]
public void UnclosedJson()
{
var path = Path.GetTempFileName();
var path = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
File.WriteAllText(path, _invalidJsonValidRule);
VerifyRulesOptions options = new()
{
@ -363,7 +372,7 @@ public class TestVerifyRulesCmd
[TestMethod]
public void DuplicateId()
{
var path = Path.GetTempFileName();
var path = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
File.WriteAllText(path, _sameId);
VerifyRulesOptions options = new()
{
@ -379,7 +388,7 @@ public class TestVerifyRulesCmd
[TestMethod]
public void DuplicateIdCheckDisabled()
{
var path = Path.GetTempFileName();
var path = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
File.WriteAllText(path, _sameId);
VerifyRulesOptions options = new()
{
@ -396,7 +405,7 @@ public class TestVerifyRulesCmd
[TestMethod]
public void InvalidRegex()
{
var path = Path.GetTempFileName();
var path = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
File.WriteAllText(path, _invalidFileRegexes);
VerifyRulesOptions options = new()
{
@ -412,7 +421,7 @@ public class TestVerifyRulesCmd
[TestMethod]
public void UnknownLanguage()
{
var path = Path.GetTempFileName();
var path = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
File.WriteAllText(path, _knownLanguages);
VerifyRulesOptions options = new()
{
@ -428,7 +437,7 @@ public class TestVerifyRulesCmd
[TestMethod]
public void MustMatch()
{
var path = Path.GetTempFileName();
var path = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
File.WriteAllText(path, _mustMatchRule);
VerifyRulesOptions options = new()
{
@ -444,7 +453,7 @@ public class TestVerifyRulesCmd
[TestMethod]
public void MustMatchDetectIncorrect()
{
var path = Path.GetTempFileName();
var path = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
File.WriteAllText(path, _mustMatchRuleFail);
VerifyRulesOptions options = new()
{
@ -460,7 +469,7 @@ public class TestVerifyRulesCmd
[TestMethod]
public void MustNotMatch()
{
var path = Path.GetTempFileName();
var path = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
File.WriteAllText(path, _mustNotMatchRule);
VerifyRulesOptions options = new()
{
@ -476,7 +485,7 @@ public class TestVerifyRulesCmd
[TestMethod]
public void MustNotMatchDetectIncorrect()
{
var path = Path.GetTempFileName();
var path = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
File.WriteAllText(path, _mustNotMatchRuleFail);
VerifyRulesOptions options = new()
{

Просмотреть файл

@ -1,4 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using Microsoft.ApplicationInspector.Logging;
using Microsoft.Extensions.Logging;
@ -63,7 +64,14 @@ public class LanguagesTests
[ClassCleanup]
public static void CleanUp()
{
Directory.Delete(TestHelpers.GetPath(TestHelpers.AppPath.testOutput), true);
try
{
Directory.Delete(TestHelpers.GetPath(TestHelpers.AppPath.testOutput), true);
}
catch (Exception e)
{
Console.Error.WriteLine(e.Message);
}
}
[TestMethod]

Просмотреть файл

@ -52,10 +52,10 @@
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="DotLiquid" Version="2.2.663" />
<PackageReference Include="DotLiquid" Version="2.2.677" />
<PackageReference Include="Glob" Version="1.1.9" />
<PackageReference Include="Microsoft.CST.OAT" Version="1.2.39" />
<PackageReference Include="Microsoft.CST.RecursiveExtractor" Version="1.1.20" />
<PackageReference Include="Microsoft.CST.OAT" Version="1.2.42" />
<PackageReference Include="Microsoft.CST.RecursiveExtractor" Version="1.2.8" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="ShellProgressBar" Version="5.2.0" />

Просмотреть файл

@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.2" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.2" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.4" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.4" />
</ItemGroup>
<ItemGroup>