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

Merged
merged 8 commits into from
Nov 28, 2024

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

Default Services:

SERVICE HEALTH CHECK READINESS CHECK
activitylog ✅ Pass ✅ Pass
app-provider ✅ Pass ✅ Pass
app-registry ✅ Pass ✅ Pass
auth-basic ✅ Pass ✅ Pass
auth-machine ✅ Pass ✅ Pass
auth-service ✅ Pass ✅ Pass
clientlog ✅ Pass ✅ Pass
eventhistory ✅ Pass ✅ Pass
frontend ✅ Pass ✅ Pass
gateway ✅ Pass ✅ Pass
graph ✅ Pass ✅ Pass
groups ✅ Pass ✅ Pass
idm ✅ Pass ✅ Pass
idp ✅ Pass ✅ Pass
nats ✅ Pass ✅ Pass
ocdav ✅ Pass ✅ Pass
ocm ✅ Pass ✅ Pass
ocs ✅ Pass ✅ Pass
postprocessing ✅ Pass ✅ Pass
proxy ✅ Pass ✅ Pass
search ✅ Pass ✅ Pass
settings ✅ Pass ✅ Pass
sharing ✅ Pass ✅ Pass
sse ✅ Pass ✅ Pass
storage-publiclink ✅ Pass ✅ Pass
storage-shares ✅ Pass ✅ Pass
storage-system ✅ Pass ✅ Pass
storage-users ✅ Pass ✅ Pass
thumbnails ✅ Pass ✅ Pass
userlog ✅ Pass ✅ Pass
users ✅ Pass ✅ Pass
web ✅ Pass ✅ Pass
webdav ✅ Pass ✅ Pass
webfinger ✅ Pass ✅ Pass

Other Services

SERVICE HEALTH CHECK READINESS CHECK
audit ✅ Pass ✅ Pass
auth-app ✅ Pass ✅ Pass
auth-bearer ✅ Pass ✅ Pass
invitations ✅ Pass ✅ Pass
policies ✅ Pass ✅ Pass
antivirus ✅ Pass ✅ Pass
notification ✅ Pass ✅ Pass

Depriciated Services

SERVICE
store

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.

@ScharfViktor ScharfViktor force-pushed the healthzCheck branch 7 times, most recently from daaa9fd to 1976941 Compare October 22, 2024 17:39
@ScharfViktor ScharfViktor marked this pull request as ready for review October 22, 2024 18:47
@ScharfViktor ScharfViktor requested a review from saw-jan October 24, 2024 08:51
@ScharfViktor ScharfViktor force-pushed the healthzCheck branch 2 times, most recently from 94c59bd to b168017 Compare October 24, 2024 13:25
@ScharfViktor
Copy link
Contributor Author

CI red 🤯 tests start to run, but after a while the server crashes. can't understand the reason from the logs
I tried running ocis localy in docker using envs from ci - everything works fine

my running was:
docker run --rm -it --mount type=bind,source=/Users/scharfviktor/dockerocis/ocis/ocis-config,target=/etc/ocis -e IDM_ADMIN_PASSWORD=admin owncloud/ocis init

