Open Closed

Running tests targeting pro modules in debug mode crashes testhost.exe, while running them via dotnet test works. #7633


User avatar
0
ahmednfwela@bdaya-dev.com created

TLDR: running tests in debug mode crashes, running them via dotnet test works.

Running tests that depend on pro modules in debug mode fails (crashes testhost.exe) if we don't login using abp login before debugging tests.

Simple reproduction:

var licenseCode = "Valid license code here";
SaasDomainModule.LicenseChecker.Check<...>(licenseCode, isDevelopment: true)
  • if we run this code without logging in (%UserProfile%\.abp\cli\access-token.bin is not available), it just crashes the test host.
  • if we run it after logging in, it works.
  • if isDevelopment: false, it works regardless of authentication status.

This is problematic for us, since we want to be able to debug tests in vs test explorer (which sets isDevelopment: true) while only providing licenseCode via appsettings.secrets.json

Abp version: 8.1.0 Abp CLI version: 8.1.3


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

    hi

    In short, You have to abp login to debug the test methods. access-token.bin is required.

    I have refunded your ticket.

  • User Avatar
    0
    ahmednfwela@bdaya-dev.com created

    hi mailming, yes i realize that, but what I am asking is why? I can already run the tests via dotnet test, why can't I debug them ?

    our use case is that we have a separate test writing team that is NOT part of our organization, so they can't login, as they don't have active seats.

    Since we already pay for Enterprise plan, and have access to the source code, I expect that we can use it however we want.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    ok, I see, I will ask our colleague.

Made with ❤️ on ABP v9.0.0-preview Updated on September 19, 2024, 10:13