diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-09 15:37:43 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | 9293139fde7091e9badcafa9b570b83cea9a10ad (patch) | |
tree | 9728412f02af4aa59d2c016db47624251e8f6be6 /server/tests/api/activitypub/refresher.ts | |
parent | 078f17e6d90376050f43ce639e88e11869b49ee7 (diff) | |
download | PeerTube-9293139fde7091e9badcafa9b570b83cea9a10ad.tar.gz PeerTube-9293139fde7091e9badcafa9b570b83cea9a10ad.tar.zst PeerTube-9293139fde7091e9badcafa9b570b83cea9a10ad.zip |
Introduce sql command
Diffstat (limited to 'server/tests/api/activitypub/refresher.ts')
-rw-r--r-- | server/tests/api/activitypub/refresher.ts | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/server/tests/api/activitypub/refresher.ts b/server/tests/api/activitypub/refresher.ts index f295dfab7..af919f2f3 100644 --- a/server/tests/api/activitypub/refresher.ts +++ b/server/tests/api/activitypub/refresher.ts | |||
@@ -4,7 +4,6 @@ import 'mocha' | |||
4 | import { HttpStatusCode } from '@shared/core-utils' | 4 | import { HttpStatusCode } from '@shared/core-utils' |
5 | import { | 5 | import { |
6 | cleanupTests, | 6 | cleanupTests, |
7 | closeAllSequelize, | ||
8 | doubleFollow, | 7 | doubleFollow, |
9 | flushAndRunMultipleServers, | 8 | flushAndRunMultipleServers, |
10 | generateUserAccessToken, | 9 | generateUserAccessToken, |
@@ -13,10 +12,7 @@ import { | |||
13 | reRunServer, | 12 | reRunServer, |
14 | ServerInfo, | 13 | ServerInfo, |
15 | setAccessTokensToServers, | 14 | setAccessTokensToServers, |
16 | setActorField, | ||
17 | setDefaultVideoChannel, | 15 | setDefaultVideoChannel, |
18 | setPlaylistField, | ||
19 | setVideoField, | ||
20 | uploadVideo, | 16 | uploadVideo, |
21 | uploadVideoAndGetId, | 17 | uploadVideoAndGetId, |
22 | wait, | 18 | wait, |
@@ -78,7 +74,7 @@ describe('Test AP refresher', function () { | |||
78 | await wait(10000) | 74 | await wait(10000) |
79 | 75 | ||
80 | // Change UUID so the remote server returns a 404 | 76 | // Change UUID so the remote server returns a 404 |
81 | await setVideoField(servers[1].internalServerNumber, videoUUID1, 'uuid', '304afe4f-39f9-4d49-8ed7-ac57b86b174f') | 77 | await servers[1].sqlCommand.setVideoField(videoUUID1, 'uuid', '304afe4f-39f9-4d49-8ed7-ac57b86b174f') |
82 | 78 | ||
83 | await getVideo(servers[0].url, videoUUID1) | 79 | await getVideo(servers[0].url, videoUUID1) |
84 | await getVideo(servers[0].url, videoUUID2) | 80 | await getVideo(servers[0].url, videoUUID2) |
@@ -92,9 +88,9 @@ describe('Test AP refresher', function () { | |||
92 | it('Should not update a remote video if the remote instance is down', async function () { | 88 | it('Should not update a remote video if the remote instance is down', async function () { |
93 | this.timeout(70000) | 89 | this.timeout(70000) |
94 | 90 | ||
95 | killallServers([ servers[1] ]) | 91 | await killallServers([ servers[1] ]) |
96 | 92 | ||
97 | await setVideoField(servers[1].internalServerNumber, videoUUID3, 'uuid', '304afe4f-39f9-4d49-8ed7-ac57b86b174e') | 93 | await servers[1].sqlCommand.setVideoField(videoUUID3, 'uuid', '304afe4f-39f9-4d49-8ed7-ac57b86b174e') |
98 | 94 | ||
99 | // Video will need a refresh | 95 | // Video will need a refresh |
100 | await wait(10000) | 96 | await wait(10000) |
@@ -120,7 +116,7 @@ describe('Test AP refresher', function () { | |||
120 | 116 | ||
121 | // Change actor name so the remote server returns a 404 | 117 | // Change actor name so the remote server returns a 404 |
122 | const to = 'http://localhost:' + servers[1].port + '/accounts/user2' | 118 | const to = 'http://localhost:' + servers[1].port + '/accounts/user2' |
123 | await setActorField(servers[1].internalServerNumber, to, 'preferredUsername', 'toto') | 119 | await servers[1].sqlCommand.setActorField(to, 'preferredUsername', 'toto') |
124 | 120 | ||
125 | await command.get({ accountName: 'user1@localhost:' + servers[1].port }) | 121 | await command.get({ accountName: 'user1@localhost:' + servers[1].port }) |
126 | await command.get({ accountName: 'user2@localhost:' + servers[1].port }) | 122 | await command.get({ accountName: 'user2@localhost:' + servers[1].port }) |
@@ -140,7 +136,7 @@ describe('Test AP refresher', function () { | |||
140 | await wait(10000) | 136 | await wait(10000) |
141 | 137 | ||
142 | // Change UUID so the remote server returns a 404 | 138 | // Change UUID so the remote server returns a 404 |
143 | await setPlaylistField(servers[1].internalServerNumber, playlistUUID2, 'uuid', '304afe4f-39f9-4d49-8ed7-ac57b86b178e') | 139 | await servers[1].sqlCommand.setPlaylistField(playlistUUID2, 'uuid', '304afe4f-39f9-4d49-8ed7-ac57b86b178e') |
144 | 140 | ||
145 | await servers[0].playlistsCommand.get({ playlistId: playlistUUID1 }) | 141 | await servers[0].playlistsCommand.get({ playlistId: playlistUUID1 }) |
146 | await servers[0].playlistsCommand.get({ playlistId: playlistUUID2 }) | 142 | await servers[0].playlistsCommand.get({ playlistId: playlistUUID2 }) |
@@ -156,7 +152,5 @@ describe('Test AP refresher', function () { | |||
156 | this.timeout(10000) | 152 | this.timeout(10000) |
157 | 153 | ||
158 | await cleanupTests(servers) | 154 | await cleanupTests(servers) |
159 | |||
160 | await closeAllSequelize(servers) | ||
161 | }) | 155 | }) |
162 | }) | 156 | }) |