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 5 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 24, 2024

@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?

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