2i2c-org / infrastructure

Infrastructure for configuring and deploying our community JupyterHubs.
https://infrastructure.2i2c.org
BSD 3-Clause "New" or "Revised" License
103 stars 63 forks source link

Stop using pytest to run our hub health checks #1232

Open sgibson91 opened 2 years ago

sgibson91 commented 2 years ago

Context

We currently use pytest to run our hub health checks. Upon failure, pytest's output includes the parameters that were passed to the function. For us, this includes a JupyerHub API token which is secret. In order to prevent this from being leaked via CI logs, we currently do not print output when we run in CI environments. However, this adds extra toil to the engineering team since they would need to rerun the hub health check locally in order to see logs and hope that the problem can be reproduced using the deployer locally.

Proposal

Since we don't actually use any functionality pytest offers, we should remove the pytest dependency and call the functions as normal functions. This will allow diagnostic logs to be available in CI/CD without leaking the secret API token or requiring an engineer to do another run of the checks locally.

Updates and actions

No response

Related

yuvipanda commented 2 years ago

Fully support!

sgibson91 commented 12 months ago

Issue is specifically referencing this section:

https://github.com/2i2c-org/infrastructure/blob/75119bffacd7342347d1a219b7b2e3e9fa3f18c1/deployer/deployer.py#L390-L413

Note that we do use pytest to verify the deployer code itself, which is fine. This is only regarding running the hub health check.

consideRatio commented 12 months ago

I think this issue should be worked before #1206, and that #1206 is suitable work following this is done.