aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-14 10:20:05 +0100
committerChocobozzz <me@florianbigard.com>2017-12-14 10:20:05 +0100
commit6f045b57915d0eac8e590c503b362d2df5e16b85 (patch)
treeb26a305c1ab53fe1f8d3856216c8493064790bc7
parentd48ff09d27d234425c3e9f091ae9072d8e6d8b7a (diff)
downloadPeerTube-6f045b57915d0eac8e590c503b362d2df5e16b85.tar.gz
PeerTube-6f045b57915d0eac8e590c503b362d2df5e16b85.tar.zst
PeerTube-6f045b57915d0eac8e590c503b362d2df5e16b85.zip
Fix tests
-rw-r--r--README.md7
-rwxr-xr-xscripts/upgrade-peertube.sh4
-rw-r--r--server/tests/api/multiple-servers.ts13
3 files changed, 11 insertions, 13 deletions
diff --git a/README.md b/README.md
index e2a5a7251..a6f6cfab8 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
3</h1> 3</h1>
4 4
5<h4 align="center"> 5<h4 align="center">
6Decentralized video streaming platform using P2P (BitTorrent) directly in the web browser with <a href="https://github.com/feross/webtorrent">WebTorrent</a>. 6Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with <a href="https://github.com/feross/webtorrent">WebTorrent</a>.
7</h4> 7</h4>
8 8
9**PeerTube is sponsored by [Framasoft](https://framatube.org/#en), a non-profit that promotes, spreads and develops free-libre software. If you want to support this project, please [consider donating them](https://soutenir.framasoft.org/en/).** 9**PeerTube is sponsored by [Framasoft](https://framatube.org/#en), a non-profit that promotes, spreads and develops free-libre software. If you want to support this project, please [consider donating them](https://soutenir.framasoft.org/en/).**
@@ -128,13 +128,12 @@ See [wiki](https://github.com/Chocobozzz/PeerTube/wiki) for complete installatio
128 128
129#### Debian 129#### Debian
130 130
131 1. Install NodeJS 6.x (previous LTS): [https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions) 131 1. Install NodeJS 8.x (current LTS): [https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions)
132 2. Install yarn: [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install) 132 2. Install yarn: [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
133 3. Add jessie backports to your *source.list*: http://backports.debian.org/Instructions/
134 4. Run: 133 4. Run:
135 134
136 $ apt-get update 135 $ apt-get update
137 $ apt-get install ffmpeg postgresql-9.4 openssl 136 $ apt-get install ffmpeg postgresql openssl
138 137
139#### Ubuntu 16.04 138#### Ubuntu 16.04
140 139
diff --git a/scripts/upgrade-peertube.sh b/scripts/upgrade-peertube.sh
index 562a2a618..bfef38264 100755
--- a/scripts/upgrade-peertube.sh
+++ b/scripts/upgrade-peertube.sh
@@ -4,14 +4,14 @@ verlte() {
4 [ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ] 4 [ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
5} 5}
6 6
7nodeMinVersion="6.0.0" 7nodeMinVersion="8.0.0"
8npmMinVersion="3.0.0" 8npmMinVersion="3.0.0"
9 9
10actualNodeVersion=$(node --version | tr -d "v") 10actualNodeVersion=$(node --version | tr -d "v")
11actualNpmVersion=$(npm --version) 11actualNpmVersion=$(npm --version)
12 12
13if verlte $actualNodeVersion $nodeMinVersion; then 13if verlte $actualNodeVersion $nodeMinVersion; then
14 echo 'You need node >= 6' 14 echo 'You need node >= 8'
15 exit 0 15 exit 0
16fi 16fi
17 17
diff --git a/server/tests/api/multiple-servers.ts b/server/tests/api/multiple-servers.ts
index 2f17f017a..6fe1fb651 100644
--- a/server/tests/api/multiple-servers.ts
+++ b/server/tests/api/multiple-servers.ts
@@ -110,7 +110,6 @@ describe('Test multiple servers', function () {
110 expect(video.description).to.equal('my super description for server 1') 110 expect(video.description).to.equal('my super description for server 1')
111 expect(video.serverHost).to.equal('localhost:9001') 111 expect(video.serverHost).to.equal('localhost:9001')
112 expect(video.duration).to.equal(10) 112 expect(video.duration).to.equal(10)
113 expect(video.tags).to.deep.equal([ 'tag1p1', 'tag2p1' ])
114 expect(dateIsValid(video.createdAt)).to.be.true 113 expect(dateIsValid(video.createdAt)).to.be.true
115 expect(dateIsValid(video.updatedAt)).to.be.true 114 expect(dateIsValid(video.updatedAt)).to.be.true
116 expect(video.accountName).to.equal('root') 115 expect(video.accountName).to.equal('root')
@@ -124,6 +123,7 @@ describe('Test multiple servers', function () {
124 expect(dateIsValid(videoDetails.channel.createdAt)).to.be.true 123 expect(dateIsValid(videoDetails.channel.createdAt)).to.be.true
125 expect(dateIsValid(videoDetails.channel.updatedAt)).to.be.true 124 expect(dateIsValid(videoDetails.channel.updatedAt)).to.be.true
126 expect(videoDetails.files).to.have.lengthOf(1) 125 expect(videoDetails.files).to.have.lengthOf(1)
126 expect(videoDetails.tags).to.deep.equal([ 'tag1p1', 'tag2p1' ])
127 127
128 const file = videoDetails.files[0] 128 const file = videoDetails.files[0]
129 const magnetUri = file.magnetUri 129 const magnetUri = file.magnetUri
@@ -201,7 +201,6 @@ describe('Test multiple servers', function () {
201 expect(video.description).to.equal('my super description for server 2') 201 expect(video.description).to.equal('my super description for server 2')
202 expect(video.serverHost).to.equal('localhost:9002') 202 expect(video.serverHost).to.equal('localhost:9002')
203 expect(video.duration).to.equal(5) 203 expect(video.duration).to.equal(5)
204 expect(video.tags).to.deep.equal([ 'tag1p2', 'tag2p2', 'tag3p2' ])
205 expect(dateIsValid(video.createdAt)).to.be.true 204 expect(dateIsValid(video.createdAt)).to.be.true
206 expect(dateIsValid(video.updatedAt)).to.be.true 205 expect(dateIsValid(video.updatedAt)).to.be.true
207 expect(video.accountName).to.equal('user1') 206 expect(video.accountName).to.equal('user1')
@@ -218,6 +217,7 @@ describe('Test multiple servers', function () {
218 expect(videoDetails.channel.name).to.equal('Default user1 channel') 217 expect(videoDetails.channel.name).to.equal('Default user1 channel')
219 expect(dateIsValid(videoDetails.channel.createdAt)).to.be.true 218 expect(dateIsValid(videoDetails.channel.createdAt)).to.be.true
220 expect(dateIsValid(videoDetails.channel.updatedAt)).to.be.true 219 expect(dateIsValid(videoDetails.channel.updatedAt)).to.be.true
220 expect(videoDetails.tags).to.deep.equal([ 'tag1p2', 'tag2p2', 'tag3p2' ])
221 221
222 expect(videoDetails.files).to.have.lengthOf(4) 222 expect(videoDetails.files).to.have.lengthOf(4)
223 223
@@ -318,7 +318,6 @@ describe('Test multiple servers', function () {
318 expect(video1.description).to.equal('my super description for server 3') 318 expect(video1.description).to.equal('my super description for server 3')
319 expect(video1.serverHost).to.equal('localhost:9003') 319 expect(video1.serverHost).to.equal('localhost:9003')
320 expect(video1.duration).to.equal(5) 320 expect(video1.duration).to.equal(5)
321 expect(video1.tags).to.deep.equal([ 'tag1p3' ])
322 expect(video1.accountName).to.equal('root') 321 expect(video1.accountName).to.equal('root')
323 expect(dateIsValid(video1.createdAt)).to.be.true 322 expect(dateIsValid(video1.createdAt)).to.be.true
324 expect(dateIsValid(video1.updatedAt)).to.be.true 323 expect(dateIsValid(video1.updatedAt)).to.be.true
@@ -326,6 +325,7 @@ describe('Test multiple servers', function () {
326 const res2 = await getVideo(server.url, video1.id) 325 const res2 = await getVideo(server.url, video1.id)
327 const video1Details = res2.body 326 const video1Details = res2.body
328 expect(video1Details.files).to.have.lengthOf(1) 327 expect(video1Details.files).to.have.lengthOf(1)
328 expect(video1Details.tags).to.deep.equal([ 'tag1p3' ])
329 329
330 const file1 = video1Details.files[0] 330 const file1 = video1Details.files[0]
331 expect(file1.magnetUri).to.have.lengthOf.above(2) 331 expect(file1.magnetUri).to.have.lengthOf.above(2)
@@ -344,13 +344,13 @@ describe('Test multiple servers', function () {
344 expect(video2.description).to.equal('my super description for server 3-2') 344 expect(video2.description).to.equal('my super description for server 3-2')
345 expect(video2.serverHost).to.equal('localhost:9003') 345 expect(video2.serverHost).to.equal('localhost:9003')
346 expect(video2.duration).to.equal(5) 346 expect(video2.duration).to.equal(5)
347 expect(video2.tags).to.deep.equal([ 'tag2p3', 'tag3p3', 'tag4p3' ])
348 expect(video2.accountName).to.equal('root') 347 expect(video2.accountName).to.equal('root')
349 expect(dateIsValid(video2.createdAt)).to.be.true 348 expect(dateIsValid(video2.createdAt)).to.be.true
350 expect(dateIsValid(video2.updatedAt)).to.be.true 349 expect(dateIsValid(video2.updatedAt)).to.be.true
351 350
352 const res3 = await getVideo(server.url, video2.id) 351 const res3 = await getVideo(server.url, video2.id)
353 const video2Details = res3.body 352 const video2Details = res3.body
353 expect(video2Details.tags).to.deep.equal([ 'tag2p3', 'tag3p3', 'tag4p3' ])
354 354
355 expect(video2Details.files).to.have.lengthOf(1) 355 expect(video2Details.files).to.have.lengthOf(1)
356 356
@@ -624,13 +624,13 @@ describe('Test multiple servers', function () {
624 expect(videoUpdated.languageLabel).to.equal('French') 624 expect(videoUpdated.languageLabel).to.equal('French')
625 expect(videoUpdated.nsfw).to.be.ok 625 expect(videoUpdated.nsfw).to.be.ok
626 expect(videoUpdated.description).to.equal('my super description updated') 626 expect(videoUpdated.description).to.equal('my super description updated')
627 expect(videoUpdated.tags).to.deep.equal([ 'tag_up_1', 'tag_up_2' ])
628 expect(dateIsValid(videoUpdated.updatedAt, 20000)).to.be.true 627 expect(dateIsValid(videoUpdated.updatedAt, 20000)).to.be.true
629 628
630 const res2 = await getVideo(server.url, videoUpdated.uuid) 629 const res2 = await getVideo(server.url, videoUpdated.uuid)
631 const videoUpdatedDetails = res2.body 630 const videoUpdatedDetails = res2.body
631 expect(videoUpdatedDetails.tags).to.deep.equal([ 'tag_up_1', 'tag_up_2' ])
632 632
633 const file = videoUpdatedDetails .files[0] 633 const file = videoUpdatedDetails.files[0]
634 expect(file.magnetUri).to.have.lengthOf.above(2) 634 expect(file.magnetUri).to.have.lengthOf.above(2)
635 expect(file.resolution).to.equal(720) 635 expect(file.resolution).to.equal(720)
636 expect(file.resolutionLabel).to.equal('720p') 636 expect(file.resolutionLabel).to.equal('720p')
@@ -746,7 +746,6 @@ describe('Test multiple servers', function () {
746 expect(video.description).to.equal(null) 746 expect(video.description).to.equal(null)
747 expect(video.serverHost).to.equal('localhost:9002') 747 expect(video.serverHost).to.equal('localhost:9002')
748 expect(video.accountName).to.equal('root') 748 expect(video.accountName).to.equal('root')
749 expect(video.tags).to.deep.equal([ ])
750 expect(dateIsValid(video.createdAt)).to.be.true 749 expect(dateIsValid(video.createdAt)).to.be.true
751 expect(dateIsValid(video.updatedAt)).to.be.true 750 expect(dateIsValid(video.updatedAt)).to.be.true
752 } 751 }