Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(tests): Run all unit tests on GitHub instead of Drone #41003

Merged
merged 17 commits into from
Jan 26, 2024

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Oct 19, 2023

Summary

Lets move from drone to GitHub this way we can use our runners more flexible and restart flaky tests separatly instead of "drone unrelated".

TODO

  • Do we want to backport this for all branches?
  • Make all the phpunit-summary tests required (someone with super powers)

Checklist

@susnux susnux force-pushed the chore/migrate-behat-to-github branch 7 times, most recently from c53be13 to 8848476 Compare October 19, 2023 22:26
@susnux susnux changed the title [WIP] Run database tests on GitHub chore(tests): Run mysql tests on GitHub instead of drone Oct 19, 2023
@susnux susnux force-pushed the chore/migrate-behat-to-github branch 8 times, most recently from 2fe02b7 to 59abd8e Compare October 20, 2023 00:10
@susnux susnux changed the title chore(tests): Run mysql tests on GitHub instead of drone chore(tests): Run all database tests on GitHub instead of Drone Oct 20, 2023
@susnux susnux added 3. to review Waiting for reviews tests Related to tests CI labels Oct 20, 2023
@susnux susnux force-pushed the chore/migrate-behat-to-github branch from 59abd8e to 27571d5 Compare October 20, 2023 00:37
@susnux susnux requested review from AndyScherzinger, ChristophWurst, juliusknorr, skjnldsv and Pytal and removed request for Pytal October 20, 2023 00:50
@susnux susnux force-pushed the chore/migrate-behat-to-github branch from 27571d5 to dab6424 Compare October 20, 2023 00:54
@susnux susnux marked this pull request as ready for review October 20, 2023 00:55
@susnux susnux requested a review from nickvergessen as a code owner October 20, 2023 00:55
susnux and others added 12 commits January 26, 2024 14:50
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
…Actions

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen force-pushed the chore/migrate-behat-to-github branch from 62d78bf to 590b4fd Compare January 26, 2024 13:56
/**
* We need format method to return a string
* @var OutputFormatterInterface|\PHPUnit\Framework\MockObject\MockObject
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CS complains:

Suggested change
*/
*/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But lets see if there is more, before we fix and rebase

@nickvergessen
Copy link
Member

No DB tests look suspicious

There were 3 failures:

1) OCA\DAV\Tests\unit\CalDAV\Reminder\NotifierTest::testPrepare with data set #0 ('calendar_reminder', array('Title of this event', '2005-08-15T15:52:01+02:00'), 'Title of this event (in 1 hou...nutes)', array('Title of this event', null, 'NC Headquarters', false, '2005-08-15T15:52:01+02:00', false, 'Europe/Berlin', '2005-08-15T17:52:01+02:00', false, 'Europe/Berlin', 'Personal'), 'Calendar: Personal\r\nDate: 2...arters')
Expectation failed for method name is "setParsedSubject" when invoked 1 time(s)
Parameter 0 for invocation OCP\Notification\INotification::setParsedSubject('Title of this event'): OCP\Notification\INotification does not match expected value.
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'Title of this event (in 1 hour, 52 minutes)'
+'Title of this event'

/home/runner/actions-runner/_work/server/server/apps/dav/lib/CalDAV/Reminder/Notifier.php:186
/home/runner/actions-runner/_work/server/server/apps/dav/lib/CalDAV/Reminder/Notifier.php:133
/home/runner/actions-runner/_work/server/server/apps/dav/lib/CalDAV/Reminder/Notifier.php:116
/home/runner/actions-runner/_work/server/server/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php:244

2) OCA\DAV\Tests\unit\CalDAV\Reminder\NotifierTest::testPrepare with data set #1 ('calendar_reminder', array('Title of this event', '2005-08-15T13:00:00+02:00'), 'Title of this event (1 hour ago)', array('Title of this event', null, 'NC Headquarters', false, '2005-08-15T13:00:00+02:00', false, 'Europe/Berlin', '2005-08-15T15:00:00+02:00', false, 'Europe/Berlin', 'Personal'), 'Calendar: Personal\r\nDate: 2...arters')
Expectation failed for method name is "setParsedSubject" when invoked 1 time(s)
Parameter 0 for invocation OCP\Notification\INotification::setParsedSubject('Title of this event'): OCP\Notification\INotification does not match expected value.
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'Title of this event (1 hour ago)'
+'Title of this event'

/home/runner/actions-runner/_work/server/server/apps/dav/lib/CalDAV/Reminder/Notifier.php:186
/home/runner/actions-runner/_work/server/server/apps/dav/lib/CalDAV/Reminder/Notifier.php:133
/home/runner/actions-runner/_work/server/server/apps/dav/lib/CalDAV/Reminder/Notifier.php:116
/home/runner/actions-runner/_work/server/server/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php:244

3) OCA\DAV\Tests\unit\CalDAV\Reminder\NotifierTest::testPassedEvent
Expectation failed for method name is "setParsedSubject" when invoked 1 time(s)
Parameter 0 for invocation OCP\Notification\INotification::setParsedSubject('Title of this event'): OCP\Notification\INotification does not match expected value.
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'Title of this event (6 hours ago)'
+'Title of this event'

/home/runner/actions-runner/_work/server/server/apps/dav/lib/CalDAV/Reminder/Notifier.php:186
/home/runner/actions-runner/_work/server/server/apps/dav/lib/CalDAV/Reminder/Notifier.php:133
/home/runner/actions-runner/_work/server/server/apps/dav/lib/CalDAV/Reminder/Notifier.php:116
/home/runner/actions-runner/_work/server/server/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php:289

Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen
Copy link
Member

Okay we are running into $this->hasPhpDatetimeDiffBug()

if (count($components) > 0 && !$this->hasPhpDatetimeDiffBug()) {
// Limiting to the first three components to prevent
// the string from getting too long
$firstThreeComponents = array_slice($components, 0, 2);
$diffLabel = implode(', ', $firstThreeComponents);
if ($diff->invert) {
$title = $this->l10n->t('%s (in %s)', [$title, $diffLabel]);
} else {
$title = $this->l10n->t('%s (%s ago)', [$title, $diffLabel]);
}
}

php/php-src#9699 (comment)

Now fixed, for PHP 8.1.14 and PHP 8.2.1.

@nickvergessen
Copy link
Member

Our runtime is:

Runtime: PHP 8.1.2-1ubuntu2.13

Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen mentioned this pull request Jan 26, 2024
1 task
Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen merged commit f7dea13 into master Jan 26, 2024
133 of 135 checks passed
@nickvergessen nickvergessen deleted the chore/migrate-behat-to-github branch January 26, 2024 20:11
@szaimen
Copy link
Contributor

szaimen commented Jan 26, 2024

🎉🎉🎉🎉🎉

@nickvergessen
Copy link
Member

Hmpf it merged with red ci.... was not good to enable automerge I guess..

But it's so weird, I extracted the failing S3 test in #43154 and it passes there...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews CI tests Related to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Supported MariaBD versions
5 participants