2014-04-05 24 views
9

के साथ xUnit.net परीक्षणों की खोज अपवाद मैं विजुअल स्टूडियो ऑनलाइन होस्टेड बिल्ड के साथ Xunit.net का उपयोग कर रहा हूं। मेरे परीक्षणों की खोज की जा रही है और स्थानीय और बिल्ड सर्वर दोनों पर ठीक चल रहा है। लेकिन बिल्ड सर्वर पर मुझे यह अपवाद मिलता है (जिससे निर्माण "आंशिक रूप से सफल" राज्य तक पहुंच जाता है)। यह अजीब है, क्योंकि मेरे सभी परीक्षण वास्तव में खोजे जा रहे हैं और चल रहे हैं।विजुअल स्टूडियो ऑनलाइन बिल्ड सर्वर

[xUnit.net 00:00:01.3170293] Exception discovering tests from C:\a\bin\xunit.runner.visualstudio.testadapter.dll: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.ObjectModel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. 
File name: 'Microsoft.VisualStudio.TestPlatform.ObjectModel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.ObjectModel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. 
File name: 'Microsoft.VisualStudio.TestPlatform.ObjectModel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 

WRN: Assembly binding logging is turned OFF. 
To enable assembly bind failure logging, set the registry value HKLM\Software\Microsoft\Fusion!EnableLog to 1. 
Note: There is some performance penalty associated with assembly bind failure logging. 
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. 

    at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes) 
    at System.Reflection.RuntimeAssembly.GetExportedTypes() 
    at Xunit.Sdk.Executor.EnumerateTests..ctor(Executor executor, Object _handler)$$RethrowMarker$$ at ExceptionExtensions.RethrowWithNoStackTraceLoss(Exception ex) 
    at Xunit.RemoteAppDomainManager.CreateObjectTObject 
    at Xunit.Xunit1Executor.EnumerateTests(ICallbackEventHandler handler) 
    at Xunit.Xunit1.Find(Predicate`1 filter, Boolean includeSourceInformation, IMessageSink messageSink) 
    at Xunit.Xunit1.Find(Boolean includeSourceInformation, IMessageSink messageSink) 
    at Xunit.XunitFrontController.Find(Boolean includeSourceInformation, IMessageSink messageSink) 
    at Xunit.Runner.VisualStudio.TestAdapter.VsTestRunner.GetTests(IEnumerable`1 sources, IMessageLogger logger, XunitVisualStudioSettings settings, Stopwatch stopwatch) 

See http://go.microsoft.com/fwlink/?LinkId=254169 

मैं निम्नलिखित nuget संकुल परीक्षण परियोजना में स्थापित किया है:

  • XUnit 1.9.2
  • xunit.runner.visualstudio 0.99.2

अन्य इकाई परीक्षण चौखटे , जैसे कि एमएस टेस्ट और एनयूनीट, समस्याओं के बिना काम कर रहे हैं। इससे मुझे लगता है कि यह समस्या विजुअल स्टूडियो ऑनलाइन के बजाय Xunit.net के साथ है।

मैंने xUnit.net गिटहब में भी एक मुद्दा खोला है, लेकिन यह अनसुलझा रहता है। https://github.com/xunit/xunit/issues/47

मैं यह कैसे काम कर सकता हूं? क्या किसी को कामकाज के बारे में पता है? क्या मैं किसी भी तरह त्रुटि संदेश दबा सकता हूं?

उत्तर

15

परीक्षक xunit.runner.visualstudio.testadapter.dll में यूनिट परीक्षणों की खोज करने का प्रयास करता है। क्यूं कर? क्योंकि यह *.test*.dll के डिफ़ॉल्ट परीक्षण स्रोत spec से मेल खाता है।

जब *.tests.dll वरना कुछ अधिक विशिष्ट करने के लिए डिफ़ॉल्ट परीक्षण स्रोत कल्पना बदल रहा है, यह काम करेंगे।

स्रोत: http://erictummers.wordpress.com/2014/02/11/execute-xunit-tests-on-hosted-build-controller/

+4

मैं एक ऐसी ही स्थिति मेरी दृश्य स्टूडियो ऑनलाइन निर्माण के साथ NUnit टेस्ट एडाप्टर का उपयोग और वाइल्डकार्ड का नाम बदलने के रूप में आप का सुझाव दिया और साथ ही यह तय ऊपर बारे में जाना। मैं हो रही थी त्रुटि संदेश: 'आश्रित विधानसभा Microsoft.VisualStudio.TestPlatform.ObjectModel, संस्करण = 11.0.0.0, संस्कृति = तटस्थ, PublicKeyToken = सी के b03f5f7f11d50a3a: \ एक \ बिन \ NUnit.VisualStudio.TestAdapter.dll नहीं मिला। नहीं तो एक NUnit project.' उम्मीद है कि यह किसी और जो NUnit के अलावा इस मुद्दे भर में ठोकर मदद कर सकता है पर ध्यान नहीं दिया जा सकता है। –

संबंधित मुद्दे