Open Closed

Unit testing issue with SQLite while Seeding #1737


User avatar
0
Yaduraj created

Hi,

We are getting following error while running/debugging the unit test cases.

Volo.Abp.AbpInitializationException : An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module SCV.Litmus.InvoiceManagement.InvoiceManagementTestBaseModule, SCV.Litmus.InvoiceManagement.TestBase, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: SQLite Error 1: 'no such table: AbpSettings'.. See the inner exception for details. ---- Microsoft.Data.Sqlite.SqliteException : SQLite Error 1: 'no such table: AbpSettings'.

This error is being thrown from the OnApplicationInitialization(...) while we call SeedTestData(context) of TestBaseModule class. Please find attached snapshot-

Before this, we were getting error The active test run was aborted. Reason: Test host process crashed see issue So we added "AbpLicenseCode" in Test project's appsetting.config, then the above error started to come.

Note: Its a bloacker for our project and we can not give you minimal project to reproduce the issue. So let us know if we can connect through Zoom.

We have changed version from v3.0.4 to v4.3.1, please help me for resolve this issue. what i am missing.

  • ABP Framework version: v4.3.1
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    If your unit tests require other contexts, you can migrate multiple contexts.

    https://github.com/abpframework/abp/blob/dev/modules/identity/test/Volo.Abp.Identity.EntityFrameworkCore.Tests/Volo/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreTestModule.cs#L38-L44

    For AbpSettings table the context is SettingManagementDbContext

  • User Avatar
    0
    Yaduraj created

    Thanks @maliming

    The issue has been resolved with given solution.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11