From d5f87b7910d443b86be38e32a3ab714231ea1ff6 Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Wed, 2 Jan 2019 16:15:02 +0100 Subject: [PATCH 01/19] .travis.yml and .drone.yml to make automatic CI tests work Signed-off-by: Jonas Sulzer --- .drone.yml | 45 +++++++++++++++++++++++++++++++++++++++++ .travis.yml | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 .drone.yml create mode 100644 .travis.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..5042e6f --- /dev/null +++ b/.drone.yml @@ -0,0 +1,45 @@ +clone: + git: + image: plugins/git + depth: 1 + +pipeline: + check-app-compatbility: + image: nextcloudci/php7.0:php7.0-19 + environment: + - APP_NAME=user_external + - CORE_BRANCH=master + - DB=sqlite + commands: + # Pre-setup steps + - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh + - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB + - cd ../server + + # Code checker + - ./occ app:check-code $APP_NAME -c strong-comparison + - ./occ app:check-code $APP_NAME -c deprecation + - cd apps/$APP_NAME/ + when: + matrix: + TESTS: check-app-compatbility + + signed-off-check: + image: nextcloudci/php7.0:php7.0-19 + environment: + - APP_NAME=user_external + - CORE_BRANCH=master + - DB=sqlite + commands: + - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh + - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB + - cd ../server + - php ./build/signed-off-checker.php + when: + matrix: + TESTS: signed-off-check + +matrix: + include: + - TESTS: signed-off-check + - TESTS: check-app-compatbility diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..e18d5ec --- /dev/null +++ b/.travis.yml @@ -0,0 +1,58 @@ +language: php +php: + - 7.1 + - 7.2 + - 7.3 + +env: + global: + - APP_NAME=user_external + - PHP_COVERAGE=FALSE + matrix: + - DB=sqlite SERVER=nextcloud/travis_ci/master SERVER_BRANCH=master + - DB=sqlite SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable15 + - DB=sqlite SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable14 + - DB=mysql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=master PHP_COVERAGE=TRUE + - DB=mysql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable15 + - DB=mysql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable14 + - DB=pgsql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=master + - DB=pgsql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable15 + - DB=pgsql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable14 + +matrix: + fast_finish: true + +branches: + only: + - master + - /^stable\d+(\.\d+)?$/ + +before_install: + - sudo apt-get -qq update + - sudo apt-get install -y libxml2-utils + - composer install + - wget https://raw.githubusercontent.com/$SERVER/before_install.sh + - . ./before_install.sh "$APP_NAME" "$SERVER_BRANCH" "$DB" + - cd ../core || cd ../server + - php occ app:enable $APP_NAME + +before_script: + # Test lint + - cd apps/$APP_NAME + - find . -name \*.php -exec php -l "{}" \; + +script: + - ant test + + # Check info.xml schema validity + - wget https://apps.nextcloud.com/schema/apps/info.xsd + - xmllint appinfo/info.xml --schema info.xsd --noout + - rm info.xsd + + # Run phpunit tests + - cd tests + - phpunit --configuration phpunit.xml + + # Create coverage report + - sh -c "if [ '$PHP_COVERAGE' != 'FALSE' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi" + - sh -c "if [ '$PHP_COVERAGE' != 'FALSE' ]; then php ocular.phar code-coverage:upload --format=php-clover clover.xml; fi" From 58901eb12a907c897993c568c7af093661d70e24 Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Wed, 2 Jan 2019 16:33:43 +0100 Subject: [PATCH 02/19] remove "composer install" because we don't need it Signed-off-by: Jonas Sulzer --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e18d5ec..dfe24c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,6 @@ branches: before_install: - sudo apt-get -qq update - sudo apt-get install -y libxml2-utils - - composer install - wget https://raw.githubusercontent.com/$SERVER/before_install.sh - . ./before_install.sh "$APP_NAME" "$SERVER_BRANCH" "$DB" - cd ../core || cd ../server From 4ce65b72f035f9d635e9da8a9b6c7eccff75462a Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Wed, 2 Jan 2019 21:19:09 +0100 Subject: [PATCH 03/19] add build.xml for "ant test" Signed-off-by: Jonas Sulzer --- build.xml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 build.xml diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..f0ba5b8 --- /dev/null +++ b/build.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + From c7e652e78f8c17da77335638d69989419b175064 Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Thu, 3 Jan 2019 12:50:59 +0100 Subject: [PATCH 04/19] remove "ant test" Signed-off-by: Jonas Sulzer --- .travis.yml | 2 -- build.xml | 25 ------------------------- 2 files changed, 27 deletions(-) delete mode 100644 build.xml diff --git a/.travis.yml b/.travis.yml index dfe24c3..b39c95d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,8 +41,6 @@ before_script: - find . -name \*.php -exec php -l "{}" \; script: - - ant test - # Check info.xml schema validity - wget https://apps.nextcloud.com/schema/apps/info.xsd - xmllint appinfo/info.xml --schema info.xsd --noout diff --git a/build.xml b/build.xml deleted file mode 100644 index f0ba5b8..0000000 --- a/build.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - From 71e698eae970f8cc41b893596237f50630460949 Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Thu, 3 Jan 2019 12:56:30 +0100 Subject: [PATCH 05/19] do drone tests with php 7.2 Signed-off-by: Jonas Sulzer --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 5042e6f..1a55552 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,7 +5,7 @@ clone: pipeline: check-app-compatbility: - image: nextcloudci/php7.0:php7.0-19 + image: nextcloudci/php7.2:php7.2-9 environment: - APP_NAME=user_external - CORE_BRANCH=master @@ -25,7 +25,7 @@ pipeline: TESTS: check-app-compatbility signed-off-check: - image: nextcloudci/php7.0:php7.0-19 + image: nextcloudci/php7.2:php7.2-9 environment: - APP_NAME=user_external - CORE_BRANCH=master From fe415d1e67e810d1af72cc2653935f979c21eec8 Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Thu, 3 Jan 2019 13:04:17 +0100 Subject: [PATCH 06/19] add [ github_token ] for drone/pr Signed-off-by: Jonas Sulzer --- .drone.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.drone.yml b/.drone.yml index 1a55552..8665516 100644 --- a/.drone.yml +++ b/.drone.yml @@ -35,6 +35,7 @@ pipeline: - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB - cd ../server - php ./build/signed-off-checker.php + secrets: [ github_token ] when: matrix: TESTS: signed-off-check From 8e6c521875d6817ac9194e537e041d7a79f02544 Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Sat, 5 Jan 2019 00:09:39 +0100 Subject: [PATCH 07/19] remove tests with NC 14 as we don't support 14 Signed-off-by: Jonas Sulzer --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index b39c95d..6d0debd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,13 +11,10 @@ env: matrix: - DB=sqlite SERVER=nextcloud/travis_ci/master SERVER_BRANCH=master - DB=sqlite SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable15 - - DB=sqlite SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable14 - DB=mysql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=master PHP_COVERAGE=TRUE - DB=mysql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable15 - - DB=mysql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable14 - DB=pgsql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=master - DB=pgsql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable15 - - DB=pgsql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable14 matrix: fast_finish: true From 5ca6f7cc0e9f63bbc45db0b81ae483cd7f425513 Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Mon, 7 Jan 2019 14:28:12 +0100 Subject: [PATCH 08/19] comment out checks with master Signed-off-by: Jonas Sulzer --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6d0debd..803a7ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,11 +9,11 @@ env: - APP_NAME=user_external - PHP_COVERAGE=FALSE matrix: - - DB=sqlite SERVER=nextcloud/travis_ci/master SERVER_BRANCH=master + # - DB=sqlite SERVER=nextcloud/travis_ci/master SERVER_BRANCH=master - DB=sqlite SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable15 - - DB=mysql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=master PHP_COVERAGE=TRUE - - DB=mysql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable15 - - DB=pgsql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=master + # - DB=mysql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=master PHP_COVERAGE=TRUE + - DB=mysql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable15 PHP_COVERAGE=TRUE + # - DB=pgsql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=master - DB=pgsql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable15 matrix: @@ -21,7 +21,7 @@ matrix: branches: only: - - master + # - master - /^stable\d+(\.\d+)?$/ before_install: From 2bb57cb793e2dea4185424d99a577163e1f379d4 Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Mon, 7 Jan 2019 14:29:50 +0100 Subject: [PATCH 09/19] disable check-code Signed-off-by: Jonas Sulzer --- .drone.yml | 2 +- .travis.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 8665516..f15f075 100644 --- a/.drone.yml +++ b/.drone.yml @@ -43,4 +43,4 @@ pipeline: matrix: include: - TESTS: signed-off-check - - TESTS: check-app-compatbility + # - TESTS: check-app-compatbility diff --git a/.travis.yml b/.travis.yml index 803a7ee..63f09f9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,9 +39,9 @@ before_script: script: # Check info.xml schema validity - - wget https://apps.nextcloud.com/schema/apps/info.xsd - - xmllint appinfo/info.xml --schema info.xsd --noout - - rm info.xsd + # - wget https://apps.nextcloud.com/schema/apps/info.xsd + # - xmllint appinfo/info.xml --schema info.xsd --noout + # - rm info.xsd # Run phpunit tests - cd tests From 25f001bd07e7fe315a93aa260fabae7ae587c777 Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Mon, 7 Jan 2019 18:25:34 +0100 Subject: [PATCH 10/19] remove sign-off-check from drone because we have DCO bot for it Signed-off-by: Jonas Sulzer --- .drone.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.drone.yml b/.drone.yml index f15f075..25e8e59 100644 --- a/.drone.yml +++ b/.drone.yml @@ -24,23 +24,6 @@ pipeline: matrix: TESTS: check-app-compatbility - signed-off-check: - image: nextcloudci/php7.2:php7.2-9 - environment: - - APP_NAME=user_external - - CORE_BRANCH=master - - DB=sqlite - commands: - - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh - - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB - - cd ../server - - php ./build/signed-off-checker.php - secrets: [ github_token ] - when: - matrix: - TESTS: signed-off-check - matrix: include: - - TESTS: signed-off-check # - TESTS: check-app-compatbility From 62ac65735705219712c059613133b6cbf82de924 Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Mon, 7 Jan 2019 18:49:22 +0100 Subject: [PATCH 11/19] test if travis works again `branches: only: -master` allowed Signed-off-by: Jonas Sulzer --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 63f09f9..07177b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ matrix: branches: only: - # - master + - master - /^stable\d+(\.\d+)?$/ before_install: From c80e574a69285913db793470de6082cad92850c7 Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Mon, 7 Jan 2019 19:08:51 +0100 Subject: [PATCH 12/19] try how `phpunit` runs withouth the parameter `--configuration phpunit.xml` Signed-off-by: Jonas Sulzer --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 07177b9..f5a11f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,7 +45,7 @@ script: # Run phpunit tests - cd tests - - phpunit --configuration phpunit.xml + - phpunit # Create coverage report - sh -c "if [ '$PHP_COVERAGE' != 'FALSE' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi" From f982b27bce6b4b0aa7aa3c49d042ed0e7f5d8960 Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Tue, 8 Jan 2019 09:37:02 +0100 Subject: [PATCH 13/19] add configuration.xml Signed-off-by: Jonas Sulzer --- .travis.yml | 2 +- tests/configuration.xml | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 tests/configuration.xml diff --git a/.travis.yml b/.travis.yml index f5a11f4..ecee245 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,7 +45,7 @@ script: # Run phpunit tests - cd tests - - phpunit + - phpunit --configuration configuration.xml # Create coverage report - sh -c "if [ '$PHP_COVERAGE' != 'FALSE' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi" diff --git a/tests/configuration.xml b/tests/configuration.xml new file mode 100644 index 0000000..f0ba5b8 --- /dev/null +++ b/tests/configuration.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + From 0e0ae62c1d8a8c40c26a6802b810d98e008c5419 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 8 Jan 2019 13:40:53 +0100 Subject: [PATCH 14/19] Update tests/configuration.xml Co-Authored-By: violoncelloCH <22591354+violoncelloCH@users.noreply.github.com> --- tests/configuration.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/configuration.xml b/tests/configuration.xml index f0ba5b8..539e566 100644 --- a/tests/configuration.xml +++ b/tests/configuration.xml @@ -1,4 +1,4 @@ - + From 58a852297d84b221d5920b508d963016a609b5a9 Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Tue, 8 Jan 2019 15:00:43 +0100 Subject: [PATCH 15/19] change configuration.xml and add bootstrap.php Signed-off-by: Jonas Sulzer --- tests/bootstrap.php | 15 +++++++++++++ tests/configuration.xml | 49 +++++++++++++++++++++++------------------ 2 files changed, 42 insertions(+), 22 deletions(-) create mode 100644 tests/bootstrap.php diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..c6a574c --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,15 @@ + + - + + + . + config.php + + - - - - - - - - - + + + + ../../user_external + + ../../user_external/l10n + ../../user_external/tests + + + + + + + - - - - - - - - - - - + From c4033073a90dcf764abf28116a81aa8025dd7f86 Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Wed, 27 Feb 2019 17:37:26 +0100 Subject: [PATCH 16/19] disable phpunit tests for now Signed-off-by: Jonas Sulzer --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ecee245..3d706c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,8 +44,8 @@ script: # - rm info.xsd # Run phpunit tests - - cd tests - - phpunit --configuration configuration.xml + # - cd tests + # - phpunit --configuration configuration.xml # Create coverage report - sh -c "if [ '$PHP_COVERAGE' != 'FALSE' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi" From ddf22f48244a5ecccf4f319fc99eac40c82f4fd3 Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Wed, 27 Feb 2019 17:48:23 +0100 Subject: [PATCH 17/19] and disable scrutinizer for now too Signed-off-by: Jonas Sulzer --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3d706c2..c22982a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,5 +48,5 @@ script: # - phpunit --configuration configuration.xml # Create coverage report - - sh -c "if [ '$PHP_COVERAGE' != 'FALSE' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi" - - sh -c "if [ '$PHP_COVERAGE' != 'FALSE' ]; then php ocular.phar code-coverage:upload --format=php-clover clover.xml; fi" + # - sh -c "if [ '$PHP_COVERAGE' != 'FALSE' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi" + # - sh -c "if [ '$PHP_COVERAGE' != 'FALSE' ]; then php ocular.phar code-coverage:upload --format=php-clover clover.xml; fi" From 459c7e5b5a79bd3eeea668a50a1f5cbdfbc2d327 Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Wed, 27 Feb 2019 18:02:18 +0100 Subject: [PATCH 18/19] enable info.xml schema validation instead Signed-off-by: Jonas Sulzer --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index c22982a..fad78b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,9 +39,9 @@ before_script: script: # Check info.xml schema validity - # - wget https://apps.nextcloud.com/schema/apps/info.xsd - # - xmllint appinfo/info.xml --schema info.xsd --noout - # - rm info.xsd + - wget https://apps.nextcloud.com/schema/apps/info.xsd + - xmllint appinfo/info.xml --schema info.xsd --noout + - rm info.xsd # Run phpunit tests # - cd tests From 88f87cfe7dc74941e61927b85718098df66203e2 Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Wed, 27 Feb 2019 20:31:14 +0100 Subject: [PATCH 19/19] reenable check-app-compatibility Signed-off-by: Jonas Sulzer --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 25e8e59..ef6d79d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -26,4 +26,4 @@ pipeline: matrix: include: - # - TESTS: check-app-compatbility + - TESTS: check-app-compatbility