Don't rely on youtube for tests
Use another import URL when possible, and disable import tests when we want to do a youtube import test
This commit is contained in:
parent
b9fe9a7ffd
commit
b488ba1e26
10 changed files with 64 additions and 49 deletions
10
.github/workflows/test.yml
vendored
10
.github/workflows/test.yml
vendored
|
@ -22,13 +22,15 @@ jobs:
|
||||||
POSTGRES_HOST_AUTH_METHOD: trust
|
POSTGRES_HOST_AUTH_METHOD: trust
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
test_suite: [ misc, api-1, api-2, api-3, api-4, cli, lint ]
|
test_suite: [ misc, api-1, api-2, api-3, api-4, cli, lint ]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PGUSER: peertube
|
PGUSER: peertube
|
||||||
PGHOST: localhost
|
PGHOST: localhost
|
||||||
|
DISABLE_HTTP_IMPORT_TESTS: true
|
||||||
|
NODE_PENDING_JOB_WAIT: 2000
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@ -50,7 +52,9 @@ jobs:
|
||||||
- name: Cache Node.js modules
|
- name: Cache Node.js modules
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/yarn
|
path: |
|
||||||
|
**/node_modules
|
||||||
|
~/fixtures
|
||||||
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
|
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.OS }}-node-
|
${{ runner.OS }}-node-
|
||||||
|
@ -69,5 +73,5 @@ jobs:
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
name: test-storages
|
name: test-storages-${{ matrix.test_suite }}
|
||||||
path: test*/logs
|
path: test*/logs
|
||||||
|
|
|
@ -21,7 +21,7 @@ if [ "$1" = "misc" ]; then
|
||||||
server/tests/plugins/index.ts
|
server/tests/plugins/index.ts
|
||||||
elif [ "$1" = "cli" ]; then
|
elif [ "$1" = "cli" ]; then
|
||||||
npm run build:server
|
npm run build:server
|
||||||
CC=gcc-4.9 CXX=g++-4.9 npm run setup:cli
|
npm run setup:cli
|
||||||
mocha --timeout 5000 --exit --require ts-node/register --require tsconfig-paths/register --bail server/tests/cli/index.ts
|
mocha --timeout 5000 --exit --require ts-node/register --require tsconfig-paths/register --bail server/tests/cli/index.ts
|
||||||
elif [ "$1" = "api-1" ]; then
|
elif [ "$1" = "api-1" ]; then
|
||||||
npm run build:server
|
npm run build:server
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||||
|
|
||||||
import { omit } from 'lodash'
|
|
||||||
import 'mocha'
|
import 'mocha'
|
||||||
|
import { expect } from 'chai'
|
||||||
|
import { omit } from 'lodash'
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { User, UserRole, VideoImport, VideoImportState } from '../../../../shared'
|
import { User, UserRole, VideoImport, VideoImportState } from '../../../../shared'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
addVideoChannel,
|
addVideoChannel,
|
||||||
blockUser,
|
blockUser,
|
||||||
|
@ -31,17 +31,16 @@ import {
|
||||||
uploadVideo,
|
uploadVideo,
|
||||||
userLogin
|
userLogin
|
||||||
} from '../../../../shared/extra-utils'
|
} from '../../../../shared/extra-utils'
|
||||||
|
import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email'
|
||||||
import {
|
import {
|
||||||
checkBadCountPagination,
|
checkBadCountPagination,
|
||||||
checkBadSortPagination,
|
checkBadSortPagination,
|
||||||
checkBadStartPagination
|
checkBadStartPagination
|
||||||
} from '../../../../shared/extra-utils/requests/check-api-params'
|
} from '../../../../shared/extra-utils/requests/check-api-params'
|
||||||
import { getMagnetURI, getMyVideoImports, getYoutubeVideoUrl, importVideo } from '../../../../shared/extra-utils/videos/video-imports'
|
|
||||||
import { VideoPrivacy } from '../../../../shared/models/videos'
|
|
||||||
import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
|
import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
|
||||||
import { expect } from 'chai'
|
import { getMagnetURI, getMyVideoImports, getGoodVideoUrl, importVideo } from '../../../../shared/extra-utils/videos/video-imports'
|
||||||
import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model'
|
import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model'
|
||||||
import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email'
|
import { VideoPrivacy } from '../../../../shared/models/videos'
|
||||||
|
|
||||||
describe('Test users API validators', function () {
|
describe('Test users API validators', function () {
|
||||||
const path = '/api/v1/users/'
|
const path = '/api/v1/users/'
|
||||||
|
@ -1047,7 +1046,7 @@ describe('Test users API validators', function () {
|
||||||
channelId: 1,
|
channelId: 1,
|
||||||
privacy: VideoPrivacy.PUBLIC
|
privacy: VideoPrivacy.PUBLIC
|
||||||
}
|
}
|
||||||
await importVideo(server.url, server.accessToken, immutableAssign(baseAttributes, { targetUrl: getYoutubeVideoUrl() }))
|
await importVideo(server.url, server.accessToken, immutableAssign(baseAttributes, { targetUrl: getGoodVideoUrl() }))
|
||||||
await importVideo(server.url, server.accessToken, immutableAssign(baseAttributes, { magnetUri: getMagnetURI() }))
|
await importVideo(server.url, server.accessToken, immutableAssign(baseAttributes, { magnetUri: getMagnetURI() }))
|
||||||
await importVideo(server.url, server.accessToken, immutableAssign(baseAttributes, { torrentfile: 'video-720p.torrent' as any }))
|
await importVideo(server.url, server.accessToken, immutableAssign(baseAttributes, { torrentfile: 'video-720p.torrent' as any }))
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||||
|
|
||||||
import { omit } from 'lodash'
|
|
||||||
import 'mocha'
|
import 'mocha'
|
||||||
|
import { omit } from 'lodash'
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum'
|
|
||||||
import {
|
import {
|
||||||
cleanupTests,
|
cleanupTests,
|
||||||
createUser,
|
createUser,
|
||||||
|
@ -23,7 +22,8 @@ import {
|
||||||
checkBadSortPagination,
|
checkBadSortPagination,
|
||||||
checkBadStartPagination
|
checkBadStartPagination
|
||||||
} from '../../../../shared/extra-utils/requests/check-api-params'
|
} from '../../../../shared/extra-utils/requests/check-api-params'
|
||||||
import { getMagnetURI, getYoutubeVideoUrl } from '../../../../shared/extra-utils/videos/video-imports'
|
import { getMagnetURI, getGoodVideoUrl } from '../../../../shared/extra-utils/videos/video-imports'
|
||||||
|
import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum'
|
||||||
|
|
||||||
describe('Test video imports API validator', function () {
|
describe('Test video imports API validator', function () {
|
||||||
const path = '/api/v1/videos/imports'
|
const path = '/api/v1/videos/imports'
|
||||||
|
@ -76,7 +76,7 @@ describe('Test video imports API validator', function () {
|
||||||
|
|
||||||
before(function () {
|
before(function () {
|
||||||
baseCorrectParams = {
|
baseCorrectParams = {
|
||||||
targetUrl: getYoutubeVideoUrl(),
|
targetUrl: getGoodVideoUrl(),
|
||||||
name: 'my super name',
|
name: 'my super name',
|
||||||
category: 5,
|
category: 5,
|
||||||
licence: 1,
|
licence: 1,
|
||||||
|
@ -246,15 +246,13 @@ describe('Test video imports API validator', function () {
|
||||||
it('Should succeed with the correct parameters', async function () {
|
it('Should succeed with the correct parameters', async function () {
|
||||||
this.timeout(30000)
|
this.timeout(30000)
|
||||||
|
|
||||||
{
|
await makePostBodyRequest({
|
||||||
await makePostBodyRequest({
|
url: server.url,
|
||||||
url: server.url,
|
path,
|
||||||
path,
|
token: server.accessToken,
|
||||||
token: server.accessToken,
|
fields: baseCorrectParams,
|
||||||
fields: baseCorrectParams,
|
statusCodeExpected: 200
|
||||||
statusCodeExpected: 200
|
})
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should forbid to import http videos', async function () {
|
it('Should forbid to import http videos', async function () {
|
||||||
|
|
|
@ -24,7 +24,7 @@ import {
|
||||||
prepareNotificationsTest
|
prepareNotificationsTest
|
||||||
} from '../../../../shared/extra-utils/users/user-notifications'
|
} from '../../../../shared/extra-utils/users/user-notifications'
|
||||||
import { addUserSubscription, removeUserSubscription } from '../../../../shared/extra-utils/users/user-subscriptions'
|
import { addUserSubscription, removeUserSubscription } from '../../../../shared/extra-utils/users/user-subscriptions'
|
||||||
import { getBadVideoUrl, getYoutubeVideoUrl, importVideo } from '../../../../shared/extra-utils/videos/video-imports'
|
import { getBadVideoUrl, getGoodVideoUrl, importVideo } from '../../../../shared/extra-utils/videos/video-imports'
|
||||||
import { UserNotification, UserNotificationType } from '../../../../shared/models/users'
|
import { UserNotification, UserNotificationType } from '../../../../shared/models/users'
|
||||||
import { VideoPrivacy } from '../../../../shared/models/videos'
|
import { VideoPrivacy } from '../../../../shared/models/videos'
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ describe('Test user notifications', function () {
|
||||||
name,
|
name,
|
||||||
channelId,
|
channelId,
|
||||||
privacy: VideoPrivacy.PUBLIC,
|
privacy: VideoPrivacy.PUBLIC,
|
||||||
targetUrl: getYoutubeVideoUrl()
|
targetUrl: getGoodVideoUrl()
|
||||||
}
|
}
|
||||||
const res = await importVideo(servers[0].url, servers[0].accessToken, attributes)
|
const res = await importVideo(servers[0].url, servers[0].accessToken, attributes)
|
||||||
const uuid = res.body.video.uuid
|
const uuid = res.body.video.uuid
|
||||||
|
@ -284,7 +284,7 @@ describe('Test user notifications', function () {
|
||||||
name,
|
name,
|
||||||
channelId,
|
channelId,
|
||||||
privacy: VideoPrivacy.PUBLIC,
|
privacy: VideoPrivacy.PUBLIC,
|
||||||
targetUrl: getYoutubeVideoUrl(),
|
targetUrl: getGoodVideoUrl(),
|
||||||
waitTranscoding: true
|
waitTranscoding: true
|
||||||
}
|
}
|
||||||
const res = await importVideo(servers[1].url, servers[1].accessToken, attributes)
|
const res = await importVideo(servers[1].url, servers[1].accessToken, attributes)
|
||||||
|
@ -371,13 +371,13 @@ describe('Test user notifications', function () {
|
||||||
name,
|
name,
|
||||||
channelId,
|
channelId,
|
||||||
privacy: VideoPrivacy.PRIVATE,
|
privacy: VideoPrivacy.PRIVATE,
|
||||||
targetUrl: getYoutubeVideoUrl()
|
targetUrl: getGoodVideoUrl()
|
||||||
}
|
}
|
||||||
const res = await importVideo(servers[0].url, servers[0].accessToken, attributes)
|
const res = await importVideo(servers[0].url, servers[0].accessToken, attributes)
|
||||||
const uuid = res.body.video.uuid
|
const uuid = res.body.video.uuid
|
||||||
|
|
||||||
await waitJobs(servers)
|
await waitJobs(servers)
|
||||||
await checkMyVideoImportIsFinished(baseParams, name, uuid, getYoutubeVideoUrl(), true, 'presence')
|
await checkMyVideoImportIsFinished(baseParams, name, uuid, getGoodVideoUrl(), true, 'presence')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||||
|
|
||||||
|
import 'mocha'
|
||||||
import * as chai from 'chai'
|
import * as chai from 'chai'
|
||||||
import { orderBy } from 'lodash'
|
import { orderBy } from 'lodash'
|
||||||
import 'mocha'
|
|
||||||
import {
|
import {
|
||||||
addVideoToBlacklist,
|
addVideoToBlacklist,
|
||||||
cleanupTests,
|
cleanupTests,
|
||||||
|
@ -25,10 +25,10 @@ import {
|
||||||
} from '../../../../shared/extra-utils/index'
|
} from '../../../../shared/extra-utils/index'
|
||||||
import { doubleFollow } from '../../../../shared/extra-utils/server/follows'
|
import { doubleFollow } from '../../../../shared/extra-utils/server/follows'
|
||||||
import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
|
import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
|
||||||
import { VideoBlacklist, VideoBlacklistType } from '../../../../shared/models/videos'
|
import { getGoodVideoUrl, getMagnetURI, importVideo } from '../../../../shared/extra-utils/videos/video-imports'
|
||||||
import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model'
|
|
||||||
import { User, UserRole } from '../../../../shared/models/users'
|
import { User, UserRole } from '../../../../shared/models/users'
|
||||||
import { getMagnetURI, getYoutubeVideoUrl, importVideo } from '../../../../shared/extra-utils/videos/video-imports'
|
import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model'
|
||||||
|
import { VideoBlacklist, VideoBlacklistType } from '../../../../shared/models/videos'
|
||||||
|
|
||||||
const expect = chai.expect
|
const expect = chai.expect
|
||||||
|
|
||||||
|
@ -424,7 +424,7 @@ describe('Test video blacklist', function () {
|
||||||
this.timeout(15000)
|
this.timeout(15000)
|
||||||
|
|
||||||
const attributes = {
|
const attributes = {
|
||||||
targetUrl: getYoutubeVideoUrl(),
|
targetUrl: getGoodVideoUrl(),
|
||||||
name: 'URL import',
|
name: 'URL import',
|
||||||
channelId: channelOfUserWithoutFlag
|
channelId: channelOfUserWithoutFlag
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||||
|
|
||||||
import * as chai from 'chai'
|
|
||||||
import 'mocha'
|
import 'mocha'
|
||||||
import { VideoDetails, VideoImport, VideoPrivacy, VideoCaption } from '../../../../shared/models/videos'
|
import * as chai from 'chai'
|
||||||
import {
|
import {
|
||||||
cleanupTests,
|
cleanupTests,
|
||||||
doubleFollow,
|
doubleFollow,
|
||||||
|
@ -11,15 +10,16 @@ import {
|
||||||
getMyVideos,
|
getMyVideos,
|
||||||
getVideo,
|
getVideo,
|
||||||
getVideosList,
|
getVideosList,
|
||||||
listVideoCaptions,
|
|
||||||
testCaptionFile,
|
|
||||||
immutableAssign,
|
immutableAssign,
|
||||||
|
listVideoCaptions,
|
||||||
ServerInfo,
|
ServerInfo,
|
||||||
setAccessTokensToServers
|
setAccessTokensToServers,
|
||||||
|
testCaptionFile
|
||||||
} from '../../../../shared/extra-utils'
|
} from '../../../../shared/extra-utils'
|
||||||
|
import { areHttpImportTestsDisabled, testImage } from '../../../../shared/extra-utils/miscs/miscs'
|
||||||
import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
|
import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
|
||||||
import { getMagnetURI, getMyVideoImports, getYoutubeVideoUrl, importVideo } from '../../../../shared/extra-utils/videos/video-imports'
|
import { getMagnetURI, getMyVideoImports, getYoutubeVideoUrl, importVideo } from '../../../../shared/extra-utils/videos/video-imports'
|
||||||
import { testImage } from '../../../../shared/extra-utils/miscs/miscs'
|
import { VideoCaption, VideoDetails, VideoImport, VideoPrivacy } from '../../../../shared/models/videos'
|
||||||
|
|
||||||
const expect = chai.expect
|
const expect = chai.expect
|
||||||
|
|
||||||
|
@ -28,6 +28,8 @@ describe('Test video imports', function () {
|
||||||
let channelIdServer1: number
|
let channelIdServer1: number
|
||||||
let channelIdServer2: number
|
let channelIdServer2: number
|
||||||
|
|
||||||
|
if (areHttpImportTestsDisabled()) return
|
||||||
|
|
||||||
async function checkVideosServer1 (url: string, idHttp: string, idMagnet: string, idTorrent: string) {
|
async function checkVideosServer1 (url: string, idHttp: string, idMagnet: string, idTorrent: string) {
|
||||||
const resHttp = await getVideo(url, idHttp)
|
const resHttp = await getVideo(url, idHttp)
|
||||||
const videoHttp: VideoDetails = resHttp.body
|
const videoHttp: VideoDetails = resHttp.body
|
||||||
|
|
|
@ -24,7 +24,7 @@ import {
|
||||||
waitJobs
|
waitJobs
|
||||||
} from '../../../shared/extra-utils'
|
} from '../../../shared/extra-utils'
|
||||||
import { cleanupTests, flushAndRunMultipleServers, ServerInfo } from '../../../shared/extra-utils/server/servers'
|
import { cleanupTests, flushAndRunMultipleServers, ServerInfo } from '../../../shared/extra-utils/server/servers'
|
||||||
import { getMyVideoImports, getYoutubeVideoUrl, importVideo } from '../../../shared/extra-utils/videos/video-imports'
|
import { getGoodVideoUrl, getMyVideoImports, importVideo } from '../../../shared/extra-utils/videos/video-imports'
|
||||||
import { VideoDetails, VideoImport, VideoImportState, VideoPrivacy } from '../../../shared/models/videos'
|
import { VideoDetails, VideoImport, VideoImportState, VideoPrivacy } from '../../../shared/models/videos'
|
||||||
import { VideoCommentThreadTree } from '../../../shared/models/videos/video-comment.model'
|
import { VideoCommentThreadTree } from '../../../shared/models/videos/video-comment.model'
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ describe('Test plugin filter hooks', function () {
|
||||||
name: 'normal title',
|
name: 'normal title',
|
||||||
privacy: VideoPrivacy.PUBLIC,
|
privacy: VideoPrivacy.PUBLIC,
|
||||||
channelId: servers[0].videoChannel.id,
|
channelId: servers[0].videoChannel.id,
|
||||||
targetUrl: getYoutubeVideoUrl() + 'bad'
|
targetUrl: getGoodVideoUrl() + 'bad'
|
||||||
}
|
}
|
||||||
await importVideo(servers[0].url, servers[0].accessToken, baseAttributes, 403)
|
await importVideo(servers[0].url, servers[0].accessToken, baseAttributes, 403)
|
||||||
})
|
})
|
||||||
|
@ -117,7 +117,7 @@ describe('Test plugin filter hooks', function () {
|
||||||
name: 'title with bad word',
|
name: 'title with bad word',
|
||||||
privacy: VideoPrivacy.PUBLIC,
|
privacy: VideoPrivacy.PUBLIC,
|
||||||
channelId: servers[0].videoChannel.id,
|
channelId: servers[0].videoChannel.id,
|
||||||
targetUrl: getYoutubeVideoUrl()
|
targetUrl: getGoodVideoUrl()
|
||||||
}
|
}
|
||||||
const res = await importVideo(servers[0].url, servers[0].accessToken, baseAttributes)
|
const res = await importVideo(servers[0].url, servers[0].accessToken, baseAttributes)
|
||||||
videoImportId = res.body.id
|
videoImportId = res.body.id
|
||||||
|
@ -220,7 +220,7 @@ describe('Test plugin filter hooks', function () {
|
||||||
|
|
||||||
const attributes = {
|
const attributes = {
|
||||||
name: 'video please blacklist me',
|
name: 'video please blacklist me',
|
||||||
targetUrl: getYoutubeVideoUrl(),
|
targetUrl: getGoodVideoUrl(),
|
||||||
channelId: servers[0].videoChannel.id
|
channelId: servers[0].videoChannel.id
|
||||||
}
|
}
|
||||||
const res = await importVideo(servers[0].url, servers[0].accessToken, attributes)
|
const res = await importVideo(servers[0].url, servers[0].accessToken, attributes)
|
||||||
|
|
|
@ -64,19 +64,25 @@ async function testImage (url: string, imageName: string, imagePath: string, ext
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildAbsoluteFixturePath (path: string, customCIPath = false) {
|
function buildAbsoluteFixturePath (path: string, customCIPath = false) {
|
||||||
if (isAbsolute(path)) {
|
if (isAbsolute(path)) return path
|
||||||
return path
|
|
||||||
}
|
|
||||||
|
|
||||||
if (customCIPath) {
|
if (customCIPath) {
|
||||||
if (process.env.GITLAB_CI) return join(root(), 'cached-fixtures', path)
|
if (process.env.GITLAB_CI) return join(root(), 'cached-fixtures', path)
|
||||||
|
|
||||||
if (process.env.TRAVIS) return join(process.env.HOME, 'fixtures', path)
|
return join(process.env.HOME, 'fixtures', path)
|
||||||
}
|
}
|
||||||
|
|
||||||
return join(root(), 'server', 'tests', 'fixtures', path)
|
return join(root(), 'server', 'tests', 'fixtures', path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function areHttpImportTestsDisabled () {
|
||||||
|
const disabled = process.env.DISABLE_HTTP_IMPORT_TESTS === 'true'
|
||||||
|
|
||||||
|
if (disabled) console.log('Import tests are disabled')
|
||||||
|
|
||||||
|
return disabled
|
||||||
|
}
|
||||||
|
|
||||||
async function generateHighBitrateVideo () {
|
async function generateHighBitrateVideo () {
|
||||||
const tempFixturePath = buildAbsoluteFixturePath('video_high_bitrate_1080p.mp4', true)
|
const tempFixturePath = buildAbsoluteFixturePath('video_high_bitrate_1080p.mp4', true)
|
||||||
|
|
||||||
|
@ -131,6 +137,7 @@ async function generateVideoWithFramerate (fps = 60) {
|
||||||
export {
|
export {
|
||||||
dateIsValid,
|
dateIsValid,
|
||||||
wait,
|
wait,
|
||||||
|
areHttpImportTestsDisabled,
|
||||||
buildServerDirectory,
|
buildServerDirectory,
|
||||||
webtorrentAdd,
|
webtorrentAdd,
|
||||||
immutableAssign,
|
immutableAssign,
|
||||||
|
|
|
@ -15,6 +15,10 @@ function getBadVideoUrl () {
|
||||||
return 'https://download.cpy.re/peertube/bad_video.mp4'
|
return 'https://download.cpy.re/peertube/bad_video.mp4'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getGoodVideoUrl () {
|
||||||
|
return 'https://download.cpy.re/peertube/good_video.mp4'
|
||||||
|
}
|
||||||
|
|
||||||
function importVideo (url: string, token: string, attributes: VideoImportCreate & { torrentfile?: string }, statusCodeExpected = 200) {
|
function importVideo (url: string, token: string, attributes: VideoImportCreate & { torrentfile?: string }, statusCodeExpected = 200) {
|
||||||
const path = '/api/v1/videos/imports'
|
const path = '/api/v1/videos/imports'
|
||||||
|
|
||||||
|
@ -53,5 +57,6 @@ export {
|
||||||
getYoutubeVideoUrl,
|
getYoutubeVideoUrl,
|
||||||
importVideo,
|
importVideo,
|
||||||
getMagnetURI,
|
getMagnetURI,
|
||||||
getMyVideoImports
|
getMyVideoImports,
|
||||||
|
getGoodVideoUrl
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue