Skip to content

Commit

Permalink
fix warnings and meissa runner - MacOS problem resizing the console
Browse files Browse the repository at this point in the history
  • Loading branch information
angelovstanton committed Oct 12, 2018
1 parent d6c32f6 commit 44164d1
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 43 deletions.
5 changes: 1 addition & 4 deletions Meissa.API/Controllers/TestCaseRunController.cs
Expand Up @@ -30,10 +30,7 @@ public class TestCaseRunsController : Controller
{
private readonly IBackgroundTaskQueue _backgroundTaskQueue;

public TestCaseRunsController(IBackgroundTaskQueue backgroundTaskQueue)
{
_backgroundTaskQueue = backgroundTaskQueue;
}
public TestCaseRunsController(IBackgroundTaskQueue backgroundTaskQueue) => _backgroundTaskQueue = backgroundTaskQueue;

[HttpDelete]
public async Task<IActionResult> DeleteOlderTestCasesHistoryAsync()
Expand Down
12 changes: 2 additions & 10 deletions Meissa.API/Services/BackgroundTaskQueue.cs
Expand Up @@ -13,8 +13,6 @@
// <site>https://bellatrix.solutions/</site>
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
Expand All @@ -26,17 +24,11 @@ public class BackgroundTaskQueue : IBackgroundTaskQueue
private ConcurrentQueue<Func<CancellationToken, Task>> _workItems = new ConcurrentQueue<Func<CancellationToken, Task>>();
private SemaphoreSlim _signal = new SemaphoreSlim(0);
private readonly IServiceProvider _serviceProvider;
public BackgroundTaskQueue(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
}
public BackgroundTaskQueue(IServiceProvider serviceProvider) => _serviceProvider = serviceProvider;

public IServiceProvider ServiceProvider { get; set; }

public IServiceScope CreateScope()
{
return _serviceProvider.CreateScope();
}
public IServiceScope CreateScope() => _serviceProvider.CreateScope();

public void QueueBackgroundWorkItem(Func<CancellationToken, Task> workItem)
{
Expand Down
2 changes: 0 additions & 2 deletions Meissa.API/Services/IBackgroundTaskQueue.cs
Expand Up @@ -12,8 +12,6 @@
// <author>Anton Angelov</author>
// <site>https://bellatrix.solutions/</site>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
Expand Down
2 changes: 0 additions & 2 deletions Meissa.API/Services/QueuedHostedService.cs
Expand Up @@ -12,8 +12,6 @@
// <author>Anton Angelov</author>
// <site>https://bellatrix.solutions/</site>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
Expand Down
4 changes: 1 addition & 3 deletions Meissa.Core.Services/TestsCountsBasedDistributeService.cs
Expand Up @@ -70,9 +70,7 @@ public List<List<TestCase>> GenerateDistributionTestCasesLists(int testAgentsCou
}

private static bool ShouldResetTestsPerList(bool sameMachineByClass, string currentClass, string previousClass)
{
return sameMachineByClass ? previousClass != currentClass : true;
}
=> sameMachineByClass ? previousClass != currentClass : true;

public List<string> GenerateDistributionLists(int testAgentsCount, bool sameMachineByClass, List<TestCase> testCasesToBeDistributed)
{
Expand Down
4 changes: 1 addition & 3 deletions Meissa.Core.Services/TestsTimesBasedDistributeService.cs
Expand Up @@ -132,9 +132,7 @@ public async Task<List<string>> GenerateDistributionListsAsync(int testAgentsCou
}

private static bool ShouldResetTestsPerList(bool sameMachineByClass, string currentClass, string previousClass)
{
return sameMachineByClass ? previousClass != currentClass : true;
}
=> sameMachineByClass ? previousClass != currentClass : true;

private List<TestCase> GetTestCasesFromExecutedTestCases(List<ExecutedTestCase> executedTestCases)
{
Expand Down
4 changes: 1 addition & 3 deletions Meissa.Plugins.MSTest/NativeTestsRunnerPluginService.cs
Expand Up @@ -243,9 +243,7 @@ public List<List<TestCase>> SplitTestCases(int availableCores, bool sameMachineB
}

private bool ShouldResetTestsPerList(bool sameMachineByClass, string currentClass, string previousClass)
{
return sameMachineByClass ? previousClass != currentClass : true;
}
=> sameMachineByClass ? previousClass != currentClass : true;

public List<TestCase>[] SplitTestCases(List<TestCase> testCases, int availableCores)
{
Expand Down
Expand Up @@ -11,11 +11,10 @@
// </copyright>
// <author>Anton Angelov</author>
// <site>https://bellatrix.solutions/</site>
using System;

using System.Collections.Generic;
using System.Composition;
using System.Linq;
using System.Reflection;
using Meissa.Core.Model;
using Meissa.Plugins.Contracts;
using Mono.Cecil;
Expand Down
4 changes: 1 addition & 3 deletions Meissa.Plugins.NUnit/NativeTestsRunnerPluginService.cs
Expand Up @@ -383,9 +383,7 @@ public void ExecutePostRunActions()
}

private bool ShouldResetTestsPerList(bool sameMachineByClass, string currentClass, string previousClass)
{
return sameMachineByClass ? previousClass != currentClass : true;
}
=> sameMachineByClass ? previousClass != currentClass : true;

private List<testrunTestsuiteTestsuiteTestsuiteTestcase> GetAllExecutedTestCases(testrun testRun)
{
Expand Down
Expand Up @@ -11,12 +11,9 @@
// </copyright>
// <author>Anton Angelov</author>
// <site>https://bellatrix.solutions/</site>
using System;
using System.Collections.Generic;
using System.Composition;
using System.Globalization;
using System.Linq;
using System.Reflection;
using Meissa.Core.Model;
using Meissa.Plugins.Contracts;
using Mono.Cecil;
Expand Down
5 changes: 1 addition & 4 deletions Meissa.Plugins.Protractor/Model/Failure .cs
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
using System.Xml.Serialization;

namespace Meissa.Plugins.Protractor.Model
{
Expand Down
5 changes: 2 additions & 3 deletions Meissa.Plugins.Protractor/NativeTestsRunnerPluginService.cs
Expand Up @@ -337,9 +337,7 @@ public object GetTestResultsForTestRun(List<TestAgentRunDto> testAgentRuns)
}

private bool ShouldResetTestsPerList(bool sameMachineByClass, string currentClass, string previousClass)
{
return sameMachineByClass ? previousClass != currentClass : true;
}
=> sameMachineByClass ? previousClass != currentClass : true;

private void MergeTestSuites(List<Testsuite> mergedTestSuites, List<Testsuite> testSuites)
{
Expand Down Expand Up @@ -420,6 +418,7 @@ public string ReplaceItNamesWithFocused(string input, Regex regex, string groupN
return regex.Replace(input, m => ReplaceNamedGroupItName(groupName, replacement, m, testNamesToBeChanged));
}

// ReSharper disable once UnusedParameter.Local
private List<Testcase> GetAllNativePassedTestCases(List<Testsuite> testSuites, bool shouldBePassed)
{
var passedTestCases = new List<Testcase>();
Expand Down
6 changes: 5 additions & 1 deletion Meissa/Program.cs
Expand Up @@ -15,6 +15,7 @@
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using CommandLine;
Expand Down Expand Up @@ -54,7 +55,10 @@ public static void Main(string[] args)
Console.ForegroundColor = ConsoleColor.White;
Console.Clear();
Console.Title = "Meissa Distributed Test Runner- Bellatrix Test Automation Framework";
Console.WindowHeight = 30;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Console.WindowHeight = 30;
}
}
catch (IOException)
{
Expand Down

0 comments on commit 44164d1

Please sign in to comment.