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.shindex 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" ]; thenfeedsFiles=$(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 $miscFileselif [ "$1" = "cli" ]; thennpm run build:servernpm run setup:cli@@ -52,14 +52,14 @@ elif [ "$1" = "api-1" ]; thennotificationsFiles=$(findTestFiles server/tests/api/notifications)searchFiles=$(findTestFiles server/tests/api/search)- runTest 2 $notificationsFiles $searchFiles $checkParamFiles+ MOCHA_PARALLEL=true runTest 2 $notificationsFiles $searchFiles $checkParamFileselif [ "$1" = "api-2" ]; thennpm run build:serverserverFiles=$(findTestFiles server/tests/api/server)usersFiles=$(findTestFiles server/tests/api/users)- runTest 2 $serverFiles $usersFiles+ MOCHA_PARALLEL=true runTest 2 $serverFiles $usersFileselif [ "$1" = "api-3" ]; thennpm run build:server@@ -73,7 +73,7 @@ elif [ "$1" = "api-4" ]; thenredundancyFiles=$(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 $activitypubFileselif [ "$1" = "external-plugins" ]; thennpm run build:serverdiff --git a/scripts/reset-password.ts b/scripts/reset-password.tsindex 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.tsindex 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.tsindex 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.tsindex 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) {