diff options
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/api/server/logs.ts | 23 |
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 | ||