Merge pull request #48215 from nextcloud/bugfix/noid/run-all-unit-tests

fix(tests): Fix test selection and run unit tests of DAV and user_status
This commit is contained in:
Joas Schilling 2024-09-23 12:49:30 +02:00 committed by GitHub
commit bec14dc4a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 28 additions and 15911 deletions

View file

@ -114,20 +114,30 @@ class ContactsMigratorTest extends TestCase {
$exportMetadata = array_filter(['displayName' => $displayName, 'description' => $description]);
$this->assertEquals($importMetadata, $exportMetadata);
$this->assertEquals(count($importCards), count($exportCards));
$this->assertSameSize($importCards, $exportCards);
for ($i = 0; $i < count($importCards); ++$i) {
$this->assertNotEqualsCanonicalizing(
$this->getPropertiesChangedOnImport($importCards[$i]),
$this->getPropertiesChangedOnImport($exportCards[$i]),
);
$importProperties = [];
$exportProperties = [];
for ($i = 0, $iMax = count($importCards); $i < $iMax; ++$i) {
$importProperties[] = $this->getPropertiesChangedOnImport($importCards[$i]);
$exportProperties[] = $this->getPropertiesChangedOnImport($exportCards[$i]);
}
for ($i = 0; $i < count($importCards); ++$i) {
$this->assertEqualsCanonicalizing(
$this->getProperties($importCards[$i]),
$this->getProperties($exportCards[$i]),
);
$this->assertNotEqualsCanonicalizing(
$importProperties,
$exportProperties,
);
$importProperties = [];
$exportProperties = [];
for ($i = 0, $iMax = count($importCards); $i < $iMax; ++$i) {
$importProperties[] = $this->getProperties($importCards[$i]);
$exportProperties[] = $this->getProperties($exportCards[$i]);
}
$this->assertEqualsCanonicalizing(
$importProperties,
$exportProperties,
);
}
}

View file

@ -7,7 +7,7 @@ declare(strict_types=1);
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\UserStatus\Tests\Integration\BackgroundJob;
namespace OCA\UserStatus\Tests\Integration\Service;
use OCA\UserStatus\Service\StatusService;
use OCP\AppFramework\Db\DoesNotExistException;
@ -154,32 +154,26 @@ class StatusServiceIntegrationTest extends TestCase {
);
$this->service->setUserStatus(
'test123',
IUserStatus::AWAY,
IUserStatus::MESSAGE_CALENDAR_BUSY,
IUserStatus::DND,
IUserStatus::MESSAGE_AVAILABILITY,
true,
);
self::assertSame(
'meeting',
'availability',
$this->service->findByUserId('test123')->getMessageId(),
);
$nostatus = $this->service->setUserStatus(
'test123',
IUserStatus::AWAY,
IUserStatus::MESSAGE_AVAILABILITY,
IUserStatus::MESSAGE_CALENDAR_BUSY,
true,
);
self::assertNull($nostatus);
self::assertSame(
IUserStatus::MESSAGE_CALENDAR_BUSY,
IUserStatus::MESSAGE_AVAILABILITY,
$this->service->findByUserId('test123')->getMessageId(),
);
}
public function testCi(): void {
// TODO: remove if CI turns red
self::assertTrue(false);
}
}

View file

@ -6,11 +6,7 @@
*/
function loadDirectory($path): void {
if (strpos($path, 'integration')) {
return;
}
if (strpos($path, 'Integration')) {
if (strpos($path, 'apps/user_ldap/tests/Integration')) {
return;
}