Skip to content

Commit aa91717

Browse files
MAGECLOUD-3560: Disable integration tests for forks (#474)
1 parent be4c7f7 commit aa91717

File tree

5 files changed

+67
-62
lines changed

5 files changed

+67
-62
lines changed

.travis.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,22 @@ php:
1212
- '7.1'
1313
- '7.2'
1414

15-
addons:
16-
apt:
17-
update: true
18-
1915
env:
2016
matrix:
2117
- TEST_SUITE=static-unit XDEBUG=true
2218
- TEST_SUITE=integration
2319
- TEST_SUITE=functional
2420

25-
cache:
26-
apt: true
21+
install: composer update -n --no-suggest
2722

28-
before_install:
23+
before_script:
2924
- echo "COMPOSER_MAGENTO_USERNAME=${REPO_USERNAME}" >> ./docker/composer.env
3025
- echo "COMPOSER_MAGENTO_PASSWORD=${REPO_PASSWORD}" >> ./docker/composer.env
3126
- if [ $XDEBUG == "true" ]; then echo "PHP_ENABLE_XDEBUG=true" >> ./docker/global.env; fi;
3227

33-
install: composer update -n --no-suggest
34-
35-
script: ./tests/travis/script.sh
28+
script:
29+
- if [ $TEST_SUITE == "static-unit" ]; then ./tests/travis/static-unit.sh; fi
30+
- if [ $TRAVIS_SECURE_ENV_VARS == "true" ] && [ $TEST_SUITE == "integration" ]; then ./tests/travis/integration.sh; fi
31+
- if [ $TRAVIS_SECURE_ENV_VARS == "true" ] && [ $TEST_SUITE == "functional" ]; then ./tests/travis/functional.sh; fi
3632

3733
after_failure: docker ps -s

tests/travis/functional.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# Copyright © Magento, Inc. All rights reserved.
4+
# See COPYING.txt for license details.
5+
6+
set -e
7+
trap '>&2 echo Error: Command \`$BASH_COMMAND\` on line $LINENO failed with exit code $?' ERR
8+
9+
./bin/ece-tools docker:build:integration test-v2 --php ${TRAVIS_PHP_VERSION}
10+
11+
case $TRAVIS_PHP_VERSION in
12+
7.0)
13+
./vendor/bin/codecept run -g php70 --steps
14+
;;
15+
7.1)
16+
./vendor/bin/codecept run -g php71 --steps
17+
;;
18+
7.2)
19+
./vendor/bin/codecept run -g php72 --steps
20+
;;
21+
esac

tests/travis/integration.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
# Copyright © Magento, Inc. All rights reserved.
4+
# See COPYING.txt for license details.
5+
6+
set -e
7+
trap '>&2 echo Error: Command \`$BASH_COMMAND\` on line $LINENO failed with exit code $?' ERR
8+
9+
10+
BASH="docker-compose run cli bash"
11+
DIR_TOOLS="/var/www/ece-tools"
12+
13+
./bin/ece-tools docker:build:integration test-v1 --php ${TRAVIS_PHP_VERSION}
14+
docker-compose up -d
15+
16+
case $TRAVIS_PHP_VERSION in
17+
7.0)
18+
$BASH -c "${DIR_TOOLS}/vendor/bin/phpunit --group php70 --verbose --configuration ${DIR_TOOLS}/tests/integration"
19+
;;
20+
7.1)
21+
$BASH -c "${DIR_TOOLS}/vendor/bin/phpunit --group php71 --verbose --configuration ${DIR_TOOLS}/tests/integration"
22+
;;
23+
7.2)
24+
$BASH -c "${DIR_TOOLS}/vendor/bin/phpunit --group php72 --verbose --configuration ${DIR_TOOLS}/tests/integration"
25+
;;
26+
esac
27+
28+
docker-compose down -v

tests/travis/script.sh

Lines changed: 0 additions & 52 deletions
This file was deleted.

tests/travis/static-unit.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
# Copyright © Magento, Inc. All rights reserved.
4+
# See COPYING.txt for license details.
5+
6+
set -e
7+
trap '>&2 echo Error: Command \`$BASH_COMMAND\` on line $LINENO failed with exit code $?' ERR
8+
9+
./vendor/bin/phpcs ./src --standard=./tests/static/phpcs-ruleset.xml -p -n
10+
./vendor/bin/phpmd ./src xml ./tests/static/phpmd-ruleset.xml
11+
./vendor/bin/phpunit --configuration ./tests/unit --coverage-clover ./tests/unit/tmp/clover.xml && php ./tests/unit/code-coverage.php ./tests/unit/tmp/clover.xml
12+
./vendor/bin/phpunit --configuration ./tests/unit

0 commit comments

Comments
 (0)