mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 17:59:37 +02:00
Shorter server command names
This commit is contained in:
parent
d23dd9fbfc
commit
89d241a79c
155 changed files with 2508 additions and 2508 deletions
|
@ -19,17 +19,17 @@ import { VideoPrivacy } from '@shared/models'
|
|||
async function createLiveWrapper (server: ServerInfo) {
|
||||
const liveAttributes = {
|
||||
name: 'live video',
|
||||
channelId: server.videoChannel.id,
|
||||
channelId: server.store.channel.id,
|
||||
privacy: VideoPrivacy.PUBLIC
|
||||
}
|
||||
|
||||
const { uuid } = await server.liveCommand.create({ fields: liveAttributes })
|
||||
const { uuid } = await server.live.create({ fields: liveAttributes })
|
||||
|
||||
return uuid
|
||||
}
|
||||
|
||||
function updateConf (server: ServerInfo, vodProfile: string, liveProfile: string) {
|
||||
return server.configCommand.updateCustomSubConfig({
|
||||
return server.config.updateCustomSubConfig({
|
||||
newConfig: {
|
||||
transcoding: {
|
||||
enabled: true,
|
||||
|
@ -79,7 +79,7 @@ describe('Test transcoding plugins', function () {
|
|||
describe('When using a plugin adding profiles to existing encoders', function () {
|
||||
|
||||
async function checkVideoFPS (uuid: string, type: 'above' | 'below', fps: number) {
|
||||
const video = await server.videosCommand.get({ id: uuid })
|
||||
const video = await server.videos.get({ id: uuid })
|
||||
const files = video.files.concat(...video.streamingPlaylists.map(p => p.files))
|
||||
|
||||
for (const file of files) {
|
||||
|
@ -103,11 +103,11 @@ describe('Test transcoding plugins', function () {
|
|||
}
|
||||
|
||||
before(async function () {
|
||||
await server.pluginsCommand.install({ path: PluginsCommand.getPluginTestPath('-transcoding-one') })
|
||||
await server.plugins.install({ path: PluginsCommand.getPluginTestPath('-transcoding-one') })
|
||||
})
|
||||
|
||||
it('Should have the appropriate available profiles', async function () {
|
||||
const config = await server.configCommand.getConfig()
|
||||
const config = await server.config.getConfig()
|
||||
|
||||
expect(config.transcoding.availableProfiles).to.have.members([ 'default', 'low-vod', 'input-options-vod', 'bad-scale-vod' ])
|
||||
expect(config.live.transcoding.availableProfiles).to.have.members([ 'default', 'low-live', 'input-options-live', 'bad-scale-live' ])
|
||||
|
@ -116,7 +116,7 @@ describe('Test transcoding plugins', function () {
|
|||
it('Should not use the plugin profile if not chosen by the admin', async function () {
|
||||
this.timeout(240000)
|
||||
|
||||
const videoUUID = (await server.videosCommand.quickUpload({ name: 'video' })).uuid
|
||||
const videoUUID = (await server.videos.quickUpload({ name: 'video' })).uuid
|
||||
await waitJobs([ server ])
|
||||
|
||||
await checkVideoFPS(videoUUID, 'above', 20)
|
||||
|
@ -127,7 +127,7 @@ describe('Test transcoding plugins', function () {
|
|||
|
||||
await updateConf(server, 'low-vod', 'default')
|
||||
|
||||
const videoUUID = (await server.videosCommand.quickUpload({ name: 'video' })).uuid
|
||||
const videoUUID = (await server.videos.quickUpload({ name: 'video' })).uuid
|
||||
await waitJobs([ server ])
|
||||
|
||||
await checkVideoFPS(videoUUID, 'below', 12)
|
||||
|
@ -138,7 +138,7 @@ describe('Test transcoding plugins', function () {
|
|||
|
||||
await updateConf(server, 'input-options-vod', 'default')
|
||||
|
||||
const videoUUID = (await server.videosCommand.quickUpload({ name: 'video' })).uuid
|
||||
const videoUUID = (await server.videos.quickUpload({ name: 'video' })).uuid
|
||||
await waitJobs([ server ])
|
||||
|
||||
await checkVideoFPS(videoUUID, 'below', 6)
|
||||
|
@ -149,11 +149,11 @@ describe('Test transcoding plugins', function () {
|
|||
|
||||
await updateConf(server, 'bad-scale-vod', 'default')
|
||||
|
||||
const videoUUID = (await server.videosCommand.quickUpload({ name: 'video' })).uuid
|
||||
const videoUUID = (await server.videos.quickUpload({ name: 'video' })).uuid
|
||||
await waitJobs([ server ])
|
||||
|
||||
// Transcoding failed
|
||||
const video = await server.videosCommand.get({ id: videoUUID })
|
||||
const video = await server.videos.get({ id: videoUUID })
|
||||
expect(video.files).to.have.lengthOf(1)
|
||||
expect(video.streamingPlaylists).to.have.lengthOf(0)
|
||||
})
|
||||
|
@ -163,8 +163,8 @@ describe('Test transcoding plugins', function () {
|
|||
|
||||
const liveVideoId = await createLiveWrapper(server)
|
||||
|
||||
await server.liveCommand.sendRTMPStreamInVideo({ videoId: liveVideoId, fixtureName: 'video_short2.webm' })
|
||||
await server.liveCommand.waitUntilPublished({ videoId: liveVideoId })
|
||||
await server.live.sendRTMPStreamInVideo({ videoId: liveVideoId, fixtureName: 'video_short2.webm' })
|
||||
await server.live.waitUntilPublished({ videoId: liveVideoId })
|
||||
await waitJobs([ server ])
|
||||
|
||||
await checkLiveFPS(liveVideoId, 'above', 20)
|
||||
|
@ -177,8 +177,8 @@ describe('Test transcoding plugins', function () {
|
|||
|
||||
const liveVideoId = await createLiveWrapper(server)
|
||||
|
||||
await server.liveCommand.sendRTMPStreamInVideo({ videoId: liveVideoId, fixtureName: 'video_short2.webm' })
|
||||
await server.liveCommand.waitUntilPublished({ videoId: liveVideoId })
|
||||
await server.live.sendRTMPStreamInVideo({ videoId: liveVideoId, fixtureName: 'video_short2.webm' })
|
||||
await server.live.waitUntilPublished({ videoId: liveVideoId })
|
||||
await waitJobs([ server ])
|
||||
|
||||
await checkLiveFPS(liveVideoId, 'below', 12)
|
||||
|
@ -191,8 +191,8 @@ describe('Test transcoding plugins', function () {
|
|||
|
||||
const liveVideoId = await createLiveWrapper(server)
|
||||
|
||||
await server.liveCommand.sendRTMPStreamInVideo({ videoId: liveVideoId, fixtureName: 'video_short2.webm' })
|
||||
await server.liveCommand.waitUntilPublished({ videoId: liveVideoId })
|
||||
await server.live.sendRTMPStreamInVideo({ videoId: liveVideoId, fixtureName: 'video_short2.webm' })
|
||||
await server.live.waitUntilPublished({ videoId: liveVideoId })
|
||||
await waitJobs([ server ])
|
||||
|
||||
await checkLiveFPS(liveVideoId, 'below', 6)
|
||||
|
@ -205,21 +205,21 @@ describe('Test transcoding plugins', function () {
|
|||
|
||||
const liveVideoId = await createLiveWrapper(server)
|
||||
|
||||
const command = await server.liveCommand.sendRTMPStreamInVideo({ videoId: liveVideoId, fixtureName: 'video_short2.webm' })
|
||||
const command = await server.live.sendRTMPStreamInVideo({ videoId: liveVideoId, fixtureName: 'video_short2.webm' })
|
||||
await testFfmpegStreamError(command, true)
|
||||
})
|
||||
|
||||
it('Should default to the default profile if the specified profile does not exist', async function () {
|
||||
this.timeout(240000)
|
||||
|
||||
await server.pluginsCommand.uninstall({ npmName: 'peertube-plugin-test-transcoding-one' })
|
||||
await server.plugins.uninstall({ npmName: 'peertube-plugin-test-transcoding-one' })
|
||||
|
||||
const config = await server.configCommand.getConfig()
|
||||
const config = await server.config.getConfig()
|
||||
|
||||
expect(config.transcoding.availableProfiles).to.deep.equal([ 'default' ])
|
||||
expect(config.live.transcoding.availableProfiles).to.deep.equal([ 'default' ])
|
||||
|
||||
const videoUUID = (await server.videosCommand.quickUpload({ name: 'video' })).uuid
|
||||
const videoUUID = (await server.videos.quickUpload({ name: 'video' })).uuid
|
||||
await waitJobs([ server ])
|
||||
|
||||
await checkVideoFPS(videoUUID, 'above', 20)
|
||||
|
@ -230,7 +230,7 @@ describe('Test transcoding plugins', function () {
|
|||
describe('When using a plugin adding new encoders', function () {
|
||||
|
||||
before(async function () {
|
||||
await server.pluginsCommand.install({ path: PluginsCommand.getPluginTestPath('-transcoding-two') })
|
||||
await server.plugins.install({ path: PluginsCommand.getPluginTestPath('-transcoding-two') })
|
||||
|
||||
await updateConf(server, 'test-vod-profile', 'test-live-profile')
|
||||
})
|
||||
|
@ -238,10 +238,10 @@ describe('Test transcoding plugins', function () {
|
|||
it('Should use the new vod encoders', async function () {
|
||||
this.timeout(240000)
|
||||
|
||||
const videoUUID = (await server.videosCommand.quickUpload({ name: 'video', fixture: 'video_short_240p.mp4' })).uuid
|
||||
const videoUUID = (await server.videos.quickUpload({ name: 'video', fixture: 'video_short_240p.mp4' })).uuid
|
||||
await waitJobs([ server ])
|
||||
|
||||
const path = server.serversCommand.buildDirectory(join('videos', videoUUID + '-240.mp4'))
|
||||
const path = server.servers.buildDirectory(join('videos', videoUUID + '-240.mp4'))
|
||||
const audioProbe = await getAudioStream(path)
|
||||
expect(audioProbe.audioStream.codec_name).to.equal('opus')
|
||||
|
||||
|
@ -254,8 +254,8 @@ describe('Test transcoding plugins', function () {
|
|||
|
||||
const liveVideoId = await createLiveWrapper(server)
|
||||
|
||||
await server.liveCommand.sendRTMPStreamInVideo({ videoId: liveVideoId, fixtureName: 'video_short2.webm' })
|
||||
await server.liveCommand.waitUntilPublished({ videoId: liveVideoId })
|
||||
await server.live.sendRTMPStreamInVideo({ videoId: liveVideoId, fixtureName: 'video_short2.webm' })
|
||||
await server.live.waitUntilPublished({ videoId: liveVideoId })
|
||||
await waitJobs([ server ])
|
||||
|
||||
const playlistUrl = `${server.url}/static/streaming-playlists/hls/${liveVideoId}/0.m3u8`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue