2024-03-05 18:15:30 +00:00
|
|
|
import request from 'supertest';
|
2023-10-17 23:37:17 +00:00
|
|
|
import { expect } from 'chai';
|
2022-11-02 18:56:48 +00:00
|
|
|
|
|
|
|
const BALENA_SUPERVISOR_ADDRESS =
|
|
|
|
process.env.BALENA_SUPERVISOR_ADDRESS || 'http://balena-supervisor:48484';
|
|
|
|
|
|
|
|
describe('supervisor app', () => {
|
2023-10-17 23:37:17 +00:00
|
|
|
it('the supervisor app runs and the API responds to /v1/healthy', async () => {
|
|
|
|
await request(BALENA_SUPERVISOR_ADDRESS)
|
|
|
|
.get('/v1/healthy')
|
|
|
|
.then(({ status }) => {
|
|
|
|
// There's a chance that the endpoint will respond with 500
|
|
|
|
// due to memory healthcheck failure, which we can't easily
|
|
|
|
// control as it's checking memory in the balena-supervisor
|
|
|
|
// container. So in this case, just check that the healthcheck
|
|
|
|
// failed due to memory instead of anything else.
|
|
|
|
expect(status).to.be.oneOf([200, 500]);
|
|
|
|
});
|
2022-11-02 18:56:48 +00:00
|
|
|
});
|
|
|
|
});
|