Skip to content

Commit 8dd3c6f

Browse files
ENGCOM-3482: Travis api-functional tests automated execution introduced #188
- Merge Pull Request magento/graphql-ce#188 from magento/graphql-ce:travis-tests - Merged commits: 1. 1992a36 2. 441a981 3. df75586 4. 636142e 5. ecb1a7b 6. 599cf87 7. 09e7005 8. 93c6073 9. f9a7b81 10. f66d26a 11. 66329bb 12. 29cb28b 13. 4fdc638 14. 4349d02 15. ccfffbc 16. 33f40d6 17. 8f3b9dc 18. 41bf2a1 19. 9c95813 20. 18f3d6a 21. 0d58352
2 parents ced96c1 + 0d58352 commit 8dd3c6f

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)