-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathe2e.misc.js
53 lines (45 loc) · 1.74 KB
/
e2e.misc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const {_it, axiosGet, clokiExtUrl} = require("./common");
_it('should get /ready', async () => {
expect((await axiosGet(`http://${clokiExtUrl}/ready`)).status).toEqual(200)
})
_it('should get /metrics', async () => {
expect((await axiosGet(`http://${clokiExtUrl}/metrics`)).status).toEqual(200)
})
/* _it('should get /influx/health', async () => {
expect((await axiosGet(`http://${clokiExtUrl}/influx/health`)).status).toEqual(200)
}) */
_it('should get /config', async () => {
expect((await axiosGet(`http://${clokiExtUrl}/config`)).status).toEqual(200)
})
_it('should get /api/v1/rules', async () => {
expect((await axiosGet(`http://${clokiExtUrl}/api/v1/rules`)).status).toEqual(200)
})
_it('should get /api/v1/metadata', async () => {
expect((await axiosGet(`http://${clokiExtUrl}/api/v1/metadata`)).status).toEqual(200)
})
_it('should get /api/v1/status/buildinfo', async () => {
expect((await axiosGet(`http://${clokiExtUrl}/api/v1/status/buildinfo`)).status).toEqual(200)
})
/* TODO: not supported on qryn-go
_it('should get /influx/api/v2/write/health', async () => {
expect((await axiosGet(`http://${clokiExtUrl}/influx/api/v2/write/health`)).status).toEqual(200)
})
*/
_it('should return 401 if no basic auth', async () => {
if (!process.env.QRYN_LOGIN) {
return
}
let e;
try {
await axiosGet(
`http://${clokiExtUrl}/influx/api/v2/write/health`,
{headers: {Authorization: 'Basic a'}}
)
} catch (err) {
e = err
}
expect(e.message).toContain("Error: Request failed with status code 401")
})
/* TODO: implement _it('should get /influx/health', async () => {
expect((await axiosGet(`http://${clokiExtUrl}/influx/health`)).status).toEqual(200)
}) */