From f9d2deae3a826b2f3fdcb6d0b29ef06f21a93c61 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 30 Jul 2020 16:58:32 +0200 Subject: [PATCH] Correctly test ldap --- .github/workflows/test.yml | 6 +++-- .gitlab-ci.yml | 30 ---------------------- scripts/ci.sh | 2 +- server/tests/external-plugins/auth-ldap.ts | 4 +-- 4 files changed, 7 insertions(+), 35 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 28ebf2ca9..0c31b73fc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -71,9 +71,11 @@ jobs: - name: Install dependencies run: yarn install --frozen-lockfile - - name: Set videos import enabled env variable + - name: Set env test variable (schedule) if: github.event_name != 'schedule' - run: echo "::set-env name=DISABLE_HTTP_IMPORT_TESTS::true" + run: | + echo "::set-env name=DISABLE_HTTP_IMPORT_TESTS::true" + echo "::set-env name=DISABLE_EXTERNAL_PLUGINS_TESTS::true" - name: Run Test run: NODE_PENDING_JOB_WAIT=2000 npm run ci -- ${{ matrix.test_suite }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3891187e8..358257209 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,11 +1,8 @@ image: chocobozzz/peertube-ci:10 stages: - - build-and-lint - - test - clients - docker-nightly - - external-plugins cache: key: yarn @@ -74,30 +71,3 @@ build-docker-master: - master variables: DOCKER_IMAGE_NAME: chocobozzz/peertube:production-buster - -test-external-plugins: - stage: external-plugins - only: - - schedules - services: - - name: postgres:9.6 - alias: postgres - - name: redis:latest - alias: redis - - name: rroemhild/test-openldap - alias: ldap - variables: - POSTGRES_USER: peertube - POSTGRES_HOST_AUTH_METHOD: trust - REDIS_HOST: redis - artifacts: - expire_in: 1 day - paths: - - test*/logs - when: always - before_script: - - 'sed -i -z "s/database:\n hostname: ''localhost''/database:\n hostname: ''postgres''/" config/test.yaml' - - 'sed -i -z "s/redis:\n hostname: ''localhost''/redis:\n hostname: ''redis''/" config/test.yaml' - - NOCLIENT=1 yarn install --pure-lockfile --cache-folder .yarn-cache - script: - - PGHOST=postgres PGUSER=peertube npm run ci -- "external-plugins" diff --git a/scripts/ci.sh b/scripts/ci.sh index df9d6d2b2..c735c8d5c 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -65,7 +65,7 @@ elif [ "$1" = "api-3" ]; then videosFiles=$(findTestFiles server/tests/api/videos) - runTest 1 $videosFiles + MOCHA_PARALLEL=true runTest 2 $videosFiles elif [ "$1" = "api-4" ]; then npm run build:server diff --git a/server/tests/external-plugins/auth-ldap.ts b/server/tests/external-plugins/auth-ldap.ts index 0f0a08532..bb02fbc02 100644 --- a/server/tests/external-plugins/auth-ldap.ts +++ b/server/tests/external-plugins/auth-ldap.ts @@ -47,7 +47,7 @@ describe('Official plugin auth-ldap', function () { 'mail-property': 'mail', 'search-base': 'ou=people,dc=planetexpress,dc=com', 'search-filter': '(|(mail={{username}})(uid={{username}}))', - 'url': 'ldap://ldap:390', + 'url': 'ldap://localhost:390', 'username-property': 'uid' } }) @@ -67,7 +67,7 @@ describe('Official plugin auth-ldap', function () { 'mail-property': 'mail', 'search-base': 'ou=people,dc=planetexpress,dc=com', 'search-filter': '(|(mail={{username}})(uid={{username}}))', - 'url': 'ldap://ldap:389', + 'url': 'ldap://localhost:389', 'username-property': 'uid' } })