Commit Graph

131 Commits

Author SHA1 Message Date
Louis Chmn f2b91fce0b test: Warn about slow startup time for phpunit tests
Signed-off-by: Louis Chmn <louis@chmn.me>
2026-06-10 15:07:25 +02:00
Ferdinand Thiessen 691aedd13e fix(db): set session timezone to UTC
Some (well all except sqlite) database platforms support timezone
configuration. The problem is that we expect everything in UTC,
but some servers might have set some different default (e.g. in database
configuration or even just because of `TZ` environment variable).

This causes incorrect values when expecting `NOW()` to return the
current time in UTC.

For PHP we already enforce UTC as timezone, this PR adds a middleware
that enforces UTC also as the database connection / session timezone.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-04-01 13:47:03 +02:00
Maksim Sukharev 2c68e65e19 fix(phpunit): migrate from deprecated syntax for PHPUnit 11.1
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
2026-03-19 10:53:56 +01:00
Ferdinand Thiessen e3b34891b0 chore: migrate to PHPUnit 11
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-11-05 15:42:33 +01:00
Côme Chilliet ac61839d1e fix(tests): Fix PHPUnit deprecation warnings in tests
Turn data providers into static methods, mostly.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-09-27 13:05:32 +02:00
Côme Chilliet 1bbf12c465 feat(tests): Fail on PHPUnit warnings and risky tests, show deprecations
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-09-27 13:05:17 +02:00
Joas Schilling 07a0ed0848 ci: Install PHPUnit 10
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-06-06 14:36:27 +02:00
Ferdinand Thiessen 44c7cbcee5 test: restore .htaccess file after running unit tests
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-05-16 13:10:07 +02:00
Andy Scherzinger 5c49a54801 chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-26 20:05:04 +02:00
Joas Schilling 500fa5431d Fix unit tests on PHP 8.3
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-10-16 10:17:22 +02:00
Joas Schilling 3294bbe3bb fix(autotest): Fix PHPUNIT version check in autotest files
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-04-21 15:59:10 +02:00
Joas Schilling 5096d4f5cb Align version number of PHPUnit and give a helping install hint
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-02-02 12:03:09 +01:00
Joas Schilling 5d068ff534 Fix autotest.sh execution
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-02-02 11:58:55 +01:00
Carl Schwan 5b0f7f7501 Use phpunit from composer if available
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2023-01-24 09:34:17 +01:00
Vitor Mattos 32b1d4fc8e Create database to autotest
Followed:
https://github.com/docker-library/docs/blob/master/postgres/README.md#postgres_db

Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-10-21 21:36:27 -03:00
Christoph Wurst b933e997c3 Use custom PHP runtime for PHPUnit execution in autotest
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2022-05-19 13:58:19 +02:00
Daniel Rudolf b3206de736 autotest.sh: Add PHPUNIT_EXE environment variable
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
2021-08-05 16:42:32 +02:00
Vincent Petry 526d36c290 Add connection check in autotest.sh for pgsql docker
When using pgsql docker for testing locally with autotest, make sure to
properly wait for the port to be available.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-07-02 15:26:06 +02:00
Daniel Kesselberg fc8566b253 Move check for missing since tag to autotest-checkers.sh
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-07-14 21:43:19 +02:00
Joas Schilling 027808c019 Remove the prefix setting attempt from our CI
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-05-26 16:56:41 +02:00
Roeland Jago Douma 60c7ef7f5e No need to wait 10 minutes for the DB to get up.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-09-03 15:38:52 +02:00
Roeland Jago Douma 752718e833 Add mariadb 10.0 ci tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-05-01 13:00:49 +02:00
Joas Schilling c32c91d1da Fix whitespaces
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-03-05 09:31:45 +01:00
Joas Schilling e18cc22ed9 Fix database configuration
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-03-05 09:28:36 +01:00
Christoph Wurst 0beb42ebe8 Remove comment about hhvm
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2018-10-09 10:10:31 +02:00
Robin Appelman ac26175a17 add azure unit tests with azurite
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-06-04 16:18:03 +02:00
Joas Schilling 13e04bc7d4 Use phpunit's directory feature
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-02-20 17:40:09 +01:00
Robin Appelman df6e23c98c add ci for swift primary storage
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-02-08 15:18:25 +01:00
Joas Schilling c3424df1f0 Require PHPUnit 6.5 or higher
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-01-24 17:23:59 +01:00
Robin Appelman 95d0b3d490 run postgresql 10 tests in drone
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-11-22 17:57:17 +01:00
Morris Jobke 37c4534adb Remove Jenkins varibales from autotest.sh
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 10:08:58 +01:00
Morris Jobke 9a34c5051f Fix drone
Fix service container host name
check current folder
fix redis for integration test
Fix more hostnames

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-07-14 15:04:18 +02:00
Morris Jobke f73ca1b77f Add redis cluster tests to our CI jobs
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-05-11 17:07:20 -05:00
Morris Jobke ca62984b8c Add 10 seconds sleep time after postgres startup
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-05-10 21:37:09 -05:00
Morris Jobke e696b92297 Wait for Postgres to be available
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-05-08 17:57:49 -05:00
Morris Jobke ecb369b5e8 Add redis support to our CI jobs
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-05-02 15:55:42 -03:00
Joas Schilling 547f6ee009 Only loop over Test cases
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-04-20 12:21:39 +02:00
Morris Jobke d99ce3971b Namespace and array syntax fixes
* minor fixes in preparation of a bigger DB and config PR

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-03-19 14:52:54 -06:00
Robin Appelman ac2542f0f0 add ci support for s3 object store
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-01-02 14:17:19 +01:00
Joas Schilling 11fa8fe7ee Allow to run autotest with phpunit options
Signed-off-by: Joas Schilling <coding@schilljs.com>
2016-11-03 12:04:54 +01:00
Morris Jobke 83770651bc adjust autotest.sh to also wait 600 seconds for mysqlmb4
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2016-11-03 09:45:16 +01:00
Morris Jobke b1235a67de test alternative drone syntax for command options
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2016-10-19 00:15:01 +02:00
Morris Jobke d0a3d17912 add 4 byte mysql test run
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2016-10-19 00:15:01 +02:00
Thomas Müller d294ef23dd fix docker 2016-10-19 00:15:01 +02:00
Thomas Müller 9c3f066dab Adding docker based unit test execution for mysql utf8mb4 2016-10-19 00:15:01 +02:00
Lukas Reschke a1f5364d7f Generate coverage for quick DB tests
This adds the "QUICKDB" group which excludes some tests that abuse unit tests as integration tests as displayed in https://github.com/nextcloud/server/issues/1626

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-10-05 13:55:44 +02:00
Morris Jobke 11cc8903bb add actual check if mysql is up already 2016-09-13 20:52:55 +02:00
Joas Schilling db710e0b03 Make tests work with 4.8 at least 2016-09-13 16:31:33 +02:00
Morris Jobke 3acdc1339d Merge pull request #206 from nextcloud/ci-mysql
Add mysql job to CI
2016-06-30 09:06:19 +02:00
Lukas Reschke 7a9d60d87e Merge remote-tracking branch 'upstream/master' into master-upstream-sync 2016-06-26 12:55:05 +02:00