X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fserver%2Flogs.ts;h=697f10337980a27822c0df4eb1fd0b4e841b5e24;hb=bf54587a3e2ad9c2c186828f2a5682b91ee2cc00;hp=bcd94dda30618e6310d31c774e372b16d51c4fd3;hpb=a24bd1ed41b43790bab6ba789580bb4e85f07d85;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/server/logs.ts b/server/tests/api/server/logs.ts index bcd94dda3..697f10337 100644 --- a/server/tests/api/server/logs.ts +++ b/server/tests/api/server/logs.ts @@ -10,7 +10,7 @@ import { PeerTubeServer, setAccessTokensToServers, waitJobs -} from '@shared/extra-utils' +} from '@shared/server-commands' const expect = chai.expect @@ -71,7 +71,7 @@ describe('Test logs', function () { expect(logsString.includes('video 5')).to.be.false }) - it('Should get filter by level', async function () { + it('Should filter by level', async function () { this.timeout(20000) const now = new Date() @@ -94,6 +94,27 @@ describe('Test logs', function () { } }) + it('Should filter by tag', async function () { + const now = new Date() + + const { uuid } = await server.videos.upload({ attributes: { name: 'video 6' } }) + await waitJobs([ server ]) + + { + const body = await logsCommand.getLogs({ startDate: now, level: 'debug', tagsOneOf: [ 'toto' ] }) + expect(body).to.have.lengthOf(0) + } + + { + const body = await logsCommand.getLogs({ startDate: now, level: 'debug', tagsOneOf: [ uuid ] }) + expect(body).to.not.have.lengthOf(0) + + for (const line of body) { + expect(line.tags).to.contain(uuid) + } + } + }) + it('Should log ping requests', async function () { this.timeout(10000)