Skip to content

Commit

Permalink
Fix transcription tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobozzz committed Jul 3, 2024
1 parent af11f81 commit efa5835
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/tests/src/api/videos/video-transcription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
} from '@peertube/peertube-server-commands'
import { FIXTURE_URLS } from '@tests/shared/fixture-urls.js'
import { checkAutoCaption, checkLanguage, checkNoCaption, uploadForTranscription } from '@tests/shared/transcription.js'
import { join } from 'path'

describe('Test video transcription', function () {
let servers: PeerTubeServer[]
Expand Down Expand Up @@ -89,14 +90,18 @@ describe('Test video transcription', function () {
privacy: VideoPrivacy.PUBLIC
})

const ffmpegCommand = sendRTMPStream({ rtmpBaseUrl: live.rtmpUrl, streamKey: live.streamKey })
const ffmpegCommand = sendRTMPStream({
rtmpBaseUrl: live.rtmpUrl,
streamKey: live.streamKey,
fixtureName: join('transcription', 'videos', 'the_last_man_on_earth.mp4')
})
await servers[0].live.waitUntilPublished({ videoId: video.id })

await stopFfmpeg(ffmpegCommand)

await servers[0].live.waitUntilReplacedByReplay({ videoId: video.id })
await waitJobs(servers)
await checkAutoCaption(servers, video.uuid, 'WEBVTT\n\n00:')
await checkAutoCaption(servers, video.uuid, new RegExp('^WEBVTT\\n\\n00:\\d{2}.\\d{3} --> 00:'))
await checkLanguage(servers, video.uuid, 'en')

await servers[0].config.enableLive({ allowReplay: false })
Expand Down

0 comments on commit efa5835

Please sign in to comment.