Skip to content

Integration Testing Testing from controller to database Umbraco.Tests.Integration.deps.json is required #14554

Open
@JMMM77

Description

@JMMM77

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

10.6.1

Bug summary

When running a "Testing from controller to database" integration test you get an exception due to a missing Umbraco.Tests.Integration.deps.json file, see specifics for more detail.

https://docs.umbraco.com/umbraco-cms/v/10.latest-lts/implementation/integration-testing#testing-from-controller-to-database

Specifics

Below is the exception I am getting
Message: 
System.InvalidOperationException : Can't find 'C:\dev\360-Systems\tss-umbraco-360website\Src\360 Website.Tests\bin\Debug\net6.0\Umbraco.Tests.Integration.deps.json'. This file is required for functional tests to run properly. There should be a copy of the file on your source project bin folder. If that is not the case, make sure that the property PreserveCompilationContext is set to true on your project file. E.g 'true'. For functional tests to work they need to either run from the build output folder or the Umbraco.Tests.Integration.deps.json file from your application's output directory must be copied to the folder where the tests are running on. A common cause for this error is having shadow copying enabled when the tests run.

Stack Trace: 
WebApplicationFactory1.EnsureDepsFile() WebApplicationFactory1.EnsureServer()
WebApplicationFactory1.CreateDefaultClient(DelegatingHandler[] handlers) WebApplicationFactory1.CreateDefaultClient(Uri baseAddress, DelegatingHandler[] handlers)
WebApplicationFactory`1.CreateClient(WebApplicationFactoryClientOptions options)
UmbracoTestServerTestBase.Setup()

Steps to reproduce

umbraco.zip

  1. Install above solution or create a new project using https://docs.umbraco.com/umbraco-cms/v/10.latest-lts/implementation/integration-testing#testing-from-controller-to-database
  • Create Project using the nunit template
  • Add the Umbraco.Cms.Tests.Integration package
  • Create appsettings.Tests.json and set to copy always or create appsettings.Tests.Local.json and set both to copy always
  • Create CustomGlobalSetupTeardown class
  • Create integration test for "Testing from controller to database"
  1. Run tests through visual studio

Expected result / actual result

"Testing a notification" will work but the "Testing from controller to database" will fail with the missing Umbraco.Tests.Integration.deps.json file, see specifics for more detail.


This item has been added to our backlog AB#32862

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions