aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-07-20 12:06:39 +0200
committerChocobozzz <me@florianbigard.com>2023-07-20 12:06:39 +0200
commit305facdfab1d5029366d2262ac390b9c71752e4b (patch)
tree799f7e5686d0ac0b9ff63a06e686d6f1093168bc /server/tests/api/check-params
parent4e5da193d0ef69f7fc0ee1e7eb14f03de4d7a938 (diff)
downloadPeerTube-305facdfab1d5029366d2262ac390b9c71752e4b.tar.gz
PeerTube-305facdfab1d5029366d2262ac390b9c71752e4b.tar.zst
PeerTube-305facdfab1d5029366d2262ac390b9c71752e4b.zip
Add peers number and p2p enabled label to metrics
Diffstat (limited to 'server/tests/api/check-params')
-rw-r--r--server/tests/api/check-params/metrics.ts27
1 files changed, 23 insertions, 4 deletions
diff --git a/server/tests/api/check-params/metrics.ts b/server/tests/api/check-params/metrics.ts
index be8253217..25443401d 100644
--- a/server/tests/api/check-params/metrics.ts
+++ b/server/tests/api/check-params/metrics.ts
@@ -89,10 +89,6 @@ describe('Test metrics API validators', function () {
89 }) 89 })
90 }) 90 })
91 91
92 it('Should fail with a missing errors', async function () {
93
94 })
95
96 it('Should fail with an missing/invalid errors', async function () { 92 it('Should fail with an missing/invalid errors', async function () {
97 await makePostBodyRequest({ 93 await makePostBodyRequest({
98 url: server.url, 94 url: server.url,
@@ -149,6 +145,22 @@ describe('Test metrics API validators', function () {
149 }) 145 })
150 }) 146 })
151 147
148 it('Should fail with an invalid p2pEnabled', async function () {
149 await makePostBodyRequest({
150 url: server.url,
151 path,
152 fields: { ...baseParams, p2pEnabled: 'toto' }
153 })
154 })
155
156 it('Should fail with an invalid totalPeers', async function () {
157 await makePostBodyRequest({
158 url: server.url,
159 path,
160 fields: { ...baseParams, totalPeers: 'toto' }
161 })
162 })
163
152 it('Should fail with a bad video id', async function () { 164 it('Should fail with a bad video id', async function () {
153 await makePostBodyRequest({ 165 await makePostBodyRequest({
154 url: server.url, 166 url: server.url,
@@ -173,6 +185,13 @@ describe('Test metrics API validators', function () {
173 fields: baseParams, 185 fields: baseParams,
174 expectedStatus: HttpStatusCode.NO_CONTENT_204 186 expectedStatus: HttpStatusCode.NO_CONTENT_204
175 }) 187 })
188
189 await makePostBodyRequest({
190 url: server.url,
191 path,
192 fields: { ...baseParams, p2pEnabled: false, totalPeers: 32 },
193 expectedStatus: HttpStatusCode.NO_CONTENT_204
194 })
176 }) 195 })
177 }) 196 })
178 197