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

Enhancement: Run end-to-end tests asserting an HTTP response status code #900

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

localheinz
Copy link
Contributor

@localheinz localheinz commented Dec 14, 2023

This pull request

  • runs end-to-end tests asserting an HTTP response status code

Also see #605.

Copy link

github-actions bot commented Dec 14, 2023

🚀 Commit d8fdb48 Deployed on https://web-php-pr-900.preview.thephp.foundation

tests/server Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I copied this file from https://github.com/cubny/php-built-in-server-manager/blob/9a5cbeaad50a108d6058b882b83ba23fbd7722a9/server.

If someone wants to write their own, I'll be happy to copy it.

Copy link

🚀 Deployed on https://web-php-pr-900.preview.thephp.foundation

@localheinz localheinz marked this pull request as ready for review December 14, 2023 16:17
Copy link

🚀 Deployed on https://web-php-pr-900.preview.thephp.foundation

Copy link

🚀 Deployed on https://web-php-pr-900.preview.thephp.foundation

Copy link

🚀 Deployed on https://web-php-pr-900.preview.thephp.foundation

Copy link

🚀 Deployed on https://web-php-pr-900.preview.thephp.foundation

@pronskiy
Copy link
Contributor

@localheinz I tried adding trigger_error('Message', E_USER_ERROR); in search.php (or any other page) and the tests passed green. Is that expected behavior?

@localheinz
Copy link
Contributor Author

@pronskiy

I tried adding trigger_error('Message', E_USER_ERROR); in search.php (or any other page) and the tests passed green. Is that expected behavior?

With 48a8881 and running

php -S localhost:8080 .router.php

I can see the following output in the console:

[Fri Dec 22 15:21:47 2023] [::1]:49172 Accepted
[Fri Dec 22 15:21:47 2023] PHP Fatal error:  Message in /Users/am/Sites/php/web-php/search.php on line 12
[Fri Dec 22 15:21:47 2023] [::1]:49172 [200]: GET /search.php?show=quickref&pattern= - Message in /Users/am/Sites/php/web-php/search.php on line 12
[Fri Dec 22 15:21:47 2023] [::1]:49172 Closing
[Fri Dec 22 15:21:47 2023] [::1]:49173 Accepted
[Fri Dec 22 15:21:47 2023] [::1]:49173 [200]: GET /favicon.ico
[Fri Dec 22 15:21:47 2023] [::1]:49173 Closing

With 48a8881, the tests fail on GitHub Actions, see https://github.com/php/web-php/actions/runs/7300886487/job/19896408958?pr=900.

I do not know why they pass locally and fail on GitHub Actions, but I assume it has something to do with the configuration of PHP.

@localheinz localheinz force-pushed the feature/end-to-end branch 3 times, most recently from a2a8c42 to 30c8014 Compare December 22, 2023 16:32
@@ -0,0 +1,3 @@
[PHP]

display_errors = Off
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pronskiy
Copy link
Contributor

@localheinz with the php.ini it works now 🙏

@localheinz localheinz force-pushed the feature/end-to-end branch 4 times, most recently from 57f79e0 to a18982f Compare January 22, 2024 13:22
Copy link
Member

@saundefined saundefined left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

@saundefined saundefined merged commit d162fe4 into php:master Jan 23, 2024
3 checks passed
@localheinz localheinz deleted the feature/end-to-end branch January 23, 2024 09:59
@localheinz
Copy link
Contributor Author

Thank you, @pronskiy, @saundefined, and @sy-records!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants