Merge branch 'develop' of https://github.com/tainacan/tainacan into develop

This commit is contained in:
mateuswetah 2018-03-07 08:30:26 -03:00
commit d9f336f895
3 changed files with 10 additions and 8 deletions

2
.gitignore vendored
View File

@ -20,3 +20,5 @@ src/admin/scss/.sass-cache
src/assets/css/tainacan-admin.css src/assets/css/tainacan-admin.css
src/assets/css/tainacan-admin.css.map src/assets/css/tainacan-admin.css.map
cypress/videos cypress/videos
cypress/screenshots
.vscode

View File

@ -1,2 +0,0 @@
{
}

View File

@ -2,7 +2,7 @@
if [ $# - lt 2 ]; then if [ $# - lt 2 ]; then
echo "usage: $0 [skip-head]" echo "usage: $0 [skip-head]"
exit 1 exit 1
fi fi
SKIP_HEAD=${1-1} SKIP_HEAD=${1-1}
@ -13,8 +13,9 @@ source build-config.cfg
plugin_name=`basename $wp_plugin_dir` plugin_name=`basename $wp_plugin_dir`
test_db_prefix='wptests_' test_db_prefix='wptests_'
cy_record_key='a15e6599-d240-4d98-b582-dea93a3008c0'
################## set up cypress environment ################# set up cypress environment
# replace table prefix in wp_config # replace table prefix in wp_config
echo "Changing DB prefix in wp_config..." echo "Changing DB prefix in wp_config..."
sed -i s/"require_once(ABSPATH . 'wp-settings.php');"/"\$table_prefix = '$test_db_prefix';\nrequire_once(ABSPATH . 'wp-settings.php');"/ $wp_base_dir/wp-config.php sed -i s/"require_once(ABSPATH . 'wp-settings.php');"/"\$table_prefix = '$test_db_prefix';\nrequire_once(ABSPATH . 'wp-settings.php');"/ $wp_base_dir/wp-config.php
@ -33,17 +34,18 @@ cd -
# cypress beginning # cypress beginning
if [ ${SKIP_HEAD} = "0" ] if [ ${SKIP_HEAD} = "0" ]
then then
./node_modules/.bin/cypress run --config baseUrl=$wp_url ./node_modules/.bin/cypress run --config baseUrl=$wp_url --record --key $cy_record_key
else else
./node_modules/.bin/cypress open --config baseUrl=$wp_url ./node_modules/.bin/cypress open --config baseUrl=$wp_url
fi fi
################## teardown cypress environment ################## teardown cypress environment
# remove WordPress # remove WordPress
echo "Removing WordPress..." echo "Removing WordPress..."
cd $wp_base_dir cd $wp_base_dir/
wp db query "DROP TABLES $(wp db tables | paste -s -d, -);" wp db query "DROP TABLES $(wp db tables | paste -s -d, -);"
# recover table prefix in wp_config # recover table prefix in wp_config
echo "Restoring DB prefix in wp_config..." echo "Restoring DB prefix in wp_config..."
sed -i s/"\$table_prefix = '$test_db_prefix';"/""/ $wp_base_dir/wp-config.php sed -i s/"\$table_prefix = '$test_db_prefix';"/test/ $wp_base_dir/wp-config.php
sed -i '/test/d' $wp_base_dir/wp-config.php