Skip to content

Commit 9a52f1c

Browse files
author
Valeriy Naida
authored
ENGCOM-3482: Travis api-functional tests automated execution introduced #188
2 parents 0dd949a + 8dd3c6f commit 9a52f1c

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ env:
3333
- TEST_SUITE=integration INTEGRATION_INDEX=2
3434
- TEST_SUITE=integration INTEGRATION_INDEX=3
3535
- TEST_SUITE=functional
36+
- TEST_SUITE=graphql-api-functional
3637
matrix:
3738
exclude:
3839
- php: 7.1
@@ -43,6 +44,8 @@ matrix:
4344
env: TEST_SUITE=js GRUNT_COMMAND=static
4445
- php: 7.1
4546
env: TEST_SUITE=functional
47+
- php: 7.1
48+
env: TEST_SUITE=graphql-api-functional
4649
cache:
4750
apt: true
4851
directories:
@@ -61,5 +64,6 @@ script:
6164

6265
# The scripts for grunt/phpunit type tests
6366
- if [ $TEST_SUITE == "functional" ]; then dev/tests/functional/vendor/phpunit/phpunit/phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
64-
- if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
67+
- if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js"] && [ $TEST_SUITE != "graphql-api-functional" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
6568
- if [ $TEST_SUITE == "js" ]; then grunt $GRUNT_COMMAND; fi
69+
- if [ $TEST_SUITE == "graphql-api-functional" ]; then phpunit -c dev/tests/api-functional; fi

dev/travis/before_install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ if [ $TEST_SUITE == "js" ]; then
3434
yarn global add grunt-cli
3535
fi
3636

37-
if [ $TEST_SUITE = "functional" ]; then
37+
if [ $TEST_SUITE = "functional" ] || [ $TEST_SUITE = "graphql-api-functional" ]; then
3838
# Install apache
3939
sudo apt-get update
4040
sudo apt-get install apache2 libapache2-mod-fastcgi

dev/travis/before_script.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,35 @@ case $TEST_SUITE in
134134

135135
cd ../../..
136136
;;
137+
138+
graphql-api-functional)
139+
echo "Installing Magento"
140+
mysql -uroot -e 'CREATE DATABASE magento2;'
141+
php bin/magento setup:install -q \
142+
--language="en_US" \
143+
--timezone="UTC" \
144+
--currency="USD" \
145+
--base-url="http://${MAGENTO_HOST_NAME}/" \
146+
--admin-firstname="John" \
147+
--admin-lastname="Doe" \
148+
--backend-frontname="backend" \
149+
--admin-email="admin@example.com" \
150+
--admin-user="admin" \
151+
--use-rewrites=1 \
152+
--admin-use-security-key=0 \
153+
--admin-password="123123q"
154+
155+
echo "Prepare api-functional tests for running"
156+
cd dev/tests/api-functional
157+
cp -r _files/Magento/TestModuleGraphQl* ../../../app/code/Magento # Deploy and enable test modules before running tests
158+
159+
cp ./phpunit_graphql.xml.dist ./phpunit.xml
160+
sed -e "s?magento.url?${MAGENTO_HOST_NAME}?g" --in-place ./phpunit.xml
161+
162+
cd ../../..
163+
php bin/magento setup:upgrade
164+
165+
echo "Enabling production mode"
166+
php bin/magento deploy:mode:set production
167+
;;
137168
esac

0 commit comments

Comments
 (0)