Skip to content

Conversation

@bart-vmware
Copy link
Member

@bart-vmware bart-vmware commented May 28, 2025

Description

This PR improves test coverage of the Steeltoe actuator endpoints by running tests against host builders and asserting on full JSON response bodies. While doing so, several bugs were fixed.

Related PR to update the documentation can be found at SteeltoeOSS/Documentation#386.

cloudfoundryapplication endpoint

Refactor tests for cloudfoundryapplication endpoint

  • Order the returned list of endpoints by ID
  • Critical fix: block /cloudfoundryapplication and log warning when security middleware not added
  • Critical fix: don't turn off all security when the /cloudfoundryapplication hypermedia endpoint is turned off

dbmigrations endpoint

Refactor tests for dbmigrations endpoint

env endpoint

Refactor tests for env endpoint

  • Only display changed values from placeholder/decryption providers
  • Show placeholder/decryption providers after the configuration providers they wrap
  • Hide providers that don't have any properties (reverted for Spring Boot compatibility)

health endpoint

Refactor tests for health endpoint

  • Order health check results in descending status
  • Simplify test health contributors (single purpose)
  • Refactor tests for health contributors, move availability contributors to matching namespace
  • Add internal file system abstraction for testability of disk space contributor
  • Remove duplicate information in details for ASP.NET health checks
  • Fixed: X-Use-Status-Code-From-Response header not always respected
  • Fixed inconsistency in case-sensitivity of health group names

heapdump endpoint

Refactor tests for heapdump endpoint

threaddump endpoint

Refactor tests for threaddump endpoint

httpexchanges endpoint

Refactor tests for httpexchanges endpoint

  • Replace IHttpExchangesRepository with IHttpExchangeRecorder, so that filtering logic becomes testable
  • Fixed: appsettings.json files from RazorPagesTestApp were still being copied by VS Build Acceleration
  • Fixed: options.IncludeTimeTaken was ignored
  • Move HttpExchanges into MemoryDumps category
  • Reduce pressure when running all tests locally, so that DiagnosticObserverHttpExchangeRecorder doesn't fail

hypermedia endpoint

Refactor tests for hypermedia endpoint

  • Order the returned list of endpoints by ID
  • Fixed: The value returned for "templated" was always false

info endpoint

Refactor tests for info endpoint

  • Fixed: adjust contributor nullability to allow null dictionary values
  • Fixed: do not skip lines in git.properties file that contain = character in their value

loggers endpoint

Refactor tests for loggers endpoint

refresh endpoint

Refactor tests for refresh endpoint

  • Fixed: order keys alphabetically, without duplicates
  • Fixed: throw when unable to reload, instead of silently do nothing

mappings endpoint

Refactor tests for mappings endpoint

beans endpoint

Refactor tests for beans endpoint

all endpoints

  • Refactor tests for all actuators

Spring Boot Admin

  • Add tests for Spring Boot Admin

Other

  • Revise tests for dependent services: get middleware instance to ensure all downstream dependencies are registered
  • Simplify tests for options: there's no added value in using host builders
  • Cleanup tests for management/endpoint options
    • Fixed: allow clearing default exposure using Spring-style configuration keys
    • Fixed: remove duplicate entries in exposure over regular and Spring-style keys
  • Move content negotation tests for SBA
  • Adapt configuration key names to .NET naming convention, inline constants

Fixes #1028.

Quality checklist

  • Your code complies with our Coding Style.
  • You've updated unit and/or integration tests for your change, where applicable.
  • You've updated documentation for your change, where applicable.
    If your change affects other repositories, such as Documentation, Samples and/or MainSite, add linked PRs here.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.
  • You've added required license files and/or file headers (explaining where the code came from with proper attribution), where code is copied from StackOverflow, a blog, or OSS.

@bart-vmware bart-vmware force-pushed the improve-management-test-coverage branch 11 times, most recently from 0e4d814 to 6271345 Compare June 3, 2025 15:09
@bart-vmware bart-vmware force-pushed the improve-management-test-coverage branch 8 times, most recently from ddfe948 to a116aef Compare June 10, 2025 14:20
@bart-vmware bart-vmware added Component/Management Issues related to Steeltoe Management (actuators) ReleaseLine/4.x Identified as a feature/fix for the 4.x release line labels Jun 12, 2025
@bart-vmware bart-vmware added this to the 4.0.0-rc1 milestone Jun 12, 2025
- Only display changed values from placeholder/decryption providers
- Show placeholder/decryption providers *after* the configuration providers they wrap
- Hide providers that don't have any properties
- Remove duplicate information in details for ASP.NET health checks
- Fixed: X-Use-Status-Code-From-Response header not always respected
- Fixed inconsistency in case-sensitivity of health group names
@bart-vmware bart-vmware force-pushed the improve-management-test-coverage branch from 5f7cdb2 to 5108fdd Compare June 13, 2025 11:44
- Order the returned list of endpoints by ID
- Critical fix: block /cloudfoundryapplication and log warning when security middleware not added
- Critical fix: don't turn off all security when the /cloudfoundryapplication hypermedia endpoint is turned off
@bart-vmware bart-vmware force-pushed the improve-management-test-coverage branch from 5108fdd to 040a2c9 Compare June 13, 2025 11:50
TimHess
TimHess previously approved these changes Jun 16, 2025
Copy link
Member

@TimHess TimHess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM, just a couple small items that could be addressed

@bart-vmware bart-vmware requested a review from TimHess June 16, 2025 21:37
@bart-vmware bart-vmware merged commit e91e355 into main Jun 16, 2025
28 of 29 checks passed
@bart-vmware bart-vmware deleted the improve-management-test-coverage branch June 16, 2025 22:09
bart-vmware added a commit to SteeltoeOSS/Documentation that referenced this pull request Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component/Management Issues related to Steeltoe Management (actuators) ReleaseLine/4.x Identified as a feature/fix for the 4.x release line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review Management tests

3 participants