简体   繁体   中英

I got a weird message in jenkins

I want to test a specflow project with jenkins. And I can test only one project.I just change test file that it show No tests to execute message.Even two project has the same contents, only project name are different.Why such like this? What's the reason? Please help me,thank you!

The message is:

Started by user anonymous
Building in workspace C:\Program Files (x86)\Jenkins\workspace\test2
Path To MSTest.exe: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\MSTest.exe
Delete old result file file:/C:/Program%20Files%20(x86)/Jenkins/workspace/test2/TestResult.trx
[test2] $ "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\MSTest.exe" /resultsfile:TestResult.trx "/testcontainer:C:\Users\Documents\Visual Studio 2013\Projects\test\test\bin\Debug\test.dll"
Microsoft (R) Test Execution Command Line Tool Version 12.0.21005.1
Copyright (c) Microsoft Corporation. All rights reserved.

Loading C:\Users\Documents\Visual Studio 2013\Projects\test\test\bin\Debug\test.dll...
Starting execution...
No tests to execute.
Processing tests results in file(s) TestResult.trx
FATAL: No MSTest test report files were found.
FATAL: No MSTest TRX test report files were found. Configuration error?
Build step 'Publish MSTest test result report' marked build as failure
Finished: FAILURE

yes.I just debug all test.I try to put contents in specflowfeaturesteps.cs into Unit.cs.And try to run it with jenkins.Then I find it just test only one function in Unit test.

the message:

Passed test.UnitTest1.login 1/1 test(s) Passed

specflowfeature.feature:

Given I login pages with default test user and password
Then the page should show 'http://' on the screen

specflowfeaturesteps.cs:

 [Given(@"I login pages with default test user and password")]
 public void login_success()
 {
     I.Open("http://");
     I.Enter("cherry").In("#loginName");
     I.Enter("****").In("#password");
     I.Click("input[value='Log In']");
 }

 [Then(@"the page should show '(.*)' on the screen")]
 public void check_URL(string p0)
 {
     I.Assert.Url((uri) => uri.GetLeftPart(UriPartial.Path) == p0);
 }

By default SpecFlow generates its tests using NUnit. Are you sure that SpecFlow is generating MSTest tests?

I would open the generated unit test file (under the feature file something like FeatureFile.feature.cs) and check if the tests in there are NUnit or MSTest tests.

you can also check in the config to see if the configuration contains this:

<specFlow>      
  <unitTestProvider name="MSTest" />
</specFlow>

or this:

<specFlow>
  <unitTestProvider name="NUnit" />
</specFlow>

The other possibility is that the code is checked in without the unit tests being generated (although this is only likely if the feature files are modified outside of visual studio, or you are not using the specflow plugin inside vs)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM