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

Update to PHP 8.3 and PHPUnit 10 #100

Closed

Conversation

tomasnorre
Copy link

This is part of the Coordination for updating exercism PHP track to PHP 8.3 and PHPUnit 10 exercism/php#652

@tomasnorre tomasnorre requested a review from neenjaw as a code owner March 4, 2024 09:14
Copy link

github-actions bot commented Mar 4, 2024

Hello. Thanks for opening a PR on Exercism 🙂

We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in.

You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch.

If you're interested in learning more about this auto-responder, please read this blog post.


Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it.

@@ -1,4 +1,4 @@
FROM php:8.2.7-cli-alpine3.18 AS build
FROM php:8.3.3-cli-alpine3.18 AS build
Copy link
Author

@tomasnorre tomasnorre Mar 4, 2024

Choose a reason for hiding this comment

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

I would even opt for using php:8.3-cli-alpine3.18 instead so that we would not need to maintain on ever minor PHP update. Used full version as it was like that already.

@mk-mxp
Copy link
Contributor

mk-mxp commented Mar 4, 2024

As we just found out: Use XDEBUG_MODE=off for performance reasons.

@tomasnorre
Copy link
Author

@mk-mxp can you reopen this PR? Or does someone else need to do it?

@mk-mxp mk-mxp reopened this Mar 4, 2024
@mk-mxp mk-mxp added x:action/improve Improve existing functionality/content x:knowledge/elementary Little Exercism knowledge required x:module/test-runner Work on Test Runners x:type/ci Work on Continuous Integration (e.g. GitHub Actions workflows) x:size/small Small amount of work x:rep/small Small amount of reputation labels Mar 4, 2024
@mk-mxp
Copy link
Contributor

mk-mxp commented Mar 4, 2024

I can re-open, as I just found out. But I do not have any idea of the inner workings or what might be issues with upgrading.

@tomasnorre
Copy link
Author

I can re-open, as I just found out. But I do not have any idea of the inner workings or what might be issues with upgrading.

Thanks. Will try to figure that out. Found that the ds php extension needed an update.

@mk-mxp
Copy link
Contributor

mk-mxp commented Mar 5, 2024

It looks like there is a change in PHPUnit configuration needed to produce jUnit XML output in the temp directory. Or the output changed, so that there is more work for translating it to JSON for Exercism.

@tomasnorre
Copy link
Author

It looks like there is a change in PHPUnit configuration needed to produce jUnit XML output in the temp directory. Or the output changed, so that there is more work for translating it to JSON for Exercism.

Where did you see this? So I know what to look for. This was unknown to me. But I'm also a little on deep water here, as I don't know where and how the images are used exactly.

@mk-mxp
Copy link
Contributor

mk-mxp commented Mar 5, 2024

It looks like there is a change in PHPUnit configuration needed to produce jUnit XML output in the temp directory. Or the output changed, so that there is more work for translating it to JSON for Exercism.

Where did you see this?

I scanned through the logs of the checks in the box below. Do you have rights enough to read those?

There is warnings about missing files:

PHP Warning:  simplexml_load_file(): I/O warning : failed to load external entity "/tmp/table-test/results.xml" in /opt/test-runner/junit-handler/src/Handler.php on line 20

And there is differences in JSON output like this for test syntax-error, which also says "Test run did not produce any output.":

syntax-error: comparing results.json to expected_results.json
--- /tmp/syntax-error/results.json
+++ /opt/test-runner/tests/syntax-error/expected_results.json
@@ -1 +1 @@
-{"version":3,"tests":[],"status":"error","message":"Test run did not produce any output. Check your code to see if the code exits unexpectedly before the report is generated.\n\nE.g. Using the `die` function will cause the test runner to exist unexpectedly."}
+{"version":3,"status":"fail","tests":[{"name":"testLeapYear","status":"error","test_code":"$this->assertTrue(isLeap(1996));\n","message":"LeapTest::testLeapYear\nParseError: syntax error, unexpected token \"@\", expecting \"(\"\n\n\/opt\/test-runner\/tests\/syntax-error\/Leap.php:5"},{"name":"testNonLeapYear","status":"pass","test_code":"$this->assertFalse(isLeap(1997));\n"},{"name":"testNonLeapEvenYear","status":"pass","test_code":"$this->assertFalse(isLeap(1998));\n"},{"name":"testCentury","status":"pass","test_code":"$this->assertFalse(isLeap(1900));\n"},{"name":"testFourthCentury","status":"pass","test_code":"$this->assertTrue(isLeap(2400));\n"}]}

@tomasnorre
Copy link
Author

As far as I read it, the error handling of PHP Unit has changed, this chapter does not exist in previous versions of the documentation at least. https://docs.phpunit.de/en/10.5/error-handling.html

I haven't figured out what the issue is yet.

@mk-mxp mk-mxp closed this Apr 21, 2024
@tomasnorre tomasnorre deleted the update-to-php83-phpunit10 branch April 21, 2024 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:action/improve Improve existing functionality/content x:knowledge/elementary Little Exercism knowledge required x:module/test-runner Work on Test Runners x:rep/small Small amount of reputation x:size/small Small amount of work x:type/ci Work on Continuous Integration (e.g. GitHub Actions workflows)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants