getgauge / gauge-csharp

Csharp runner for Gauge
https://gauge.org
GNU General Public License v3.0
33 stars 21 forks source link

Cannot Run scenarios using latest version(0.10.4) #136

Closed joyep-jojo closed 6 years ago

joyep-jojo commented 6 years ago

After upgrading the library from 0.10.3 to 0.10.4 in my project, I was unable to run scenarios.

Expected behavior

scenarios should run as usual.

Actual behavior

An error is displayed.

>gauge run -t test -e qa
Building project: C:\gauge\Testing.csproj
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe  C:\gauge\Testing.csproj /t:Build /m  /nodeReuse:False  /v:q  /p:RestorePackages="False" /p:OutputPath="C:\gauge\Testing\gauge_bin" /p:Platform="Any CPU" /p:Configuration="Debug" /logger:Fake.MsBuildLogger+ErrorLogger,"C:\Users\myuser\AppData\Roaming\gauge\plugins\csharp\0.10.4\bin\FakeLib.dll"
Microsoft (R) Build Engine version 15.7.179.6572 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Error Message: Connection closed [127.0.0.1:49878] cause: EOF
  Stacktrace:

  Error Message: write tcp 127.0.0.1:49868->127.0.0.1:49878: use of closed network connection
  Stacktrace:

Gauge.CSharp.Runner.GaugeListener System.Runtime.Remoting.RemotingException: The argument type 'Gauge.CSharp.Lib.ExecutionContext' cannot be converted into parameter type 'Gauge.CSharp.Lib.ExecutionContext'. ---> System.InvalidCastException: Object must implement IConvertible.
   at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
   at System.Runtime.Remoting.Messaging.Message.CoerceArg(Object value, Type pt)
   --- End of inner exception stack trace ---

Server stack trace:
   at System.Runtime.Remoting.Messaging.Message.CoerceArg(Object value, Type pt)
   at System.Runtime.Remoting.Messaging.Message.CoerceArgs(MethodBase mb, Object[] args, ParameterInfo[] pi)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Gauge.CSharp.Runner.ISandbox.ExecuteHooks(String hookType, IHooksStrategy strategy, IList`1 applicableTags, ExecutionContext executionContext)
   at Gauge.CSharp.Runner.MethodExecutor.ExecuteHooks(String hookType, HooksStrategy strategy, IList`1 applicableTags, ExecutionContext executionContext) in C:\Program Files (x86)\Go Agent\pipelines\Csharp-Package\Runner\MethodExecutor.cs:line 74Successfully generated html-report to => C:\inetpub\wwwroot\reports\html-report\2018-07-01 18.57.17\index.html

   at Gauge.CSharp.Runner.Processors.HookExecutionProcessor.ExecuteHooks(Message request) in C:\Program Files (x86)\Go Agent\pipelines\Csharp-Package\Runner\Processors\HookExecutionProcessor.cs:line 64
   at Gauge.CSharp.Runner.Processors.HookExecutionProcessor.Process(Message request) in C:\Program Files (x86)\Go Agent\pipelines\Csharp-Package\Runner\Processors\HookExecutionProcessor.cs:line 52
   at Gauge.CSharp.Runner.Processors.ExecutionStartingProcessor.Process(Message request) in C:\Program Files (x86)\Go Agent\pipelines\Csharp-Package\Runner\Processors\ExecutionStartingProcessor.cs:line 45
   at Gauge.CSharp.Runner.GaugeListener.PollForMessages() in C:\Program Files (x86)\Go Agent\pipelines\Csharp-Package\Runner\GaugeListener.cs:line 49
Specifications: 0 executed      0 passed        0 failed        0 skipped
Scenarios:      0 executed      0 passed        0 failed        0 skipped

Total time taken: 1.148s

Steps to reproduce

  1. Upgrade the library version to the latest in Visual Studio.
  2. Run a scenario.

Gauge version

Gauge version: 1.0.0
Commit Hash: 5a99965

Plugins
-------
csharp (0.10.4)
flash (0.0.1)
html-report (4.0.4)
js (2.1.0)
screenshot (0.0.1)
spectacle (0.1.2)
xml-report (0.2.0)
sriv commented 6 years ago

Please use Gauge.CSharp.Lib version 0.7.1 for now. We will be releasing the next version of gauge-csharp which has new API.

sriv commented 6 years ago

I did some digging, here's what's happening:

I will be raising a fix for this shortly.

sriv commented 6 years ago

should be available in nightly >= 18/07/2018

sswaroopgupta commented 6 years ago

Verified with

Gauge version: 1.0.1.nightly-2018-07-18
Commit Hash: e62f840

Plugins
-------
csharp (0.10.5.nightly-2018-07-19)