-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
External management (config file)- Unable to feed connection string from config file. NUnit Console error / TC error. #716
Comments
There is an issue in the doc. The right synatx is indeed I'd recommend to not have both |
Hi @Seddryck, So if I only use I will still have the error: (and now I have no clue how to get around it)
That error will appear on NUnit console - on GUI everything will be working fine though. |
The config file is probably not found when using the console file. To help you I'd need the project file, config file and the folder structure. |
Hi @Seddryck , Please see attached project with the folder structure. (I have removed 'Packages' folder as the zipped file was too big with it) Packages file included: Test is configured in such way that TC runs on files that are built to: |
@Seddryck did you have a chance to take a look into that issue? |
Hi All.
(Sorry for typing such long epos)
I was trying to configure test suite to feed ConnectionString from config file. Everything ended up working on NUnit GUI but failed when running from NUnit console and on TC build (probably also using console).
Documentation that I based upon:
http://www.nbi.io/docs/connection-configuration/
Issues that I needed to find walkaround for:
By using default configuration as per below:
I got following error:
************** Exception Text **************
System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: Unrecognized configuration section connection-strings
-- for that reason I added it to the configSections in .config file as per below:
By adding it to configSections it started to be recognised to the NUnit GUI. but I received other error
NBi.NUnit.Runtime.TestSuite.ExecuteTestCases: System.ArgumentOutOfRangeException : Specified argument was out of the range of valid values. Parameter name: Some connection-strings are provided through the config file but the default connection string is trying to reference a connection string named '@def-sut' which has not been found.
This error is bane of my existance (for the record ;) )
I have been trying different setups and noticed that it also worked on GUI upon not adding configSections but defining connections as per .NET documentation as per below format: (using: connectionStrings)
This solved issues on NUnit GUI. Since now on the SQL Server instance that I have tried to reach was being picked up and I was able to run whole test and it passed.
After that I merged my changes to local branch and run it via TC Buld with the same error as last time, that is:
NBi.NUnit.Runtime.TestSuite.ExecuteTestCases: System.ArgumentOutOfRangeException : Specified argument was out of the range of valid values. Parameter name: Some connection-strings are provided through the config file but the default connection string is trying to reference a connection string named '@def-sut' which has not been found.
I then investigated the error using NUnit console with the same error message. (on GUI everything is working fine still). Problem is that I need for it to be running on TC build for test purposes.
Whole solution - with all the code - it should be working with no issues on GUI
.Nbits part
Config file part:
Error Message from NUnit Console:
Versioning:
Project:
Hope that above feels readable.
Cheers,
The text was updated successfully, but these errors were encountered: