From f7ea32f9e49fea9509514368db74d74bcfca9938 Mon Sep 17 00:00:00 2001 From: BugDiver Date: Wed, 18 Nov 2020 12:50:58 +0530 Subject: [PATCH 1/3] Add proper log level for gRPC logger. Signed-off-by: BugDiver --- src/ExecutableRunnerServiceHandler.cs | 1 - src/GaugeListener.cs | 21 +++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/ExecutableRunnerServiceHandler.cs b/src/ExecutableRunnerServiceHandler.cs index 0b938e7..830d519 100644 --- a/src/ExecutableRunnerServiceHandler.cs +++ b/src/ExecutableRunnerServiceHandler.cs @@ -115,7 +115,6 @@ public override Task StartStepExecution(StepExecutionSt private void InitializeExecutionMessageHandlers() { - Console.WriteLine("InitializeExecutionMessageHandlers"); var tableFormatter = new TableFormatter(this._assemblyLoader, this._activatorWrapper); var classInstanceManager = new ThreadLocal(() => { diff --git a/src/GaugeListener.cs b/src/GaugeListener.cs index dba0e4b..b08082d 100644 --- a/src/GaugeListener.cs +++ b/src/GaugeListener.cs @@ -36,16 +36,20 @@ public virtual void ConfigureServices(IServiceCollection services) var assemblyPath = new AssemblyLocater(new DirectoryWrapper()).GetTestAssembly(); Logger.Debug($"Loading assembly from : {assemblyPath}"); services.AddGrpc(); - services.AddLogging(logConfig => { - if (Utils.TryReadEnvValue("GAUGE_LOG_LEVEL") == "DEBUG") + services.AddLogging(logConfig => + { + logConfig.SetMinimumLevel(LogLevel.Error); + var logLevel = Utils.TryReadEnvValue("GAUGE_LOG_LEVEL"); + if (logLevel != null && logLevel.ToUpper() == "DEBUG") { - logConfig.AddFilter("Microsoft", LogLevel.None); + logConfig.SetMinimumLevel(LogLevel.Debug); } }); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(new ExecutorPool(GetNoOfStreams(), IsMultithreading())); - services.AddSingleton((sp) => { + services.AddSingleton((sp) => + { var isDaemon = string.Compare(Environment.GetEnvironmentVariable("IS_DAEMON"), "true", true) == 0; return isDaemon ? new LockFreeGaugeLoadContext(assemblyPath) : new GaugeLoadContext(assemblyPath); }); @@ -56,7 +60,7 @@ public virtual void ConfigureServices(IServiceCollection services) services.AddSingleton(); services.AddSingleton(s => s.GetRequiredService().GetStepRegistry()); - if(Configuration.GetValue("ReflectionScanAssemblies") == "True") + if (Configuration.GetValue("ReflectionScanAssemblies") == "True") { Logger.Debug("Using ExecutableRunnerServiceHandler"); services.AddSingleton(); @@ -71,14 +75,15 @@ public virtual void ConfigureServices(IServiceCollection services) public virtual void Configure(IApplicationBuilder app, IHostApplicationLifetime lifetime) { app.UseRouting(); - lifetime.ApplicationStarted.Register(() => { + lifetime.ApplicationStarted.Register(() => + { var ports = app.ServerFeatures .Get().Addresses .Select(x => new Uri(x).Port).Distinct(); - foreach(var port in ports) + foreach (var port in ports) { Console.WriteLine($"Listening on port:{port}"); - } + } }); app.UseEndpoints(endpoints => From 7c6ad9966e52422055924ee508b67b362b91ca56 Mon Sep 17 00:00:00 2001 From: BugDiver Date: Wed, 18 Nov 2020 14:29:26 +0530 Subject: [PATCH 2/3] Update deprecated usage of github action commands. Signed-off-by: BugDiver --- .github/workflows/build.yml | 10 ++++++---- .github/workflows/deployment.yml | 9 ++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7e87dd7..0935b21 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,7 +65,7 @@ jobs: cd gauge go run build/make.go --verbose go run build/make.go --install --prefix=/tmp/ - echo "::add-path::/tmp/bin" + echo "/tmp/bin" >> $GITHUB_PATH - name: Install gauge on windows if: matrix.os == 'windows-latest' @@ -74,7 +74,8 @@ jobs: cd gauge go run build/make.go --verbose go run build/make.go --install - echo "::add-path::C:\Program Files\gauge\bin" + echo "C:\\Program Files\\gauge\\bin" >> $GITHUB_PATH + shell: bash - name: Install html report run: | @@ -139,7 +140,7 @@ jobs: cd gauge go run build/make.go --verbose go run build/make.go --install --prefix=/tmp/ - echo "::add-path::/tmp/bin" + echo "/tmp/bin" >> $GITHUB_PATH - name: Install gauge on windows if: matrix.os == 'windows-latest' @@ -148,7 +149,8 @@ jobs: cd gauge go run build/make.go --verbose go run build/make.go --install - echo "::add-path::C:\Program Files\gauge\bin" + echo "C:\\Program Files\\gauge\\bin" >> $GITHUB_PATH + shell: bash - name: Install Gauge Dotnet plugin from source on windows if: matrix.os == 'windows-latest' diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 2050b9d..8d28458 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -28,14 +28,17 @@ jobs: - name: Build artifacts run: | ./run.sh package - - - name: update + - name: Set Version env run: | cd artifacts if [ -z "$version" ]; then version=$(ls gauge-dotnet* | sed "s/\.[^\.]*$//" | sed "s/gauge-dotnet-//"); fi - echo "::set-env name=VERSION::$version" + echo "VERSION=$version" >> $GITHUB_ENV + - name: update + run: | + cd artifacts + echo "::set-env name=::" artifacts=() dir=`pwd` for i in `ls`; do From 683602d96b79859fd372d2be8b5c5800c03f1560 Mon Sep 17 00:00:00 2001 From: sriv Date: Wed, 2 Dec 2020 17:17:10 +0530 Subject: [PATCH 3/3] bump version -> 0.3.1 Signed-off-by: sriv --- src/Gauge.Dotnet.csproj | 2 +- src/dotnet.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Gauge.Dotnet.csproj b/src/Gauge.Dotnet.csproj index e07ebf0..8f1a852 100644 --- a/src/Gauge.Dotnet.csproj +++ b/src/Gauge.Dotnet.csproj @@ -5,7 +5,7 @@ netcoreapp3.0 Runner.NetCore30 The Gauge Team - 0.3.0 + 0.3.1 ThoughtWorks Inc. Gauge C# runner for Gauge. https://gauge.org diff --git a/src/dotnet.json b/src/dotnet.json index 6c55be8..4c90216 100644 --- a/src/dotnet.json +++ b/src/dotnet.json @@ -1,6 +1,6 @@ { "id": "dotnet", - "version": "0.3.0", + "version": "0.3.1", "description": "C# support for gauge + .NET Core 3.0", "run": { "windows": [