Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Commit

Permalink
ENGCOM-3482: Travis api-functional tests automated execution introduced
Browse files Browse the repository at this point in the history
  • Loading branch information
Valeriy Naida authored Nov 19, 2018
2 parents 0dd949a + 8dd3c6f commit 9a52f1c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ env:
- TEST_SUITE=integration INTEGRATION_INDEX=2
- TEST_SUITE=integration INTEGRATION_INDEX=3
- TEST_SUITE=functional
- TEST_SUITE=graphql-api-functional
matrix:
exclude:
- php: 7.1
Expand All @@ -43,6 +44,8 @@ matrix:
env: TEST_SUITE=js GRUNT_COMMAND=static
- php: 7.1
env: TEST_SUITE=functional
- php: 7.1
env: TEST_SUITE=graphql-api-functional
cache:
apt: true
directories:
Expand All @@ -61,5 +64,6 @@ script:

# The scripts for grunt/phpunit type tests
- if [ $TEST_SUITE == "functional" ]; then dev/tests/functional/vendor/phpunit/phpunit/phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
- if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
- if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js"] && [ $TEST_SUITE != "graphql-api-functional" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
- if [ $TEST_SUITE == "js" ]; then grunt $GRUNT_COMMAND; fi
- if [ $TEST_SUITE == "graphql-api-functional" ]; then phpunit -c dev/tests/api-functional; fi
2 changes: 1 addition & 1 deletion dev/travis/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if [ $TEST_SUITE == "js" ]; then
yarn global add grunt-cli
fi

if [ $TEST_SUITE = "functional" ]; then
if [ $TEST_SUITE = "functional" ] || [ $TEST_SUITE = "graphql-api-functional" ]; then
# Install apache
sudo apt-get update
sudo apt-get install apache2 libapache2-mod-fastcgi
Expand Down
31 changes: 31 additions & 0 deletions dev/travis/before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,35 @@ case $TEST_SUITE in

cd ../../..
;;

graphql-api-functional)
echo "Installing Magento"
mysql -uroot -e 'CREATE DATABASE magento2;'
php bin/magento setup:install -q \
--language="en_US" \
--timezone="UTC" \
--currency="USD" \
--base-url="http://${MAGENTO_HOST_NAME}/" \
--admin-firstname="John" \
--admin-lastname="Doe" \
--backend-frontname="backend" \
--admin-email="admin@example.com" \
--admin-user="admin" \
--use-rewrites=1 \
--admin-use-security-key=0 \
--admin-password="123123q"

echo "Prepare api-functional tests for running"
cd dev/tests/api-functional
cp -r _files/Magento/TestModuleGraphQl* ../../../app/code/Magento # Deploy and enable test modules before running tests

cp ./phpunit_graphql.xml.dist ./phpunit.xml
sed -e "s?magento.url?${MAGENTO_HOST_NAME}?g" --in-place ./phpunit.xml

cd ../../..
php bin/magento setup:upgrade

echo "Enabling production mode"
php bin/magento deploy:mode:set production
;;
esac

0 comments on commit 9a52f1c

Please sign in to comment.