* Remove JSON output and convert to sample
GlennC and I made the decisison to turn the JSON output into a sample
rather than something we support out of the box. We wouldn't tell
customers to definitely use it and we don't want to introduce more
coupling to JSON.NET.
This allows each middleware to be configured with a specific set of
checks (by name). See the comments in the sample for how this is
frequently used.
This is also addresses aspnet/Home#2575 - or at least the part that we
plan to do. We think that any sort of built-in system of metadata or
tags is vast overkill, and doesn't really align with the primary usage
of health checks.
We're providing building blocks, and these can be put together to
build more complicated things like what's described in aspnet/Home#2575.
A bunch of small changes and updates for 2.2 focused at making our main
scenarios more streamlined and focused. Also adds samples for
extensibility we support so far.
A list of changes:
Clearing baselines for these projects. We didn't ship anything in 2.1 so
there should be nothing in the baselines.
--
The middleware now uses Map for path matching. This makes the actual
`HealthCheckMiddleware` more standalone. This will make it easy to use
with Dispatcher/Endpoint Routing in the future.
This also manifests by removing Path from HealthCheckOptions - the path
is an explicit argument to the UseHealthChecks middelware - this
streamlines the design for 3.0.
--
Added extensibility for customizing the status codes (aspnet/Home#2584)
--
Added extensibility for writing the textual output (aspnet/Home#2583)
--
Changed the default output to be `text/plain`. The most common use cases
for health checks don't include a detailed status.
The existing output format is still available as an option.
Fixaspnet/Home#2820 - UseDatabaseErrorPage throws NullReferenceException when ef exception occur in background task
Fixaspnet/EntityFrameworkCore#9599 - Insert entity in non existing table throws NullException
Added null checks to async local access in event callback.
Related to aspnet/Home#2825
- Removed EF ApiCheck tests; not required for middleware.
- Removed JB annotations and Check usage; align with other Diagnostics Pages projects.
- Fixed code redundancies.
- aspnet/Testing#248
- xUnit no longer supports .NET 4.5.1
- build tests for desktop .NET only on Windows
Address existing issues
- work around test failures, including #350
- skip tests mentioned in #350
- reorder xunit and xunit.runner.visualstudio; setup fails for .NET Core otherwise
- skip all tests using LocalDB on Linux and OSX
- `[FrameworkSkipCondition(RuntimeFrameworks.Mono)]` now redundant
- correct AppVeyor image
nits:
- let VS add the test `<Service>`
- use `[ConditionalFact]` when there's no test data