Open Closed

Tests generated by abp suite failing #4727


User avatar
0
Callum created

Hi,

I've discovered that all of the getcountasync and getlistasync tests that abp suite generates seem to fail, I'm getting an error related to the foreign key against all of my navigation properties. I updated to the lastest version and reran the abp suite to regenerate all the tests in case there was a bug in v7.0.0 but I'm getting the same result.

  • ABP Framework version: v7.0.3

  • UI type: Blazor

  • DB provider: EF Core

  • Tiered (MVC) or Identity Server Separated (Angular): no

  • Exception message and stack trace: DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details. SqliteException: SQLite Error 19: 'FOREIGN KEY constraint failed'.

  • Steps to reproduce the issue:" Create any dataset using abp suite that has a navigation property then the entityframeworkcore.test project


5 Answer(s)
  • User Avatar
    0
    alper created
    Support Team Director

    could you provide us the entity JSON files.

  • User Avatar
    0
    Callum created

    could you provide us the entity JSON files.

  • User Avatar
    0
    yekalkan created
    Support Team Fullstack Developer

    @Callum I've deleted the link in your reply since it may contain private data. I'll check this problem.

  • User Avatar
    0
    yekalkan created
    Support Team Fullstack Developer

    I've created an entity named book and then created an author entity with a navigation property to book entity. Tests are successful. See the screenshot below:

    Is there anything extra that had to be done to reproduce this problem?

  • User Avatar
    0
    Callum created

    I've created an entity named book and then created an author entity with a navigation property to book entity. Tests are successful. See the screenshot below:

    Is there anything extra that had to be done to reproduce this problem?

    All my entities are tenanted, maybe that is causing the error? It seems to be happening on all my entities, even those without navigation properties.

    `Message:  Volo.Abp.AbpInitializationException : An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module CSAM.AssetTracker.AssetTrackerTestBaseModule, CSAM.AssetTracker.TestBase, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: An error occurred while saving the entity changes. See the inner exception for details.. See the inner exception for details. ---- Microsoft.EntityFrameworkCore.DbUpdateException : An error occurred while saving the entity changes. See the inner exception for details. -------- Microsoft.Data.Sqlite.SqliteException : SQLite Error 19: 'FOREIGN KEY constraint failed'.

    Stack Trace:  ModuleManager.InitializeModules(ApplicationInitializationContext context) AbpApplicationBase.InitializeModules() AbpApplicationWithExternalServiceProvider.Initialize(IServiceProvider serviceProvider) AbpIntegratedTest1.ctor() AssetTrackerTestBase1.ctor() AssetTrackerEntityFrameworkCoreTestBase.ctor() AssetDescriptionRepositoryTests.ctor() line 15 RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions) ----- Inner Stack Trace ----- ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) <30 more frames...> ModuleManager.InitializeModules(ApplicationInitializationContext context) ----- Inner Stack Trace ----- SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db) SqliteDataReader.NextResult() SqliteCommand.ExecuteReader(CommandBehavior behavior) SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)`

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