-
Notifications
You must be signed in to change notification settings - Fork 552
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
Test UserNotes\Sorter #606
Conversation
We add a copy of the latest run-tests.php from the PHP-8.0 branch, and tests for the `UserNotes\Sorter` with full code coverage.
How about running these tests on GitHub Actions? See cmb69#1 and localheinz#3. |
Yes, by all means! I didn't set up CI, because I saw PR #605, so wasn't quite sure. |
Enhancement: Run tests on GitHub Actions
I am getting test failures:
Any idea what I am doing wrong? |
Which PHP version are you using? |
|
I'm getting similar test failures on
Looks like something changed in regard to the precision. |
Is there a way to run the tests without producing any files on failure? |
How do you feel about moving the tests? diff --git a/tests/sort_notes_001.phpt b/tests/UserNotes/Sorter/sort_notes_001.phpt
similarity index 96%
rename from tests/sort_notes_001.phpt
rename to tests/UserNotes/Sorter/sort_notes_001.phpt
index adc07611..e9bfac6e 100644
--- a/tests/sort_notes_001.phpt
+++ b/tests/UserNotes/Sorter/sort_notes_001.phpt
@@ -2,7 +2,7 @@
sort some notes
--FILE--
<?php
-require_once __DIR__ . "/../src/UserNotes/Sorter.php";
+require_once __DIR__ . "/../../src/UserNotes/Sorter.php";
$notes = [
[
diff --git a/tests/sort_notes_002.phpt b/tests/UserNotes/Sorter/sort_notes_002.phpt
similarity index 89%
rename from tests/sort_notes_002.phpt
rename to tests/UserNotes/Sorter/sort_notes_002.phpt
index def6d4b1..51387dcb 100644
--- a/tests/sort_notes_002.phpt
+++ b/tests/UserNotes/Sorter/sort_notes_002.phpt
@@ -2,7 +2,7 @@
sort no notes
--FILE--
<?php
-require_once __DIR__ . "/../src/UserNotes/Sorter.php";
+require_once __DIR__ . "/../../src/UserNotes/Sorter.php";
$notes = [];
diff --git a/tests/sort_notes_003.phpt b/tests/UserNotes/Sorter/sort_notes_003.phpt
similarity index 93%
rename from tests/sort_notes_003.phpt
rename to tests/UserNotes/Sorter/sort_notes_003.phpt
index 9e088464..c03af237 100644
--- a/tests/sort_notes_003.phpt
+++ b/tests/UserNotes/Sorter/sort_notes_003.phpt
@@ -2,7 +2,7 @@
sort a single note with no votes
--FILE--
<?php
-require_once __DIR__ . "/../src/UserNotes/Sorter.php";
+require_once __DIR__ . "/../../src/UserNotes/Sorter.php";
$notes = [
[ |
Yeah, I actually expected this; But I'm more concerned about
That is a segfault (aka. access violation on Windows). Maybe it is "just" the old revision (8.0.3).
I don't think so, but there are
I think this is a good idea. The basenames could then be shorted: |
FWIW with 8.1.4 I only get precision errors and no segfaults. I don't have any other PHP 8.0 version installed at the moment, but maybe I will download a newer one and test again |
We also adjust the test expectations.
@kamil-tekiela, I just pushed a commit which is supposed to resolve the precision issue. |
PHP 7.4 - I get some completely different output. |
The current tests pass for me with PHP 7.4.19 and 8.0.19 (haven't tested other versions). |
I downloaded 8.0.20 and no more segfaults. On PHP 7.4.9, the output is:
|
I get these results with |
Fix: Run build on PHP 7.3 instead of PHP 7.2
Co-authored-by: Andreas Möller <[email protected]>
Co-authored-by: Andreas Möller <[email protected]>
Co-authored-by: Andreas Möller <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know much about GH actions to judge if it's correct, but the rest looks fine to me.
Well, then let's merge this; we can still improve the GH action integration if need be. |
We add a copy of the latest run-tests.php from the PHP-8.0 branch, and
tests for the
UserNotes\Sorter
with full code coverage.