Skip to content

Can't run build and integration tests in the same process #7

@tmeadon

Description

@tmeadon

When attempting to run the integration tests directly after a build (for example by running Invoke-Build buildAndTest) the RunIntegrationTest task fails with the following error:

ERROR: Assembly with same name is already loaded
At E:\Repos\PSServiceBus\tests\integration\Start-Tests.ps1:11 char:1
+ Import-Module $PSScriptRoot\..\..\output\PSServiceBus\PSServiceBus.ps …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To successfully run the integration tests the user must run the build first (for example by running Invoke-Build .) then open a brand new PowerShell process before running the tests (for example by running Invoke-Build RunIntegrationTests).

It looks like this behaviour could be by design (see dotnet/roslyn#38570, and dotnet/sourcelink#258). If that's the case then there's likely there's two versions of a particular package in use which will need to be tracket down. Either that or the build process could be changed to spawn a separate process to run the build.

Note: this error only occurs if the integration tests are run after the main module build - they run successfully if they are run after only the build of PSServiceBus.Tests.Utils.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions