Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test-only] add test for checking service ready and health #10351

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ScharfViktor
Copy link
Contributor

@ScharfViktor ScharfViktor commented Oct 18, 2024

releated #8783 #10316

I checked /healthz and /readyz of every services

my steps:

  • run nats separately ocis/bin/ocis nats server
  • run ocis without nats OCIS_INSECURE=true PROXY_ENABLE_BASIC_AUTH=true IDM_CREATE_DEMO_USERS=true OCIS_EXCLUDE_RUN_SERVICES=nats ocis/bin/ocis server
  • run test:
Scenario: health check extra services
    When a user requests these endpoints with "GET"
      | endpoint                      | service      | comment |
      | http://127.0.0.1:9260/healthz | clientlog |         |
    Then the HTTP status code of responses on all endpoints should be "200"
    When a user requests these endpoints with "GET"
      | endpoint                     | service      | comment |
      | http://127.0.0.1:9260/readyz | clientlog |         |
    Then the HTTP status code of responses on all endpoints should be "200"

Okay

  • stop nats->waiting->run test again
    http://127.0.0.1:9243/healthz -> okay
    http://127.0.0.1:9243/readyz - should be 500

run nats again

 When a user requests these endpoints with "GET"
      | endpoint                      | service      | comment |
      | http://127.0.0.1:9260/healthz | clientlog |         |
| http://127.0.0.1:9260/readyz | clientlog |         |
    Then the HTTP status code of responses on all endpoints should be "200"

@saw-jan regarding stop and start nats during the test:
let do it in the next PR:
I see two ways:

  • run/stop nats inside the ocis-server container in CI $command = "docker exec ocis-server ocis/bin/ocis nats server &";
  • or use wrapper for nats

Copy link

update-docs bot commented Oct 18, 2024

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

Copy link

sonarcloud bot commented Oct 23, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants