AspNetCore.Diagnostics.HealthChecks icon indicating copy to clipboard operation
AspNetCore.Diagnostics.HealthChecks copied to clipboard

Added ExpectedContent to URI Groups

Open roblohmann opened this issue 3 years ago • 7 comments

What this PR does / why we need it: Adds the ExpectedContent method to the IURIOptions to be able to expect a specific phrase in the response of the URL.

Which issue(s) this PR fixes: None, it's a new feature

Please reference the issue this PR will close: #[issue number]

Special notes for your reviewer:

Does this PR introduce a user-facing change?: No

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • [x] Code compiles correctly
  • [x] Created/updated tests
  • [x] Unit tests passing
  • [ ] End-to-end tests passing
  • [ ] Extended the documentation
  • [] Provided sample for the feature

roblohmann avatar May 25 '22 06:05 roblohmann

@roblohmann After #1175 being merged there is API approval file in each project. You need to update is to reflect your changes in public API if any.

sungam3r avatar May 25 '22 20:05 sungam3r

@roblohmann I resolved formatting and build issues. One suggestion left. Also update API approval file.

sungam3r avatar Jun 01 '22 07:06 sungam3r

@roblohmann I resolved formatting and build issues. One suggestion left. Also update API approval file.

Thank you for your feedback and help in addopting this request. Also responded to your last suggestion.

roblohmann avatar Jun 01 '22 09:06 roblohmann

Also update API approval file.

⬆️

sungam3r avatar Jun 01 '22 21:06 sungam3r

Also update API approval file.

⬆️

What does this file do and how should I update it?

roblohmann avatar Jun 24 '22 08:06 roblohmann

This file helps to track changes in public APIs. Run tests. Api approval test will fail. Remove .approved file and then rename .received file into .approved.

sungam3r avatar Jun 24 '22 10:06 sungam3r

This file helps to track changes in public APIs. Run tests. Api approval test will fail. Remove .approved file and then rename .received file into .approved.

Just pushed new changed with fixed tests.

roblohmann avatar Jun 24 '22 12:06 roblohmann

I'm fine to merge after fix approval file.

sungam3r avatar Oct 22 '22 21:10 sungam3r

I'm fine to merge after fix approval file.

Ah yes, ran into this before and forgotten about it. Glad this PR finally can be merged :-)

I'll have a look at the approval file this friday.

roblohmann avatar Nov 02 '22 13:11 roblohmann

I'm fine to merge after fix approval file.

Just updated the approval file. My apologies for the delay.

roblohmann avatar Nov 21 '22 08:11 roblohmann

@roblohmann Build failed since I made some changes a bit ago. #1539

sungam3r avatar Nov 21 '22 16:11 sungam3r

@sungam3r just merged remote master into this branch. PR should finally be able to go through now

roblohmann avatar Dec 21 '22 08:12 roblohmann

Nope. This code does not compile. See other tests.

sungam3r avatar Dec 21 '22 23:12 sungam3r

Nope. This code does not compile. See other tests.

Apologies, was in a rush when I merged and committed this. Also not on a machine with .net7. Just checked and updated the tests. Eveverything is atleast compiling. So I've put that remote now. Will check approval file at a later moment.

roblohmann avatar Dec 22 '22 15:12 roblohmann

🎉

sungam3r avatar Dec 22 '22 16:12 sungam3r

Looking through this code, it seems very limited. The ExpectedResponse needs to be the exact text (including case). Most health checks Ive seen give a return including totalDuration which will be different each time the url is called. This will mean the expected text will never work.

Something as simple as a list of expected strings that are contained in the response would better?

SteveSitekitcare avatar Dec 12 '23 14:12 SteveSitekitcare

@SteveSitekitcare feel free to open a new issue.

sungam3r avatar Jan 27 '24 07:01 sungam3r