2021-03-02 12:16:19 +00:00
|
|
|
test:
|
2023-01-30 11:54:16 +00:00
|
|
|
image: ${CI_REGISTRY}/leenooks/php:8.1-fpm-alpine-ldap-test
|
2021-03-02 12:16:19 +00:00
|
|
|
|
|
|
|
stage: test
|
|
|
|
|
2021-03-07 22:52:08 +00:00
|
|
|
# NOTE: This service is dependant on project file configuration, which is not there if the cache was deleted
|
|
|
|
# resulting in the testing to fail on the first run.
|
2021-03-02 12:16:19 +00:00
|
|
|
services:
|
2023-01-30 11:54:16 +00:00
|
|
|
- name: osixia/openldap:latest
|
2023-04-02 23:45:06 +00:00
|
|
|
alias: test_ldap
|
2023-01-30 11:54:16 +00:00
|
|
|
command: ["--loglevel","debug"]
|
2021-03-02 12:16:19 +00:00
|
|
|
|
|
|
|
variables:
|
2023-01-30 11:54:16 +00:00
|
|
|
LDAP_SEED_INTERNAL_LDIF_PATH: "${CI_PROJECT_DIR}/tests/server/openldap/data"
|
|
|
|
LDAP_SEED_INTERNAL_SCHEMA_PATH: "${CI_PROJECT_DIR}/tests/server/openldap/schema"
|
2021-03-02 12:16:19 +00:00
|
|
|
LDAP_BASE_DN: "dc=Test"
|
|
|
|
LDAP_DOMAIN: "Test"
|
|
|
|
LDAP_ADMIN_PASSWORD: test
|
2023-01-30 11:54:16 +00:00
|
|
|
#CI_DEBUG_SERVICES: "true"
|
2021-03-02 12:16:19 +00:00
|
|
|
|
|
|
|
tags:
|
2023-01-30 11:54:16 +00:00
|
|
|
- php
|
2021-03-02 12:16:19 +00:00
|
|
|
only:
|
2023-01-30 11:54:16 +00:00
|
|
|
- BRANCH-2.0
|
2021-03-02 12:16:19 +00:00
|
|
|
|
|
|
|
before_script:
|
2023-01-30 11:54:16 +00:00
|
|
|
- mv .env.testing .env
|
2021-03-02 12:16:19 +00:00
|
|
|
|
2023-03-25 13:16:42 +00:00
|
|
|
# Install npm and dependancies
|
|
|
|
- npm i
|
|
|
|
- npm run prod
|
|
|
|
|
2023-01-30 11:54:16 +00:00
|
|
|
# Install Composer and project dependencies.
|
|
|
|
- mkdir -p ${COMPOSER_HOME}
|
|
|
|
- if [ -n "$GITHUB_TOKEN" ]; then cat $GITHUB_TOKEN |base64 -d > ${COMPOSER_HOME}/auth.json; fi
|
|
|
|
- composer install
|
2021-03-02 12:16:19 +00:00
|
|
|
|
2023-01-30 11:54:16 +00:00
|
|
|
# Generate an application key. Re-cache.
|
|
|
|
- php artisan key:generate
|
2021-03-02 12:16:19 +00:00
|
|
|
|
|
|
|
script:
|
2023-01-30 11:54:16 +00:00
|
|
|
# Sleep if we need to, in case we want to jump in and see what is going on during the test
|
|
|
|
- if [ -n "$DEBUG_PAUSE" ]; then echo "Pausing for $DEBUG_PAUSE seconds, so you can jump into the containers"; sleep $DEBUG_PAUSE; fi
|
|
|
|
# run laravel tests
|
|
|
|
- XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text --colors=never
|
|
|
|
|
|
|
|
# run frontend tests
|
|
|
|
# if you have any task for testing frontend
|
|
|
|
# set it in your package.json script
|
|
|
|
# comment this out if you don't have a frontend test
|
|
|
|
# npm test
|