c# - Why DataDriven tests no longer run on Jenkins when using MSTest? -


i have suite of webdriver tests written c# , using mstest runner. @ point nunit not option, need figure out how make work current configuration. ci using jenkins ver. 1.514. not in control of plugins being installed or when jenkins updated , if asking such thing might lead long wait , approval processes in different teams (hate birocracy).

so.. have few datadriven tests defined follows(i'll paste in 1 of them)

  [datasource("microsoft.visualstudio.testtools.datasource.csv", "usersdata.csv", "usersdata#csv", dataaccessmethod.sequential)]     [testmethod()]     public void test_login()     {         logger.info("");         logger.info("-----------------------------------------------------------------"); 

so, should clear enough using usersdata.csv file, placed in testdata folder in project. run test in jenkins, used use command line

mstest /testmetadata:"%workspace%\seleniumjenkins.vsmdi" /testlist:jenkins /resultsfile:"%workspace%\alltests_jenkins.trx" /runconfig:"%workspace%\local.testsettings" /detail:stdout 

everything worked fine, 1 day, when encountered error in trx results file:

the unit test adapter failed connect data source or read data. more information on troubleshooting error, see "troubleshooting data-driven unit tests" (http://go.microsoft.com/fwlink/?linkid=62412) in msdn library.error details: .net framework data providers require microsoft data access components(mdac).  please install microsoft data access components(mdac) version 2.6 or later.retrieving com class factory component clsid {2206cdb2-19c1-11d1-89e0-00c04fd7a829} failed due following error: 8007007e specified module not found. (exception hresult: 0x8007007e). 

but if log on machine slave running , run same command seems finds datasource files , ir runs ok.

moreover, installed psexec , placed command *.bat file, called file ps exec this:

psexec \\my_ip -u "machine-name\jenkins-local" -p "password" cmd /c call "%workspace%\selenium\msteststart.bat"  

this seems working, don't logging jenkins , if redirect file, whenever build starts , wipes out workspace file lost, have last version of file , cannot compare other builds.

the local.testsettings file looks this:

<?xml version="1.0" encoding="utf-8"? >     <testsettings name="local" id="06505635-693a-4f31-b962-ecf8422b5eca" xmlns="http://microsoft.com/schemas/visualstudio/teamtest/2010">        <description>these default test settings local test run.</description>        <deployment>           <deploymentitem filename="selenium\testdata\usersdata.csv" />        </deployment>    <namingscheme basename="selenium_" usedefault="false"  />    <execution>      <timeouts testtimeout="10800000" />        <testtypespecific>          <unittestrunconfig testtypeid="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b">            <assemblyresolution>             <testdirectory useloadcontext="true" />            </assemblyresolution>         </unittestrunconfig>       </testtypespecific>     <agentrule name="execution agents">     </agentrule>    </execution> </testsettings> 

i appreciate if give me hint on one. thanks

it be

  • an mdac installation error. e.g. here ideas on how repair it. consider asking admin try check if mdac installed.
  • a permission issue ? 100% sure running command on slave same user both using jenkins slave , psexec ?

as manage work using psexec, workaround generate file on same machine job ran , archive generated log file artifact. jenkins keep track of it.

if prefer try have output in console, maybe apply console parsing, can make psexec command outputs file after build console (by type-ing after has run), or maybe use tee-like batch command manage psexec output jenkins console: using custom tee command .bat file

and don't forget capture standard error well!


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -