Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Don't run in parallel cli and plugin tests

Chocobozzzf4659d73fb2d
diff --git a/scripts/ci.sh b/scripts/ci.sh
index 448c1c91f4..bf34cd3373 100755
--- a/scripts/ci.sh
+++ b/scripts/ci.sh
@@ -20,7 +20,7 @@ runTest () {
echo $files
- MOCHA_PARALLEL=true parallel -t -j $jobs --retries $retries \
+ parallel -t -j $jobs --retries $retries \
npm run mocha -- -c --timeout 30000 --exit --require ts-node/register --require tsconfig-paths/register --bail \
::: $files
}
@@ -35,9 +35,9 @@ if [ "$1" = "misc" ]; then
feedsFiles=$(findTestFiles server/tests/feeds)
helperFiles=$(findTestFiles server/tests/helpers)
pluginsFiles=$(findTestFiles server/tests/plugins)
- miscFiles=server/tests/client.ts server/tests/misc-endpoints.ts
+ miscFiles="server/tests/client.ts server/tests/misc-endpoints.ts"
- TS_NODE_FILES=true runTest 2 $feedsFiles $helperFiles $pluginsFiles $miscFiles
+ TS_NODE_FILES=true MOCHA_PARALLEL=true runTest 2 $feedsFiles $helperFiles $pluginsFiles $miscFiles
elif [ "$1" = "cli" ]; then
npm run build:server
npm run setup:cli
@@ -52,14 +52,14 @@ elif [ "$1" = "api-1" ]; then
notificationsFiles=$(findTestFiles server/tests/api/notifications)
searchFiles=$(findTestFiles server/tests/api/search)
- runTest 2 $notificationsFiles $searchFiles $checkParamFiles
+ MOCHA_PARALLEL=true runTest 2 $notificationsFiles $searchFiles $checkParamFiles
elif [ "$1" = "api-2" ]; then
npm run build:server
serverFiles=$(findTestFiles server/tests/api/server)
usersFiles=$(findTestFiles server/tests/api/users)
- runTest 2 $serverFiles $usersFiles
+ MOCHA_PARALLEL=true runTest 2 $serverFiles $usersFiles
elif [ "$1" = "api-3" ]; then
npm run build:server
@@ -73,7 +73,7 @@ elif [ "$1" = "api-4" ]; then
redundancyFiles=$(findTestFiles server/tests/api/redundancy)
activitypubFiles=$(findTestFiles server/tests/api/activitypub)
- TS_NODE_FILES=true runTest 2 $activitypubFiles $redundancyFiles $activitypubFiles
+ MOCHA_PARALLEL=true TS_NODE_FILES=true runTest 2 $activitypubFiles $redundancyFiles $activitypubFiles
elif [ "$1" = "external-plugins" ]; then
npm run build:server
diff --git a/scripts/reset-password.ts b/scripts/reset-password.ts
index bf6535cea8..6372095d6d 100755
--- a/scripts/reset-password.ts
+++ b/scripts/reset-password.ts
@@ -21,7 +21,7 @@ initDatabaseModels(true)
})
.then(user => {
if (!user) {
- console.error('User unknown.')
+ console.error('Unknown user.')
process.exit(-1)
}
diff --git a/server/tests/client.ts b/server/tests/client.ts
index 648d46414e..2d8468c060 100644
--- a/server/tests/client.ts
+++ b/server/tests/client.ts
@@ -163,8 +163,10 @@ describe('Test a client controllers', function () {
.set('Accept', 'text/html')
.expect(200)
- const expectedLink = '<link rel="alternate" type="application/json+oembed" href="http://localhost:9001/services/oembed?' +
- `url=http%3A%2F%2Flocalhost%3A9001%2Fvideos%2Fwatch%2F${server.video.uuid}" ` +
+ const port = server.port
+
+ const expectedLink = '<link rel="alternate" type="application/json+oembed" href="http://localhost:' + port + '/services/oembed?' +
+ `url=http%3A%2F%2Flocalhost%3A${port}%2Fvideos%2Fwatch%2F${server.video.uuid}" ` +
`title="${server.video.name}" />`
expect(res.text).to.contain(expectedLink)
diff --git a/server/tests/misc-endpoints.ts b/server/tests/misc-endpoints.ts
index 32b035c9ef..3d02243232 100644
--- a/server/tests/misc-endpoints.ts
+++ b/server/tests/misc-endpoints.ts
@@ -122,7 +122,7 @@ describe('Test misc endpoints', function () {
})
expect(res.text).to.contain('xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"')
- expect(res.text).to.contain('<url><loc>http://localhost:9001/about/instance</loc></url>')
+ expect(res.text).to.contain('<url><loc>http://localhost:' + server.port + '/about/instance</loc></url>')
})
it('Should get the empty cached sitemap', async function () {
@@ -133,7 +133,7 @@ describe('Test misc endpoints', function () {
})
expect(res.text).to.contain('xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"')
- expect(res.text).to.contain('<url><loc>http://localhost:9001/about/instance</loc></url>')
+ expect(res.text).to.contain('<url><loc>http://localhost:' + server.port + '/about/instance</loc></url>')
})
it('Should add videos, channel and accounts and get sitemap', async function () {
@@ -156,17 +156,17 @@ describe('Test misc endpoints', function () {
})
expect(res.text).to.contain('xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"')
- expect(res.text).to.contain('<url><loc>http://localhost:9001/about/instance</loc></url>')
+ expect(res.text).to.contain('<url><loc>http://localhost:' + server.port + '/about/instance</loc></url>')
expect(res.text).to.contain('<video:title>video 1</video:title>')
expect(res.text).to.contain('<video:title>video 2</video:title>')
expect(res.text).to.not.contain('<video:title>video 3</video:title>')
- expect(res.text).to.contain('<url><loc>http://localhost:9001/video-channels/channel1</loc></url>')
- expect(res.text).to.contain('<url><loc>http://localhost:9001/video-channels/channel2</loc></url>')
+ expect(res.text).to.contain('<url><loc>http://localhost:' + server.port + '/video-channels/channel1</loc></url>')
+ expect(res.text).to.contain('<url><loc>http://localhost:' + server.port + '/video-channels/channel2</loc></url>')
- expect(res.text).to.contain('<url><loc>http://localhost:9001/accounts/user1</loc></url>')
- expect(res.text).to.contain('<url><loc>http://localhost:9001/accounts/user2</loc></url>')
+ expect(res.text).to.contain('<url><loc>http://localhost:' + server.port + '/accounts/user1</loc></url>')
+ expect(res.text).to.contain('<url><loc>http://localhost:' + server.port + '/accounts/user2</loc></url>')
})
})
diff --git a/shared/extra-utils/cli/cli.ts b/shared/extra-utils/cli/cli.ts
index 54d05e9c62..c62e170bb3 100644
--- a/shared/extra-utils/cli/cli.ts
+++ b/shared/extra-utils/cli/cli.ts
@@ -3,7 +3,7 @@ import { exec } from 'child_process'
import { ServerInfo } from '../server/servers'
function getEnvCli (server?: ServerInfo) {
- return `NODE_ENV=test NODE_APP_INSTANCE=${server.serverNumber}`
+ return `NODE_ENV=test NODE_APP_INSTANCE=${server.internalServerNumber}`
}
async function execCLI (command: string) {