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.
When attempting to run the integration tests directly after a build (for example by running
Invoke-Build buildAndTest) theRunIntegrationTesttask fails with the following error: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 runningInvoke-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.