docker run     --name ocis-server --rm     -it     -p 9200:9200     --mount type=bind,source=/Users/scharfviktor/dockerocis/ocis/ocis-config,target=/etc/ocis     --mount type=bind,source=/Users/scharfviktor/dockerocis/ocis/ocis-data,target=/var/lib/ocis     -e OCIS_INSECURE=true     -e PROXY_HTTP_ADDR=0.0.0.0:9200     -e OCIS_URL=https://ocis-server:9200     -e CLIENTLOG_DEBUG_ADDR=0.0.0.0:9260     -e ACTIVITYLOG_DEBUG_ADDR=0.0.0.0:9197     -e APP_PROVIDER_DEBUG_ADDR=0.0.0.0:9165     -e APP_REGISTRY_DEBUG_ADDR=0.0.0.0:9243     -e AUTH_BASIC_DEBUG_ADDR=0.0.0.0:9147     -e AUTH_MACHINE_DEBUG_ADDR=0.0.0.0:9167     -e AUTH_SERVICE_DEBUG_ADDR=0.0.0.0:9198     -e EVENTHISTORY_DEBUG_ADDR=0.0.0.0:9270     -e FRONTEND_DEBUG_ADDR=0.0.0.0:9141     -e GATEWAY_DEBUG_ADDR=0.0.0.0:9143     -e GRAPH_DEBUG_ADDR=0.0.0.0:9124     -e GROUPS_DEBUG_ADDR=0.0.0.0:9161     -e IDM_DEBUG_ADDR=0.0.0.0:9239     -e IDP_DEBUG_ADDR=0.0.0.0:9134     -e NATS_DEBUG_ADDR=0.0.0.0:9234     -e OCDAV_DEBUG_ADDR=0.0.0.0:9163     -e OCM_DEBUG_ADDR=0.0.0.0:9281     -e OCS_DEBUG_ADDR=0.0.0.0:9114     -e POSTPROCESSING_DEBUG_ADDR=0.0.0.0:9255     -e PROXY_DEBUG_ADDR=0.0.0.0:9205     -e SEARCH_DEBUG_ADDR=0.0.0.0:9224     -e SETTINGS_DEBUG_ADDR=0.0.0.0:9194     -e SHARING_DEBUG_ADDR=0.0.0.0:9151     -e SSE_DEBUG_ADDR=0.0.0.0:9135     -e STORAGE_PUBLICLINK_DEBUG_ADDR=0.0.0.0:9179     -e STORAGE_SHARES_DEBUG_ADDR=0.0.0.0:9156     -e STORAGE_SYSTEM_DEBUG_ADDR=0.0.0.0:9217     -e STORAGE_USERS_DEBUG_ADDR=0.0.0.0:9159     -e THUMBNAILS_DEBUG_ADDR=0.0.0.0:9189     -e USERLOG_DEBUG_ADDR=0.0.0.0:9214     -e USERS_DEBUG_ADDR=0.0.0.0:9145     -e WEB_DEBUG_ADDR=0.0.0.0:9104     -e WEBDAV_DEBUG_ADDR=0.0.0.0:9119     -e OCIS_ASYNC_UPLOADS=True     -e OCIS_EVENTS_ENABLE_TLS=false     -e MICRO_REGISTRY=nats-js-kv     -e MICRO_REGISTRY_ADDRESS=127.0.0.1:9233     -e NATS_NATS_HOST=0.0.0.0     -e NATS_NATS_PORT=9233     -e OCIS_JWT_SECRET=some-ocis-jwt-secret     -e EVENTHISTORY_STORE=memory     -e GRAPH_AVAILABLE_ROLES=b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5,a8d5fe5e-96e3-418d-825b-534dbdf22b99,fb6c3e19-e378-47e5-b277-9732f9de6e21,58c63c02-1d89-4572-916a-870abc5a1b7d,2d00ce52-1fc2-4dbc-8b95-a73b73395f5a,1c996275-f1c9-4e71-abdf-a42f6495e960,312c0871-5ef7-4b3a-85b6-0e4074c64049,aa97fe03-7980-45ac-9e50-b325749fd7e6   -e PROXY_ENABLE_BASIC_AUTH=true  owncloud/ocis

@saw-jan
Copy link
Member

saw-jan commented Oct 25, 2024

Could be related to #10405?

@PrajwolAmatya PrajwolAmatya self-assigned this Nov 21, 2024
@PrajwolAmatya PrajwolAmatya force-pushed the healthzCheck branch 2 times, most recently from e834c88 to 2b90255 Compare November 25, 2024 08:42
Copy link
Member

@saw-jan saw-jan left a comment

Choose a reason for hiding this comment

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

looks good 👍

@PrajwolAmatya PrajwolAmatya merged commit 0252306 into master Nov 28, 2024
4 checks passed
@PrajwolAmatya PrajwolAmatya deleted the healthzCheck branch November 28, 2024 11:11
ownclouders pushed a commit that referenced this pull request Nov 28, 2024
[test-only] add test for checking service ready and health
ownclouders pushed a commit that referenced this pull request Nov 29, 2024
[test-only] add test for checking service ready and health
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants