This project is read-only.

Newbie having trouble with setup

Feb 6, 2015 at 7:16 PM
My test suite isn't recognized when trying to execute a simple test suite after doing the Manually create first test suite and Run a test suite with NUnit GUI.

I set up a config file for the runtime.dll but it saying my test suite isn't found.

Test suite 'C:_UnitTests\Framework\1.9 RC1\myFirstTestSuite.nbits' not found!

A method is also called, GetTestCases that references a pay to TeamCity which I don't have installed.

Any help would be appreciated!
Feb 7, 2015 at 10:45 AM
Hello Vince,

Creating the link between NUnit, NBi , config files and test-suites is probably the more complex task for a newbie with NBi. Don't worry, you're probably not the first one to struggle with this (and it's plan to improve with in version 2.0)

The problem is also that it's the more difficult to fix remotely. :-( I'll need some additional feedback to help you.
  1. Is it really the correct message you've received when trying to run the test-suite with NUnit? I mean, it's really strange that you've a "C:_" in place of "C:\"
Test suite 'C:_UnitTests\Framework\1.9 RC1\myFirstTestSuite.nbits' not found! 
  1. Do you run NBi on Mono or Linux or MacOS (anything non-standard in the .Net world)?
  2. Have you got a file (test-suite) located at C:\UnitTests\Framework\1.9 RC1\myFirstTestSuite.nbits ?
  3. Could you provide a screenshot of the directory and the content of your config file?
  4. Could you copy/paste the full error message (stack trace) that you're receiving?
Thx.
Feb 12, 2015 at 4:14 PM
I'm following the latest documentation about setting up having a single binaries folder for multiple test-suites and I've come across a couple of issues.
  1. The XML version of the NUnit project file doesn't match what you have.
<NUnitProject>
  <Settings activeconfig="Debug" processModel="Default" domainUsage="Default" />
  <Config name="Debug" binpathtype="Auto" appbase="___MyProjectBase___\..\" configfile="MyFirstTestSuite.config">
    <assembly path="..\..\Framework\1.9.1.4\NBi.NUnit.Runtime.dll" />
  </Config>
  <Config name="Release" binpathtype="Auto" />
</NUnitProject>
I had to insert the proper path to the NBi.NUnit.Runtime.dll as it wasn't found with the settings provided in the documentation.

After I got it to find the Runtime.dll, it threw a different error.
  <message><![CDATA[System.Configuration.ConfigurationErrorsException : An error occurred creating the configuration section handler for nbi: Could not load type 'NBi.NUnit.Runtime.NBiSection' from assembly 'NBi.NUnit.Runtime'. (C:\UnitTests\MyFirstTestSuite.config line 4)
  ----> System.TypeLoadException : Could not load type 'NBi.NUnit.Runtime.NBiSection' from assembly 'NBi.NUnit.Runtime'.]]></message>
My file structure is setup per documentation, NBi version 1.9.1.4 dlls, windows 7 OS.
File Structure
  • UnitTests
  • * Framework
  • * * subfolder containing ALL .dlls from 1.9.1.4 Framework folder
  • * MyFirstTestSuite
  • * * Queries
  • * * ResultSets
  • * * MyFirstTestSuite.nbits
  • * * MyFirstTestSuite.nunit
  • * * MyFristTestSuite.VisualState
  • MyFirstTestSuite.config
Feb 12, 2015 at 5:01 PM
Thx for your feedback,

Your setup is correct.

It sounds that I definitively have a huge problem with the build of the version 1.9 The build 1.9.0.1 and 1.9.1.4 are broken. For the moment, I'd recommend to go back to version 1.8 (available in the downloads section).

I'll try to take a look ASAP to this build to release a correct version of 1.9.
Feb 12, 2015 at 5:44 PM
I've found the (stupid) problem and will fix it tonight.
Feb 12, 2015 at 9:35 PM
Vince2114 wrote:
Thanks for being proactive and providing us info but I'm now getting this same error 'The test suite is not valid. Check with the XSD.'
ps I'm using v1.9.2.6 dlls
Your setup is correct and the dll are part of a successful build. So we should be close to the end :-) The current problem is that you effectively have an issue with your test-suite. The easiest way to check this is with the XSD in Visual Studio (the XSD is available in the folder framework). Just open the files NBi-TestSuite.xsd and your nbits file, if VS underlines some parts of your test-suite, check what's wrong with the underlined elements.

If you can't find the problem just upload your test-suite and I'll check.
Feb 12, 2015 at 10:21 PM
Opened both files in VS2012 and no underlines. My test case simplye query's a ssas db given a connection string and asserts that it does the query 'fasterThan' 1000ms. I'm not sure where to upload the file so I'll copy the code below. All text in caps has been used in place of server names and catalog names to protect the innocent. :)
<?xml version="1.0" encoding="utf-8"?>
<testSuite name ="MyFirstTestSuite" xmls="http://NBi/TestSuite">
  <test name="my first test">
    <system-under-test>
      <execution>
        <query connectionString="Data Source=DNS NAME FOR DEV SERVER;Initial Catalog= CATALOGNAME;Provider=MSOLAP.5;Integrated Security=SSPI;Impersonation Level=Impersonate;">
          SELECT  [Date - Transaction].[Transaction Date Hierarchy].[Month] ON COLUMNS,
                  [Measures].[UNITYPE] ON ROWS 
          FROM [CATALOGNAME] 
        </query>
        
      </execution>
    </system-under-test>
    <assert>
      <fasterThan max-time-milliSeconds="1000"/>
    </assert>
  </test>
</testSuite>
Feb 12, 2015 at 10:40 PM
Also, why does the Errors window always point to a TeamCity folder to look for things?
at NBi.Xml.XmlManager.Load(String testSuiteFilename, String settingsFilename, Boolean isDtdProcessing) in c:\Program Files (x86)\TeamCity\buildAgent\work\78c5267ceadfd0b6\NBi.Xml\XmlManager.cs:line 44
at NBi.NUnit.Runtime.TestSuite.GetTestCases() in c:\Program Files (x86)\TeamCity\buildAgent\work\78c5267ceadfd0b6\NBi.NUnit.Runtime\TestSuite.cs:line 204
Feb 13, 2015 at 6:57 AM
Team city is the continuous integration server used to build the releases of NBi. The stack trace just display the location of the code file during the build. It is just informative and neither NUnit or NBi are looking for this folder or software on your computer.
Feb 13, 2015 at 9:12 AM
The declaration of the namespace is invalid: it's xmlns and not xmls. Just replace the line with the declaration of the head attribute.
<testSuite name ="MyFirstTestSuite" xmlns="http://NBi/TestSuite">
Because the declaration of the namespace is invalid, Visual Studio can't validate the xml file.
Marked as answer by Seddryck on 2/14/2015 at 12:35 AM
Feb 14, 2015 at 6:32 AM
That was exactly it. Everything seems to be working fine now. I'm excited to get going. Thanks for your help!