goss-org / goss

Quick and Easy server testing/validation
https://goss.rocks
Apache License 2.0
5.58k stars 470 forks source link

check single resource #832

Closed matthew-hollick closed 1 year ago

matthew-hollick commented 1 year ago

Hi, Is there any way that I can check the status of a single resource? Something like:

curl localhost:8080/healthz/service/nginx

Cheers.

aelsabbahy commented 1 year ago

I'm not sure that I understand the question. But. if you need a test suite that contains a single test, you can just add one test.

goss add http http://localhost:8080/healthz/service/nginx

goss validate
matthew-hollick commented 1 year ago

Hi, thanks for getting back to me. Not quite, I explained poorly. I have a large set of tests with goss serving the result of all tests on /healthz There is a use case where not all the tests are needed. (The loadbalancer healthcheck should not care if sshd is running.) So as an optimisation I would like to query the status of just one test.

so, rather than using localhost:8080/healthz

I'm imagining something along the lines of: localhost:8080/healthz/<resource>/<instance>

aelsabbahy commented 1 year ago

Ah, unfortunately no. Goss is pretty much all or nothing in its execution.

There's skip support, but nothing that would allow dynamically running a subset or single test.