Skip to content

Commit

Permalink
misc: fix dubious error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
dupdob committed Mar 20, 2024
1 parent 4a2642f commit 45cc7ac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Stryker.Core/Stryker.Core/Mutants/MutationStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void Leave()
}
else if (old.Store.Count > 0)
{
Logger.LogError("Some mutations failed to be inserted, they are dropped.");
Logger.LogDebug($"{old.Store.Count} mutation(s) could not be injected, they are dropped.");
foreach (var mutant in old.Store)
{
mutant.ResultStatus = MutantStatus.CompileError;
Expand Down Expand Up @@ -128,7 +128,7 @@ public bool StoreMutationsAtDesiredLevel(IEnumerable<Mutant> store, MutationCont
controller.StoreMutations(store);
return true;
}
Logger.LogError($"There is no structure to control {store.Count()} mutations. They are dropped.");
Logger.LogDebug($"There is no structure to control {0} mutations. They are dropped.", store.Count());
foreach (var mutant in store)
{
mutant.ResultStatus = MutantStatus.CompileError;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ private bool ConvertSingleResult(TestResult testResult, ISet<Guid> seenTestCases
var (key, value) = testResult.GetProperties().FirstOrDefault(x => x.Key.Id == CoverageCollector.PropertyName);
var testCaseId = testResult.TestCase.Id;
var unexpected = false;
var log = testResult.GetProperties().FirstOrDefault(x => x.Key.Id == CoverageCollector.Coveragelog).Value?.ToString();
var log = testResult.GetProperties().FirstOrDefault(x => x.Key.Id == CoverageCollector.CoverageLog).Value?.ToString();
if (!string.IsNullOrEmpty(log))
{
_logger.LogError($"VsTestRunner: Coverage collector error: {log}.");
_logger.LogDebug("VsTestRunner: Coverage collector log: {0}.", log);
}

if (!Context.VsTests.ContainsKey(testCaseId))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class CoverageCollector : InProcDataCollection

public const string PropertyName = "Stryker.Coverage";
public const string OutOfTestsPropertyName = "Stryker.Coverage.OutOfTests";
public const string Coveragelog = "CoverageLog";
public const string CoverageLog = "CoverageLog";

public string MutantList => string.Join(",", _mutantTestedBy.Values.Distinct());

Expand Down Expand Up @@ -245,7 +245,7 @@ private void PublishCoverageData(DataCollectionContext dataCollectionContext)
_dataSink.SendData(dataCollectionContext, PropertyName, ";");
if (!_reportFailure)
{
_dataSink.SendData(dataCollectionContext, Coveragelog, $"Did not find type {_controlClassName}. This indicates Stryker failed to copy the mutated assembly for test.");
_dataSink.SendData(dataCollectionContext, CoverageLog, $"Did not find type {_controlClassName}. Mutated assembly may not be covered by any test.");
_reportFailure = true;
}
return;
Expand Down

0 comments on commit 45cc7ac

Please sign in to comment.