SpecFlowOSS / SpecFlow

#1 .NET BDD Framework. SpecFlow automates your testing & works with your existing code. Find Bugs before they happen. Behavior Driven Development helps developers, testers, and business representatives to get a better understanding of their collaboration
https://www.specflow.org/
Other
2.25k stars 754 forks source link

Config error running on VSTS #695

Closed phatcher closed 8 years ago

phatcher commented 8 years ago

I'm trying to incorporate some SpecFlow tests in my build on VSTS, but I get an error in the log which causes the test step to fail...

2016-08-11T10:32:51.7038777Z ##[error]Error: TechTalk.SpecRun.Framework.SpecRunConfigurationException: Invalid configuration file: There is an error in XML document (3, 28). -> Expected hex 0x in '{0}'. ---> System.InvalidOperationException: There is an error in XML document (3, 28). ---> System.FormatException: Expected hex 0x in '{0}'. 2016-08-11T10:32:51.7038777Z ##[error] at System.Guid.GuidResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument, String failureArgumentName, Exception innerException) 2016-08-11T10:32:51.7048780Z ##[error] at System.Guid.GuidResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument) 2016-08-11T10:32:51.7048780Z ##[error] at System.Guid.TryParseGuidWithHexPrefix(String guidString, GuidResult& result) 2016-08-11T10:32:51.7048780Z ##[error] at System.Guid.TryParseGuid(String g, GuidStyles flags, GuidResult& result) 2016-08-11T10:32:51.7058776Z ##[error] at System.Guid..ctor(String g) 2016-08-11T10:32:51.7058776Z ##[error] at System.Xml.XmlConvert.ToGuid(String s) 2016-08-11T10:32:51.7068777Z ##[error] at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderTestProfile.Read2_TestProfileSettings(Boolean isNullable, Boolean checkType) 2016-08-11T10:32:51.7068777Z ##[error] at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderTestProfile.Read29_TestProfile(Boolean isNullable, Boolean checkType) 2016-08-11T10:32:51.7078780Z ##[error] at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderTestProfile.Read30_TestProfile() 2016-08-11T10:32:51.7078780Z ##[error] --- End of inner exception stack trace --- 2016-08-11T10:32:51.7088783Z ##[error] at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) 2016-08-11T10:32:51.7088783Z ##[error] at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle) 2016-08-11T10:32:51.7098777Z ##[error] at System.Xml.Serialization.XmlSerializer.Deserialize(TextReader textReader) 2016-08-11T10:32:51.7098777Z ##[error] at TechTalk.SpecRun.Framework.Configuration.TestProfileLoader.LoadProfileWithDefaultNamespace(String filePath, String defaultNamespace) 2016-08-11T10:32:51.7108780Z ##[error] --- End of inner exception stack trace --- 2016-08-11T10:32:51.7108780Z ##[error] at TechTalk.SpecRun.Framework.Configuration.TestProfileLoader.LoadProfileWithDefaultNamespace(String filePath, String defaultNamespace) 2016-08-11T10:32:51.7108780Z ##[error] at TechTalk.SpecRun.Framework.Configuration.TestProfileLoader.LoadTestProfileFromFile(String filePath) 2016-08-11T10:32:51.7118771Z ##[error] at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() 2016-08-11T10:32:51.7118771Z ##[error] at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source) 2016-08-11T10:32:51.7128779Z ##[error] at TechTalk.SpecRun.Framework.Configuration.TestProfileLoader.LoadTestProfileFromFirstExistingFile(IEnumerable1 filePaths) 2016-08-11T10:32:51.7128779Z ##[error] at TechTalk.SpecRun.VisualStudio.TestAdapter.Settings.ProfileProvider.GetTestProfile(IDiscoveryContext discoveryContext, String source, TestingContext testingContext) 2016-08-11T10:32:51.7138781Z ##[error] at TechTalk.SpecRun.VisualStudio.TestAdapter.TestingContext.LoadTestProfile(String source) 2016-08-11T10:32:51.7138781Z ##[error] at TechTalk.SpecRun.VisualStudio.TestAdapter.SpecRunTestExecutor.RunTests(String source, IRunContext runContext, IFrameworkHandle frameworkHandle, FilterItem filter, TestingContext testingContext, Boolean hasEvalTestToExecute) 2016-08-11T10:32:51.7148779Z ##[error] at TechTalk.SpecRun.VisualStudio.TestAdapter.SpecRunTestExecutor.RunTests(IEnumerable1 sources, IRunContext runContext, IFrameworkHandle frameworkHandle) 2016-08-11T10:32:51.7148779Z ##[error] 2016-08-11T10:32:51.8308775Z Attachments: 2016-08-11T10:32:51.8308775Z ##[error]Test Run Failed.

I presume the config file is the the srprofile file that was generated when I referenced SpecFlow? Here's what I have for reference...

`<?xml version="1.0" encoding="utf-8"?>

Gul.Trunk.Domain.Test.dll `
SabotageAndi commented 8 years ago

Yes, the srProfile is the config file in that case. You have an error in the xml on line 3 char 28.

Could you post the srProfile with the original formating? GitHub/Markdown did mess the posted one. If you can not post it public, you can send it to me via email to support@specflow.org.

phatcher commented 8 years ago

I'm guessing it's the brackets in line 3

Default.srprofile.txt

SabotageAndi commented 8 years ago

Yes. There should be a GUID. This is normally inserted when you install the nuget package.

phatcher commented 8 years ago

Can I just generate a GUID and put it in there or does it need to be a specific value?

phatcher commented 8 years ago

Ah, it works with the ProjectName and GUID there - still have one more problem but I'll raise it as a separate issue

SabotageAndi commented 8 years ago

Normally it uses the Guid of the project, but any should be good

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.