From b2325fa5de892fc42c9acf856acc256cf6f2d472 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sun, 18 Feb 2018 11:06:52 +0100 Subject: [PATCH 1/5] move scripts --- .travis.yml | 19 ++++++++++-------- .../tests/.env.mysql.travis | 0 .../tests/.env.postgres.travis | 0 .../tests/.travis.deploy.json.in | 0 {.ci => scripts/tests}/runtests.sh | 0 {.ci => scripts/tests}/server-cc.php | 0 {.ci => scripts/tests}/start-selenium.sh | 0 {.ci => scripts/tests}/travis-report.sh | 0 .../tests/travis-sonar.sh | 0 .../tests/travis-sonar.sh.sig | Bin steward.yml | 1 - 11 files changed, 11 insertions(+), 9 deletions(-) rename .env.mysql.travis => scripts/tests/.env.mysql.travis (100%) rename .env.postgres.travis => scripts/tests/.env.postgres.travis (100%) rename .travis.deploy.json.in => scripts/tests/.travis.deploy.json.in (100%) rename {.ci => scripts/tests}/runtests.sh (100%) rename {.ci => scripts/tests}/server-cc.php (100%) rename {.ci => scripts/tests}/start-selenium.sh (100%) rename {.ci => scripts/tests}/travis-report.sh (100%) rename travis-sonar.sh => scripts/tests/travis-sonar.sh (100%) rename travis-sonar.sh.sig => scripts/tests/travis-sonar.sh.sig (100%) delete mode 100644 steward.yml diff --git a/.travis.yml b/.travis.yml index f0da284b147..21100ac3475 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,11 +32,11 @@ matrix: - env: DB=postgres fast_finish: true -jdk: - - oraclejdk8 - -git: - depth: false +# Run branches build on master and tagged version +branches: + only: + - master + - /^v\d+\.\d+(\.\d+)?(-\S*)?$/ addons: postgresql: "9.6" @@ -48,7 +48,7 @@ addons: before_install: - mkdir -p $TRAVIS_BUILD_DIR/results/coverage - - cp .env.$DB.travis .env + - cp scripts/tests/.env.$DB.travis .env - if [[ "$DB" == "mysql" ]]; then mysql -v -e 'CREATE DATABASE monica;'; fi - if [[ "$DB" == "postgres" ]]; then psql -e -c 'CREATE DATABASE monica;' -U postgres; fi - composer self-update @@ -57,11 +57,14 @@ before_install: install: # Get packages without require-dev - travis_retry composer install --no-interaction --prefer-dist --no-suggest --ignore-platform-reqs --no-dev + # Build js and css assets - npm install - npm run production + # Create dist file before running composer install with dev dependencies - make dist + # Get packages with require-dev - travis_retry composer install --no-interaction --prefer-dist --no-suggest --ignore-platform-reqs @@ -75,14 +78,14 @@ script: - vendor/bin/phpunit -c phpunit${DB/mysql/}.xml # Start http server - - bash -c "if [[ \"$SELENIUM\" == \"1\" ]]; then php -S localhost:8000 -t $TRAVIS_BUILD_DIR/public $TRAVIS_BUILD_DIR/.ci/server-cc.php 2>/dev/null; fi" & + - bash -c "if [[ \"$SELENIUM\" == \"1\" ]]; then php -S localhost:8000 -t $TRAVIS_BUILD_DIR/public $TRAVIS_BUILD_DIR/scripts/tests/server-cc.php 2>/dev/null; fi" & - if [[ "$SELENIUM" == "1" ]]; then until $(nc -z localhost 8000); do sleep 1; echo Waiting for http server to start...; done; fi # Run browser tests - if [[ "$SELENIUM" == "1" ]]; then php artisan dusk; fi after_script: - - if [[ "$SELENIUM" == "1" ]]; then .ci/travis-report.sh 2>/dev/null; fi + - if [[ "$SELENIUM" == "1" ]]; then scripts/tests/travis-report.sh 2>/dev/null; fi - if [[ "$COVERAGE" == "1" ]]; then vendor/bin/phpcov merge --clover=$TRAVIS_BUILD_DIR/results/coverage2.xml $TRAVIS_BUILD_DIR/results/coverage/; fi - if [[ "$COVERAGE" == "1" ]]; then bash <(curl -s https://codecov.io/bash); fi - if [[ "$COVERAGE" == "1" ]]; then ./travis-sonar.sh; fi diff --git a/.env.mysql.travis b/scripts/tests/.env.mysql.travis similarity index 100% rename from .env.mysql.travis rename to scripts/tests/.env.mysql.travis diff --git a/.env.postgres.travis b/scripts/tests/.env.postgres.travis similarity index 100% rename from .env.postgres.travis rename to scripts/tests/.env.postgres.travis diff --git a/.travis.deploy.json.in b/scripts/tests/.travis.deploy.json.in similarity index 100% rename from .travis.deploy.json.in rename to scripts/tests/.travis.deploy.json.in diff --git a/.ci/runtests.sh b/scripts/tests/runtests.sh similarity index 100% rename from .ci/runtests.sh rename to scripts/tests/runtests.sh diff --git a/.ci/server-cc.php b/scripts/tests/server-cc.php similarity index 100% rename from .ci/server-cc.php rename to scripts/tests/server-cc.php diff --git a/.ci/start-selenium.sh b/scripts/tests/start-selenium.sh similarity index 100% rename from .ci/start-selenium.sh rename to scripts/tests/start-selenium.sh diff --git a/.ci/travis-report.sh b/scripts/tests/travis-report.sh similarity index 100% rename from .ci/travis-report.sh rename to scripts/tests/travis-report.sh diff --git a/travis-sonar.sh b/scripts/tests/travis-sonar.sh similarity index 100% rename from travis-sonar.sh rename to scripts/tests/travis-sonar.sh diff --git a/travis-sonar.sh.sig b/scripts/tests/travis-sonar.sh.sig similarity index 100% rename from travis-sonar.sh.sig rename to scripts/tests/travis-sonar.sh.sig diff --git a/steward.yml b/steward.yml deleted file mode 100644 index 5087e060d2f..00000000000 --- a/steward.yml +++ /dev/null @@ -1 +0,0 @@ -tests_dir: ./tests/BrowserSelenium \ No newline at end of file From 2d9ad4e8fbb95fb7db0fc1e6b3cc8da627aba159 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sun, 18 Feb 2018 15:22:41 +0100 Subject: [PATCH 2/5] Remove executable bit --- storage/app/.gitignore | 0 storage/debugbar/.gitignore | 0 storage/framework/.gitignore | 0 storage/framework/cache/.gitignore | 0 storage/framework/sessions/.gitignore | 0 storage/framework/views/.gitignore | 0 storage/logs/.gitignore | 0 7 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 storage/app/.gitignore mode change 100755 => 100644 storage/debugbar/.gitignore mode change 100755 => 100644 storage/framework/.gitignore mode change 100755 => 100644 storage/framework/cache/.gitignore mode change 100755 => 100644 storage/framework/sessions/.gitignore mode change 100755 => 100644 storage/framework/views/.gitignore mode change 100755 => 100644 storage/logs/.gitignore diff --git a/storage/app/.gitignore b/storage/app/.gitignore old mode 100755 new mode 100644 diff --git a/storage/debugbar/.gitignore b/storage/debugbar/.gitignore old mode 100755 new mode 100644 diff --git a/storage/framework/.gitignore b/storage/framework/.gitignore old mode 100755 new mode 100644 diff --git a/storage/framework/cache/.gitignore b/storage/framework/cache/.gitignore old mode 100755 new mode 100644 diff --git a/storage/framework/sessions/.gitignore b/storage/framework/sessions/.gitignore old mode 100755 new mode 100644 diff --git a/storage/framework/views/.gitignore b/storage/framework/views/.gitignore old mode 100755 new mode 100644 diff --git a/storage/logs/.gitignore b/storage/logs/.gitignore old mode 100755 new mode 100644 From 4c05f6725531c1305541e2b66251053077124bbb Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sun, 18 Feb 2018 15:43:48 +0100 Subject: [PATCH 3/5] update --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9ee2e85e94f..0bccdf039de 100644 --- a/Makefile +++ b/Makefile @@ -103,7 +103,7 @@ dist: results/$(DESTDIR).tar.bz2 results/$(ASSETS).tar.bz2 .travis.deploy.json COMMIT_MESSAGE := $(shell echo "$$TRAVIS_COMMIT_MESSAGE" | sed -s 's/"/\\\\\\\\\\"/g' | sed -s 's/(/\\(/g' | sed -s 's/)/\\)/g' | sed -s 's%/%\\/%g') -.travis.deploy.json: .travis.deploy.json.in +.travis.deploy.json: scripts/tests/.travis.deploy.json.in cp $< $@ sed -si "s/\$$(version)/$(BUILD)/" $@ sed -si "s/\$$(description)/$(COMMIT_MESSAGE)/" $@ From c52565a7c5061e0f9f17f0b0e20fd01555ae9a0f Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sun, 18 Feb 2018 18:56:24 +0100 Subject: [PATCH 4/5] update --- .dockerignore | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.dockerignore b/.dockerignore index a535f002287..a8d1cab70f2 100644 --- a/.dockerignore +++ b/.dockerignore @@ -23,13 +23,10 @@ public/storage/ resources/vendor/ results/ .sass-lint.yml +scripts/tests +scripts/vagrant server.php sonar-project.properties -steward.yml .styleci.yml tests/ -travis-sonar.sh -travis-sonar.sh.sig -.travis.yml -.travis.yml.sig -yarn.lock +.travis.yml* From e37c36282d160ba74c42f32585b9c4adfb68e825 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Mon, 19 Feb 2018 00:14:38 +0100 Subject: [PATCH 5/5] Fix paths --- .dockerignore | 11 +++++++++-- scripts/tests/runtests.sh | 2 +- scripts/tests/server-cc.php | 2 +- scripts/tests/start-selenium.sh | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.dockerignore b/.dockerignore index a8d1cab70f2..89434ab23a5 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,7 +4,7 @@ .gitignore **/.gitignore **/.gitkeep -.ci/ +bootstrap/cache/* .env CODE_OF_CONDUCT.md CONTRIBUTING.md @@ -17,7 +17,7 @@ Homestead.yaml node_modules/ npm-debug.log* persist/ -phpunit.xml +phpunit* Procfile public/storage/ resources/vendor/ @@ -27,6 +27,13 @@ scripts/tests scripts/vagrant server.php sonar-project.properties +storage/app/public/* +storage/debugbar/* +storage/framework/cache/* +storage/framework/sessions/* +storage/framework/views/* +storage/logs/* .styleci.yml tests/ .travis.yml* +vendor/ \ No newline at end of file diff --git a/scripts/tests/runtests.sh b/scripts/tests/runtests.sh index ca1413dbda5..fc1eaab368f 100755 --- a/scripts/tests/runtests.sh +++ b/scripts/tests/runtests.sh @@ -2,7 +2,7 @@ set -evuo pipefail SELF_PATH=$(cd -P -- "$(dirname -- "$0")" && /bin/pwd -P) -ROOT=$(realpath $SELF_PATH/..) +ROOT=$(realpath $SELF_PATH/../..) HOST=localhost $SELF_PATH/start-selenium.sh diff --git a/scripts/tests/server-cc.php b/scripts/tests/server-cc.php index 1ab9a48b2e3..9db16959a29 100644 --- a/scripts/tests/server-cc.php +++ b/scripts/tests/server-cc.php @@ -7,7 +7,7 @@ /** Coverage files destination. */ const STORAGE = '/results/coverage'; -$root = realpath(__DIR__.'/../'); +$root = realpath(__DIR__.'/../../'); $uri = urldecode( parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) diff --git a/scripts/tests/start-selenium.sh b/scripts/tests/start-selenium.sh index 39683efd52e..f9ac4572b32 100755 --- a/scripts/tests/start-selenium.sh +++ b/scripts/tests/start-selenium.sh @@ -16,7 +16,7 @@ realpath () set -evuo pipefail SELF_PATH=$(cd -P -- "$(dirname -- "$0")" && /bin/pwd -P) -ROOT=$(realpath $SELF_PATH/..) +ROOT=$(realpath $SELF_PATH/../..) if [ -z "${DISPLAY:-}" ]; then echo Start Xvfb;