Move test projects from src/ to tests/ (#11357)

* Update gitignore

* Move csproj

* Update project references

* Update solutions

* Update build scripts

* Tests used to share editorconfig with projects in src

* Fix broken tests.

* Stop copying around .editorconfig

merged root one with linting

* csharp_style_expression_bodied -> suggestion

* Move StyleCop rulesets to matching directories and update shared build properties

* Remove legacy build files, update NuGet.cofig and solution files

* Restore myget source

* Clean up .gitignore

* Update .gitignore

* Move new test classes to tests after merge

* Gitignore + nuget config

* Move new test

Co-authored-by: Ronald Barendse <ronald@barend.se>
This commit is contained in:
Paul Johnson
2021-10-18 08:14:04 +01:00
committed by GitHub
parent c005673a96
commit 00133e880d
752 changed files with 650 additions and 1844 deletions

View File

@@ -0,0 +1,34 @@
using System;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Jobs;
using Perfolizer.Horology;
namespace Umbraco.Tests.Benchmarks.Config
{
/// <summary>
/// Configures the benchmark to run with less warmup and a shorter iteration time than the standard benchmark.
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class QuickRunConfigAttribute : Attribute, IConfigSource
{
/// <summary>
/// Initializes a new instance of the <see cref="QuickRunConfigAttribute"/> class.
/// </summary>
public QuickRunConfigAttribute()
{
this.Config = (ManualConfig)ManualConfig.CreateEmpty()
.With(Job.Default.WithLaunchCount(1) // benchmark process will be launched only once
.WithIterationTime(new TimeInterval(100, TimeUnit.Millisecond)) // 100ms per iteration
.WithWarmupCount(3) // 3 warmup iteration
.WithIterationCount(3)); // 3 target iteration
}
/// <summary>
/// Gets the manual configuration.
/// </summary>
protected ManualConfig Config { get; }
/// <inheritdoc/>
IConfig IConfigSource.Config => this.Config;
}
}

View File

@@ -0,0 +1,20 @@
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
namespace Umbraco.Tests.Benchmarks.Config
{
/// <summary>
/// Configures the benchmark to run with less warmup and a shorter iteration time than the standard benchmark,
/// and include memory usage diagnosis.
/// </summary>
public class QuickRunWithMemoryDiagnoserConfigAttribute : QuickRunConfigAttribute
{
/// <summary>
/// Initializes a new instance of the <see cref="QuickRunWithMemoryDiagnoserConfigAttribute"/> class.
/// </summary>
public QuickRunWithMemoryDiagnoserConfigAttribute()
{
Config.Add(MemoryDiagnoser.Default);
}
}
}