]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Speedup CI
authorChocobozzz <me@florianbigard.com>
Thu, 17 Jun 2021 08:43:34 +0000 (10:43 +0200)
committerChocobozzz <me@florianbigard.com>
Thu, 17 Jun 2021 08:43:34 +0000 (10:43 +0200)
.github/workflows/test.yml
scripts/build/client.sh
scripts/ci.sh
scripts/test.sh
server/tests/plugins/html-injection.ts

index a1edde1ef00045298e0b22fd1ae773620eb031e2..46b243244b9c02a118a059c5f4d035c2e6e449d6 100644 (file)
@@ -39,7 +39,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        test_suite: [ misc, api-1, api-2, api-3, api-4, cli, lint, external-plugins ]
+        test_suite: [ client, api-1, api-2, api-3, api-4, cli-plugin, lint, external-plugins ]
 
     env:
       PGUSER: peertube
index 91147fc51d3867e599c4cc8202e0d5ddda8fe226..0b7cbec35f4a607ad6fcae97caa5c392364a01c5 100755 (executable)
@@ -40,7 +40,7 @@ languages=(
 
 cd client
 
-rm -rf ./dist ./compiled
+rm -rf ./dist
 
 # Don't build other languages if --light arg is provided
 if [ -z ${1+x} ] || ([ "$1" != "--light" ] && [ "$1" != "--analyze-bundle" ]); then
index b068deeb488365c81241248f45e92a2ce411f647..07e37e0eee82ce393f20ac7634e5c03b795d2c9f 100755 (executable)
@@ -33,24 +33,33 @@ runTest () {
 }
 
 findTestFiles () {
-    find $1 -type f -name "*.js" | grep -v "/index.js" | xargs echo
+    exception="-not -name index.js"
+
+    if [ ! -z ${2+x} ]; then
+        exception="$exception -not -name $2"
+    fi
+
+    find $1 -type f -name "*.js" $exception | xargs echo
 }
 
-if [ "$1" = "misc" ]; then
+if [ "$1" = "client" ]; then
     npm run build
 
     feedsFiles=$(findTestFiles ./dist/server/tests/feeds)
     helperFiles=$(findTestFiles ./dist/server/tests/helpers)
-    pluginsFiles=$(findTestFiles ./dist/server/tests/plugins)
     miscFiles="./dist/server/tests/client.js ./dist/server/tests/misc-endpoints.js"
+    # Not in plugin task, it needs an index.html
+    pluginFiles="./dist/server/tests/plugins/html-injection.js"
 
-    MOCHA_PARALLEL=true runTest "$1" 2 $feedsFiles $helperFiles $pluginsFiles $miscFiles
-elif [ "$1" = "cli" ]; then
+    MOCHA_PARALLEL=true runTest "$1" 2 $feedsFiles $helperFiles $miscFiles $pluginFiles
+elif [ "$1" = "cli-plugin" ]; then
     npm run build:server
     npm run setup:cli
 
+    pluginsFiles=$(findTestFiles ./dist/server/tests/plugins html-injection.js)
     cliFiles=$(findTestFiles ./dist/server/tests/cli)
 
+    MOCHA_PARALLEL=true runTest "$1" 2 $pluginsFiles
     runTest "$1" 1 $cliFiles
 elif [ "$1" = "api-1" ]; then
     npm run build:server
index 32034531ddfae3257757f5c8ac2dddbebeaff21c..01b259fe248ef92985c97e329bff09c86521c24e 100755 (executable)
@@ -7,8 +7,8 @@ npm run setup:cli
 
 npm run ci -- lint
 
-npm run ci -- misc
-npm run ci -- cli
+npm run ci -- client
+npm run ci -- cli-plugin
 npm run ci -- api-1
 npm run ci -- api-2
 npm run ci -- api-3
index 293c1df21d9845c0eb9a20370409524206f06e63..4fa8caa3a33c787365eec4f43c5a9adaefa523a8 100644 (file)
@@ -15,7 +15,7 @@ import {
 
 const expect = chai.expect
 
-describe('Test plugins HTML inection', function () {
+describe('Test plugins HTML injection', function () {
   let server: ServerInfo = null
 
   before(async function () {