Commit graph

7 commits

Author SHA1 Message Date
jenkins-bot
662c41a0fb Merge "Revert "rdbms: optimize insert(), replace(), and upsert() for sqlite when possible"" 2019-10-08 17:06:53 +00:00
Anomie
be8ef0f2c3 Revert "rdbms: optimize insert(), replace(), and upsert() for sqlite when possible"
This reverts commit 4bd1b4b455.

Reason for revert: Incorrect syntax for SQLite "ON CONFLICT (...) DO UPDATE".

Bug: T234795
Change-Id: I987e6e7052368d5d9d0b6de9dd189edc4feaebe5
2019-10-08 16:51:37 +00:00
Umherirrender
fb3914739e Type hint against IResultWrapper
IDatabase::select returns the interface IResultWrapper,
not the implementation ResultWrapper

Change-Id: I8904eff2db48ff00a4a9486be842266c638bc249
2019-10-04 19:58:19 +02:00
Aaron Schulz
4bd1b4b455 rdbms: optimize insert(), replace(), and upsert() for sqlite when possible
Change-Id: Ic884a4ce42a99333f5176f7b681f8a8bba15d2a1
2019-10-03 01:45:24 +00:00
Thiemo Kreuz
32a429e8c4 tests: Prefer assertSame() when comparing the integer 0
assertSame() is guaranteed to not do any type conversion. This can be
critical when acciden tially comparing, for example, 0 to 0.0.

Change-Id: Iffcc9bda69573623ba14af655dcd697d0fcce525
2019-09-19 15:35:23 +00:00
Kosta Harlan
c860482d29 Tests: Set dbname for DatabaseSqliteTest
Bug: T230780
Change-Id: I93d3771233c74443f76b0a402a4820e1e1e30ee7
2019-08-20 11:28:29 +02:00
Kosta Harlan
214750d8d2 Define unit and integration test suites
Following discussion in Ibb8175981092d7f41864e641cc3c118af70a5c76, this patch
proposes to further reduce the scope of what unit tests may access, by removing
the loading of DefaultSettings and GlobalFunctions.php. This also has the
implied effect of disabling the storage backend, as well as the global service
locator.

MediaWikiTestCase is renamed to MediaWikiIntegrationTestCase so it's scope and
purpose is more clear. Whether we still need to keep `@group Database`
annotation around is debatable, as it's unclear to me what the performance costs
are of implying database access for all tests which extend IntegrationTestCase.
As far as I can tell, `@group Database` is primarily used in CI to run faster
tests before slower ones, and with the new UnitTestCase the annotation seems
redundant.

To run all testsuites, use `composer phpunit`. Other composer scripts:

- `composer phpunit:unit` to run unit tests
- `composer phpunit:integration` to run integration tests
- `composer phpunit:coverage` to generate code coverage reports from unit
   tests (requires XDebug).

Note that you can pass arguments to composer scripts with `--`, e.g. `composer
phpunit:integration --exclude-group Dump`.

Other changes:

- Rename bootstrap.php to bootstrap.maintenance.php so it's clear it's part of
  the legacy PHPUnit-as-maintenance-class setup
- Create new bootstrap.php which loads the minimal configuration necessary for
  the tests, and do additional setup in the run() method of the unit/integration
	test case classes
- Move the unit-tests.xml file to phpunit.xml.dist in preparation for this being
  the default test configuration

For a follow-up patch:

- Find unit/integration tests for extensions/skins
- Migrate other test suites from suite.xml
- Support running all tests via vendor/bin/phpunit

Bug: T84948
Bug: T89432
Bug: T87781
Change-Id: Ie717b0ecf4fcfd089d46248f14853c80b7ef4a76
2019-06-28 12:18:18 -04:00
Renamed from tests/phpunit/includes/db/DatabaseSqliteTest.php (Browse further)