aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-20 14:23:32 +0200
committerChocobozzz <me@florianbigard.com>2021-10-20 14:33:38 +0200
commit64553e8809271df1113e9143426a27f234410a74 (patch)
treebeba7a8d4016b74dd3b85e8081482a3ea6d00eaf /server/tests/api
parent1243729899082a71b3a3efb759df1478d9ea5c83 (diff)
downloadPeerTube-64553e8809271df1113e9143426a27f234410a74.tar.gz
PeerTube-64553e8809271df1113e9143426a27f234410a74.tar.zst
PeerTube-64553e8809271df1113e9143426a27f234410a74.zip
Add ability to filter logs by tags
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/server/logs.ts23
1 files changed, 22 insertions, 1 deletions
diff --git a/server/tests/api/server/logs.ts b/server/tests/api/server/logs.ts
index bcd94dda3..4fa13886e 100644
--- a/server/tests/api/server/logs.ts
+++ b/server/tests/api/server/logs.ts
@@ -71,7 +71,7 @@ describe('Test logs', function () {
71 expect(logsString.includes('video 5')).to.be.false 71 expect(logsString.includes('video 5')).to.be.false
72 }) 72 })
73 73
74 it('Should get filter by level', async function () { 74 it('Should filter by level', async function () {
75 this.timeout(20000) 75 this.timeout(20000)
76 76
77 const now = new Date() 77 const now = new Date()
@@ -94,6 +94,27 @@ describe('Test logs', function () {
94 } 94 }
95 }) 95 })
96 96
97 it('Should filter by tag', async function () {
98 const now = new Date()
99
100 const { uuid } = await server.videos.upload({ attributes: { name: 'video 6' } })
101 await waitJobs([ server ])
102
103 {
104 const body = await logsCommand.getLogs({ startDate: now, level: 'debug', tagsOneOf: [ 'toto' ] })
105 expect(body).to.have.lengthOf(0)
106 }
107
108 {
109 const body = await logsCommand.getLogs({ startDate: now, level: 'debug', tagsOneOf: [ uuid ] })
110 expect(body).to.not.have.lengthOf(0)
111
112 for (const line of body) {
113 expect(line.tags).to.contain(uuid)
114 }
115 }
116 })
117
97 it('Should log ping requests', async function () { 118 it('Should log ping requests', async function () {
98 this.timeout(10000) 119 this.timeout(10000)
99 120