Ends in:
2 DAYS
4 HRS
31 MIN
10 SEC
Ends in:
2 D
4 H
31 M
10 S
Open Closed

Replace module with source code, tests crashes #2826


User avatar
0
webking-abp2 created
  • ABP Framework version: v5.1.4
  • UI type: Angular
  • DB provider: MongoDB
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.3+1b45f5407b (64-bit .NET 6.0.1) [xUnit.net 00:00:00.87] Starting: Volo.Saas.Domain.Tests The active test run was aborted. Reason: Test host process crashed
  • Steps to reproduce the issue:"
  • Replace the Volo.Saas package with source code from Suite. When i run the tests that was added i get the exception.

I Used the Abp Suite to Replace Volo.Saas module with source code. When i try to run the tests that was added i get the message in the Output in VS.


3 Answer(s)
  • User Avatar
    0
    yekalkan created
    Support Team Fullstack Developer

    Hi,

    I have created an internal issue for that and will try to fix it in next releases.

    Thanks for your feedback. Your question credit is refunded.

  • User Avatar
    1
    yekalkan created
    Support Team Fullstack Developer

    Hi again,

    Problem is be fixed in and will be released in the next patch release. To fix it in 5.1.4, follow these steps:

    • Create appsettings.json & appsettings.secrets.json files under test\Volo.Saas.TestBase\Volo\Saas folder.

    appsettings.json content:

    {
    
    }
    

    appsettings.secrets.json content:

    {
      "AbpLicenseCode": "Your Abp License Code"
    }
    

    (You can find your license code in the main solution. Just copy from there.)

    • Add the following configuration to test\Volo.Saas.TestBase\Volo.Saas.TestBase.csproj file:
      <ItemGroup>
        <None Remove="Volo/Saas/appsettings.json" />
        <Content Include="Volo/Saas/appsettings.json">
          <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
          <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
          <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
        </Content>
        <None Remove="Volo/Saas/appsettings.secrets.json" />
        <Content Include="Volo/Saas/appsettings.secrets.json">
          <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
          <CopyToOutputDirectory>Always</CopyToOutputDirectory>
        </Content>
      </ItemGroup>
    
    • Add the following configuration to ConfigureServices method in test\Volo.Saas.TestBase\Volo\Saas\SaasTestBaseModule.cs file:
            var builder = new ConfigurationBuilder();
            builder.AddJsonFile("Volo/Saas/appsettings.json", false);
            builder.AddJsonFile("Volo/Saas/appsettings.secrets.json", true);
            context.Services.ReplaceConfiguration(builder.Build());
    

    (you may need to add Microsoft.Extensions.Configuration namespace)

  • User Avatar
    0
    webking-abp2 created

    Works perfect! Thanks!!

Made with ❤️ on ABP v9.1.0-preview. Updated on December 02, 2024, 12:35