getgauge / gauge-visualstudio

Visual Studio plugin for Gauge
10 stars 9 forks source link

Unable to debug tests in VS 2017 #246

Closed Apoorva-GA closed 5 years ago

Apoorva-GA commented 5 years ago

From @mdramski on February 18, 2019 9:55

Expected behavior

I would like to debug tests. Could you provide working configuration of my plugins?

Actual behavior

I am unable to debug tests after upgrade from Visual Studio 2015 to 2017

Steps to reproduce

I can run selected tests from Test Explorer but progress bar in Test Explorer is always stuck at 50% and I have to Cancel execution to run tests again. I can not debug test - there is message in output The program '[27768] testhost.x86.exe' has exited with code 0 (0x0). and test disappear from test explorer after that (it reappear if I run/debug other test)

I have tried to upgrade everything to the latest builds but then I but after that I was not able to run test anymore because of such error:

System.Runtime.Serialization.SerializationException: There was an error deserializing the object of type Gauge.VisualStudio.TestAdapter.TestExecutionEvent. Encountered invalid character ' '. ---> System.FormatException: Encountered invalid character ' '. at System.Runtime.Serialization.Json.XmlJsonReader.ComputeQuotedTextLengthUntilEndQuote(Byte[] buffer, Int32 offset, Int32 offsetMax, Boolean& escaped) at System.Runtime.Serialization.Json.XmlJsonReader.ReadQuotedText(Boolean moveToText) at System.Runtime.Serialization.Json.XmlJsonReader.Read() at System.Xml.XmlBaseReader.Skip() at System.Runtime.Serialization.XmlObjectSerializerReadContext.SkipUnknownElement(XmlReaderDelegator xmlReader) at System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson.GetJsonMemberIndex(XmlReaderDelegator xmlReader, XmlDictionaryString[] memberNames, Int32 memberIndex, ExtensionDataObject extensionData) at ReadTestExecutionEventFromJson(XmlReaderDelegator , XmlObjectSerializerReadContextComplexJson , XmlDictionaryString , XmlDictionaryString[] ) at System.Runtime.Serialization.Json.JsonClassDataContract.ReadJsonValueCore(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context) at System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context) at System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract& dataContract) at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns) at System.Runtime.Serialization.Json.DataContractJsonSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName) at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver) --- End of inner exception stack trace --- at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver) at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject(XmlDictionaryReader reader) at Gauge.VisualStudio.TestAdapter.GaugeRunner.OnOutputDataReceived(Object sender, DataReceivedEventArgs args) at System.Diagnostics.Process.OutputReadNotifyUser(String data) at System.Diagnostics.AsyncStreamReader.FlushMessageQueue() at System.Diagnostics.AsyncStreamReader.GetLinesFromStringBuilder() at System.Diagnostics.AsyncStreamReader.ReadBuffer(IAsyncResult ar) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.IO.Stream.ReadWriteTask.System.Threading.Tasks.ITaskCompletionAction.Invoke(Task completingTask) at System.Threading.Tasks.Task.FinishContinuations() at System.Threading.Tasks.Task.Finish(Boolean bUserDelegateExecuted) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution) at System.Threading.ThreadPoolWorkQueue.Dispatch() Encountered invalid character ' '. at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver) at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject(XmlDictionaryReader reader) at Gauge.VisualStudio.TestAdapter.GaugeRunner.OnOutputDataReceived(Object sender, DataReceivedEventArgs args) at System.Diagnostics.Process.OutputReadNotifyUser(String data) at System.Diagnostics.AsyncStreamReader.FlushMessageQueue() at System.Diagnostics.AsyncStreamReader.GetLinesFromStringBuilder() at System.Diagnostics.AsyncStreamReader.ReadBuffer(IAsyncResult ar) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.IO.Stream.ReadWriteTask.System.Threading.Tasks.ITaskCompletionAction.Invoke(Task completingTask) at System.Threading.Tasks.Task.FinishContinuations() at System.Threading.Tasks.Task.Finish(Boolean bUserDelegateExecuted) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution) at System.Threading.ThreadPoolWorkQueue.Dispatch()

Gauge version

Gauge version: 1.0.4 Commit Hash: 3a9a647

Plugins csharp (0.10.1) html-report (4.0.6) screenshot (0.0.1)

Visual Studio Professional 2017 Version 15.9.6

Copied from original issue: getgauge/gauge#1345

Apoorva-GA commented 5 years ago

@mdramski what version of gauge Visual Studio plugin are you using? Also please update csharp plugin to the latest version and try.

Apoorva-GA commented 5 years ago

From @mdramski on February 18, 2019 11:41

I use 0.3.6 Gauge plugin for Visual Studio. Updating csharp to 0.10.5 did not help. With this version I am unable to run test case because test never starts (infinite spinner loop).

Apoorva-GA commented 5 years ago

@mdramski I am able to replicate the issue with VS2017. Thanks for reporting. We will look at fixing this soon.

gaugebot[bot] commented 5 years ago

The fix should be available in nightly >= 5-3-2019

Apoorva-GA commented 5 years ago

Works as expected with Nightly 5-3-2019