Skip to content

Run automated tests on debug builds #11632

Open
@halter73

Description

@halter73

My understanding is that our CI servers now only run automated tests against release builds. If that's the case, this means that the many Debug.Asserts throughout the AspNetCore repo are pretty worthless since we can only ever see an assertion failures by running tests or samples locally even the Debug.Asserts in the test projects themselves.

I think the best solution is to run our automated tests against debug builds. I'm not asking for all our testing to be done against debug builds, but nightly tests of debug builds would probably be a good idea.

@davidfowl suggested using critical logs to replace Debug.Asserts. That was definitely the right approach for #11624, but in a lot of places we assert currently we don't have a logger. There's also the problem that not all our tests will fail given a critical log, but a lot will.

Changing Debug.Asserts to Trace.Asserts seems like a somewhat reasonable idea, but not only does that create performance concerns, it could also potentially introduce new DoS vectors as @benaadams rightfully pointed out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    affected-fewThis issue impacts only small number of customersarea-infrastructureIncludes: MSBuild projects/targets, build scripts, CI, Installers and shared frameworkseverity-minorThis label is used by an internal tooltask

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions