Skip to content

Commit

Permalink
use mautic in test mode to speed it up
Browse files Browse the repository at this point in the history
insert data in correct table

does this work

seems like the env is not loaded correctly

more logging

what does this do

what about this

define db port in tests

and  now?

another try

missing dollar

env file dance

switch to phpunit

let's try this

Revert "does this work"

This reverts commit 2d43478.

another one

revert unneeded changes
  • Loading branch information
mollux committed Jul 29, 2023
1 parent c6c23d5 commit 473eebd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
16 changes: 14 additions & 2 deletions .github/ci-files/.env.local
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,17 @@
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
APP_ENV=dev
APP_DEBUG=1
APP_ENV=test
APP_DEBUG=0

DB_HOST=127.0.0.1
DB_NAME=mautictest
DB_USER=root
DB_PORT=3306
DB_PASSWD=
MAUTIC_DB_PREFIX=
MAUTIC_TABLE_PREFIX=
MAUTIC_ENV=test
MAUTIC_ADMIN_USERNAME=admin
MAUTIC_ADMIN_PASSWORD=mautic
MAUTIC_DB_DRIVER=pdo_mysql
8 changes: 5 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,24 @@ jobs:
rm -rf /var/www/html/*
mv $GITHUB_WORKSPACE/mautic/* /var/www/html/
cp ./.github/ci-files/.env.local /var/www/html/
sed -i 's/DB_PORT=3306/DB_PORT=${{ job.services.mysql.ports[3306] }}/g' /var/www/html/.env.local
rm /var/www/html/.env.test
- name: Install Mautic
env:
DB_PORT: ${{ job.services.mysql.ports[3306] }}
run: |
composer install --prefer-dist --no-progress
cp $GITHUB_WORKSPACE/.github/ci-files/local.php ./app/config/local.php
php bin/console mautic:install http://localhost/ --force --env=dev
php bin/console cache:warmup --no-interaction --env=dev
php bin/console mautic:install http://localhost/ --force --env=test
php bin/console cache:warmup --no-interaction --env=test
working-directory: /var/www/html/

# Enable Twilio plugin with random credentials (needed for MessagesTest to function, doesn't actually contact Twilio API).
- name: Enable Twilio plugin
run: |
mysql -uroot -P${{ job.services.mysql.ports[3306] }} -h127.0.0.1 -e "USE mautictest; INSERT INTO plugin_integration_settings (plugin_id, name, is_published, supported_features, api_keys, feature_settings) VALUES (NULL, 'Twilio', 1, 'a:0:{}', 'a:2:{s:8:\"username\";s:169:\"bzFmNlIydWRSZXlIN2lQVkdpanJ4aTQ2NUh6RVdDbHlLRVhsWGZ4b0kyZVNxLzYrQ1J6V1RvMnlhVEp0c245TEp6eStQekx5ZVhLWjB1YVdoR3RnR2dHQ3k1emVVdGt5NzZKUmtjUnJ3c1E9|L8tbZRIYhwatT7Mq+HAdYA==\";s:8:\"password\";s:169:\"T2d2cFpXQWE5YVZnNFFianJSYURRYUtGRHBNZGZjM1VETXg2Wm5Va3NheW43MjVWUlJhTVlCL2pYMDBpbElONStiVVBNbEM3M3BaeGJMNkFKNUFEN1pTNldSRjc4bUM4SDh1SE9OY1k5MTg9|TeuSvfx4XSUOvp0O7T49Cg==\";}', 'a:4:{s:20:\"sending_phone_number\";N;s:22:\"disable_trackable_urls\";i:0;s:16:\"frequency_number\";N;s:14:\"frequency_time\";N;}');"
php bin/console mautic:plugins:reload --env=dev
php bin/console mautic:plugins:reload --env=test
working-directory: /var/www/html

- name: Set correct ownership so Apache can access the files
Expand Down

0 comments on commit 473eebd

Please sign in to comment.