Visual Studio Online: How to create a build definition with MVC Unit Testing that accesses a remote server? -


i using:

  • visual studio 2013 development
  • visual studio online builds/testing
  • ms build
  • an azure vm house mvc web app , sql database

the current project n-tier mvc application mvc test project. application runs on azure vm (in cloud), accessible locally being part of company domain. have created unit tests test controller actions , passing locally. when check-in , build project vso, unit test(s) fails following error:

test method enrollment.studentenrollment.tests.controllers.homecontrollertest.searchwithnotermorfilterdefaultsort threw exception: system.data.sqlclient.sqlexception: network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: sql network interfaces, error: 26 - error locating server/instance specified)

i assuming error has vso not being able access vm due being on different domain, use in how fix issue. able run unit test build through vso/tfs.

i hoping on here has little more experience process , can me connecting vso remote server/remote sql server.

some ideas have, unsure on how proceed them @ time:

  • a different connection string format: current data source = vm20150201\apps
  • an msbuild definition command or setting unaware of?
  • an azure setting connect vm , vso online site the same domain

other ideas:

  • should setting stubs, fakes, , mocks?
  • if did so, ensure testing controller (with fake db) , should test data access layer it's own test project?

thanks

your unit tests should able run without access instance of application. otherwise not unit test.

if want fun integration tests should avoid doing during build. there tools part of visual studio alm (microsoft test manager) platform handle that. lab management standard environments.

if need can fun own local build server attached vso. local build server on network , have access server in question.


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -