Open Closed

Commercial SaaS Module Unit tests are failing #9044


User avatar
0
raif created

Hello, after updating the framework to 9.1.0
Unit tests are started to fail in our custom SaaS module due missing service registration.

image.png

Beside that how you guys managed to release commercial module with failing unit tests :)

image.png

Can you guys able to check and fix module accordingly ?

As a workaround;
Base on error message, I temporarily added AbpSettingManagementEntityFrameworkCoreModule to the EntityFrameworkCore layer.
This automatically registered missing services.

For the tests;
I extended existing CreateDatabaseAndGetConnection() method with new SettingManagementDbContext

    private static SqliteConnection CreateDatabaseAndGetConnection()
    {
        var connection = new SqliteConnection("Data Source=:memory:");
        connection.Open();

        new SaasDbContext(
            new DbContextOptionsBuilder().UseSqlite(connection).Options
        ).GetService().CreateTables();

        new SettingManagementDbContext(
            new DbContextOptionsBuilder().UseSqlite(connection).Options
        ).GetService().CreateTables();

        return connection;
    }

1 Answer(s)
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi, I've checked and reproduced the problem. Indeed the specified tests are failing, this is weird to see that because we have a testing pipeline that runs before releasing modules. I'll investigate this situation.

    Btw, your solution to the problem is correct, we will add the same code to the module class.

    Thanks for reporting.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 25, 2025, 11:10