Skip to content

Commit

Permalink
Added built-in launch artifacts extension (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
nvborisenko authored Oct 16, 2024
1 parent 5ba2dea commit 166f510
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions src/ReportPortal.GaugePlugin/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@

namespace ReportPortal.GaugePlugin
{

class Program
{
private static ITraceLogger TraceLogger;
private static ITraceLogger TraceLogger { get; set; }

public static CancellationTokenSource ShutDownCancelationSource = new();
public static CancellationTokenSource ShutDownCancellationSource { get; } = new();

[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(Observers.FileResultsObserver))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(Shared.Extensibility.Embedded.Analytics.AnalyticsReportEventsObserver))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(Shared.Extensibility.Embedded.Normalization.RequestNormalizer))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(Shared.Extensibility.Embedded.LaunchArtifacts.LaunchArtifactsEventsObserver))]
static async Task Main(string[] args)
{
var gaugeProjectRoot = Environment.GetEnvironmentVariable("GAUGE_PROJECT_ROOT") ?? Environment.CurrentDirectory;
var gaugeProjectRoot = Environment.GetEnvironmentVariable("GAUGE_PROJECT_ROOT");
Environment.CurrentDirectory = gaugeProjectRoot;
var gaugeLogsDir = Environment.GetEnvironmentVariable("logs_directory") ?? "";

var internalTraceLogginDir = Path.Combine(gaugeProjectRoot, gaugeLogsDir);
Expand All @@ -36,12 +37,11 @@ static async Task Main(string[] args)
TraceLogger.Verbose($"{envVariableKey}: {envVariables[envVariableKey]}");
}

using (var host = CreateHostBuilder(args).Build())
{
await host.StartAsync();
using var host = CreateHostBuilder(args).Build();

await host.WaitForShutdownAsync(ShutDownCancelationSource.Token);
}
await host.StartAsync();

await host.WaitForShutdownAsync(ShutDownCancellationSource.Token);
}

public static IHostBuilder CreateHostBuilder(string[] args) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</PackageReference>
<PackageReference Include="Google.Protobuf" Version="3.25.2" />
<PackageReference Include="Grpc.AspNetCore" Version="2.60.0" />
<PackageReference Include="ReportPortal.Shared" Version="3.6.2" />
<PackageReference Include="ReportPortal.Shared" Version="3.9.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public override Task<Empty> Kill(KillProcessRequest request, ServerCallContext c
}
finally
{
Program.ShutDownCancelationSource.Cancel();
Program.ShutDownCancellationSource.Cancel();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public override Task<Empty> Kill(KillProcessRequest request, ServerCallContext c
}
finally
{
Program.ShutDownCancelationSource.Cancel();
Program.ShutDownCancellationSource.Cancel();
}
}
}
Expand Down

0 comments on commit 166f510

Please sign in to comment.