dotnet / dotnet/aspnetcore

Run automated tests on debug builds

Open
#11,632 10 comments 1 reaction 0 assignees View on GitHub
affected-few area-infrastructure severity-minor task
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

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](https://github.com/aspnet/AspNetCore/pull/11624#issuecomment-506105907).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.