• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

joaoopereira / dotnet-test-rerun / 19913494610

04 Dec 2025 12:30AM UTC coverage: 96.178%. First build
19913494610

Pull #288

github

João Octávio Pereira
chore(release): 4.0.0-alpha.0
Pull Request #288: v4 alpha release

160 of 178 branches covered (89.89%)

Branch coverage included in aggregate %.

135 of 146 new or added lines in 6 files covered. (92.47%)

620 of 633 relevant lines covered (97.95%)

352.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

50.0
/src/Program.cs
1
using System.CommandLine;
2
using System.CommandLine.Invocation;
3
using System.IO.Abstractions;
4
using System.Reflection;
5
using dotnet.test.rerun.Analyzers;
6
using dotnet.test.rerun.DotNetRunner;
7
using dotnet.test.rerun.Logging;
8
using dotnet.test.rerun.RerunCommand;
9
using Microsoft.Extensions.DependencyInjection;
10

11
// Setup Dependency Injection
12
var serviceProvider = new ServiceCollection()
3✔
13
    .AddSingleton<ILogger, Logger>()
3✔
14
    .AddSingleton<RerunCommand>()
3✔
15
    .AddSingleton<RerunCommandConfiguration>()
3✔
16
    .AddSingleton<IDotNetTestRunner, DotNetTestRunner>()
3✔
17
    .AddSingleton<IDotNetCoverageRunner, DotNetCoverageRunner>()
3✔
18
    .AddSingleton<IProcessExecution, ProcessExecution>()
3✔
19
    .AddSingleton<ITestResultsAnalyzer, TestResultsAnalyzer>()
3✔
20
    .AddSingleton<IFileSystem, FileSystem>()
3✔
21
    .BuildServiceProvider();
3✔
22

23
var Log = serviceProvider.GetRequiredService<ILogger>();
3✔
24
var cmd = serviceProvider.GetService<RerunCommand>();
3✔
25

26
// Parse and invoke with custom exception handling
27
try
28
{
29
    var parseResult = cmd!.Parse(args);
3✔
30
    var result = await parseResult.InvokeAsync();
3✔
31
    Environment.ExitCode = result;
3✔
32
}
3✔
NEW
33
catch (Exception exception)
×
34
{
NEW
35
    if (exception is RerunException
×
NEW
36
        || (exception is TargetInvocationException
×
NEW
37
        && exception.InnerException is RerunException))
×
38
    {
NEW
39
        Log.Error(exception.Message);
×
NEW
40
        Log.Debug(exception.StackTrace ?? string.Empty);
×
41
    }
42
    else
43
    {
NEW
44
        Log.Exception(exception);
×
45
    }
46
    
NEW
47
    Environment.ExitCode = 1;
×
NEW
48
}
×
49

50
return Environment.ExitCode;
3✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc