Skip to content

Test online tests in CI #8390

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

Closed
wants to merge 4 commits into from
Closed

Conversation

mvorisek
Copy link
Contributor

@mvorisek mvorisek commented Apr 17, 2022

CI setup already heavily relies on internet connection, so run online tests in CI too.

@mvorisek mvorisek changed the base branch from master to PHP-8.0 April 17, 2022 10:21
@mvorisek mvorisek force-pushed the test_online_tests_in_ci branch from 81b5407 to 0393ad0 Compare April 17, 2022 10:21
@mvorisek
Copy link
Contributor Author

mvorisek commented Apr 17, 2022

there is one failing test on MacOS, is it fixable or should the test be skipped on MacOS?

@mvorisek mvorisek closed this Apr 17, 2022
@mvorisek mvorisek deleted the test_online_tests_in_ci branch April 17, 2022 12:10
@mvorisek mvorisek restored the test_online_tests_in_ci branch April 17, 2022 12:11
@mvorisek mvorisek reopened this Apr 17, 2022
@mvorisek
Copy link
Contributor Author

this online test is failing often:

 ========DIFF========
001+ Warning: XMLReader::setRelaxNGSchema(http://docs.oasis-open.org/docbook/rng/5.0/docbook.rng): Failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error

002+  in D:\a\php-src\php-src\ext\xmlreader\tests\bug70309.php on line 30

003+ 

004+ Warning: XMLReader::setRelaxNGSchema(): I/O warning : failed to load external entity "http://docs.oasis-open.org/docbook/rng/5.0/docbook.rng" in D:\a\php-src\php-src\ext\xmlreader\tests\bug70309.php on line 30

005+ 

006+ Warning: XMLReader::setRelaxNGSchema(): xmlRelaxNGParse: could not load http://docs.oasis-open.org/docbook/rng/5.0/docbook.rng in D:\a\php-src\php-src\ext\xmlreader\tests\bug70309.php on line 30

007+ 

008+ Warning: XMLReader::setRelaxNGSchema(): Schema contains errors in D:\a\php-src\php-src\ext\xmlreader\tests\bug70309.php on line 30

     ===DONE===
========DONE========
FAIL XMLReader: Bug #70309 XmlReader read generates extra output [D:\a\php-src\php-src\ext\xmlreader\tests\bug70309.phpt] 

can the test file be downloaded and server using a local test server?

@cmb69
Copy link
Member

cmb69 commented Apr 20, 2022

can the test file be downloaded and server using a local test server?

I'm not even sure that we need to keep this test. It is a regression test for an upstream bug which has been fixed some years ago.

If we want to keep the test, we likely could use a local copy of docbook.rng (would need to double-check its license), but we also could rewrite the test to use some simpler *.rng (it's just about using a non-supported tag name).

@mvorisek
Copy link
Contributor Author

I will remove the test, fixed years ago, for Windows only and also never an issue with php-src code itself.

@mvorisek mvorisek force-pushed the test_online_tests_in_ci branch from 0393ad0 to 2d39ea4 Compare April 20, 2022 11:05
@cmb69
Copy link
Member

cmb69 commented Apr 20, 2022

[…] for Windows only […]

The bug affected all systems, and has been fixed upstream in the meantime.

@mvorisek
Copy link
Contributor Author

The bug affected all systems, and has been fixed upstream in the meantime.

yes, with other part of my head on the Windows CI PR... :D

About the failing test on MacOS:


========DIFF========
002+ 
003+ Warning: socket_send(): Unable to write to socket [22]: Invalid argument in /Users/runner/work/php-src/php-src/ext/sockets/tests/socket_send.php on line 14
     okey
     okey
004- okey
========DONE========
FAIL int socket_send ( resource $socket , string $buf , int $len , int $flags ); [ext/sockets/tests/socket_send.phpt] 

can the support be fixed easily or should the test with MSG_EOR be skipped on MacOS?

@cmb69
Copy link
Member

cmb69 commented Apr 20, 2022

About the failing test on MacOS:


========DIFF========
002+ 
003+ Warning: socket_send(): Unable to write to socket [22]: Invalid argument in /Users/runner/work/php-src/php-src/ext/sockets/tests/socket_send.php on line 14
     okey
     okey
004- okey
========DONE========
FAIL int socket_send ( resource $socket , string $buf , int $len , int $flags ); [ext/sockets/tests/socket_send.phpt] 

can the support be fixed easily or should the test with MSG_EOR be skipped on MacOS?

I wouldn't know. Maybe @devnexen does?

@mvorisek mvorisek marked this pull request as draft April 22, 2022 18:59
@@ -482,7 +482,7 @@ static PHP_MINIT_FUNCTION(sockets)
REGISTER_LONG_CONSTANT("MSG_TRUNC", MSG_TRUNC, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MSG_PEEK", MSG_PEEK, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MSG_DONTROUTE", MSG_DONTROUTE, CONST_CS | CONST_PERSISTENT);
#ifdef MSG_EOR
#if defined(MSG_EOR) && !defined(__APPLE__)
Copy link
Contributor Author

@mvorisek mvorisek Apr 22, 2022

Choose a reason for hiding this comment

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

google for MSG_EOR macos

it seems it is either completely unsupported or it needs SEQPACKET, but it is not used by php

if someone knows better, please advise

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@devnexen do you know?

Copy link
Member

Choose a reason for hiding this comment

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

We cannot change this (definitely not for any of the stable versions, but I don't see a compelling reason to change it for master either). The userland constant should be defined on macOS as well (even if it wouldn't make sense there).

What we likely should change is socket_send.phpt; it seems to me that the MSG_EOR case only works by accident (where it works), since socket_send() is a wrapper for send(2), and POSIX specifies:

MSG_EOR
Terminates a record (if supported by the protocol).

The Linux send manpage clarifies:

MSG_EOR (since Linux 2.2)
Terminates a record (when this notion is supported, as for
sockets of type SOCK_SEQPACKET).

However, the socket we're using here is of type SOCK_STREAM.

It would be good if someone experienced with sockets could review that test; and we should reconsider connecting to a domain which we don't control (yahoo.com).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@devnexen ext/sockets/tests/socket_send.phpt test is failing on MacOS (not in CI, as online tests are skipped), do you think the code can be fixed or the MSG_EOR test be skipped like in https://github.com/php/php-src/pull/8390/files#diff-a516d52fc571b5da772a0ff19826e9bd371e3562eab95ca4a2b71108dda1da8bR26?

@mvorisek mvorisek marked this pull request as ready for review April 26, 2022 12:53
Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

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

@github-actions
Copy link

There has not been any recent activity in this PR. It will automatically be closed in 7 days if no further action is taken.

@github-actions github-actions bot added the Stale label Jul 26, 2022
@mvorisek
Copy link
Contributor Author

not stale

@github-actions github-actions bot removed the Stale label Jul 27, 2022
@mvorisek mvorisek force-pushed the test_online_tests_in_ci branch from a02327a to 4a643cf Compare August 25, 2022 12:41
@mvorisek mvorisek force-pushed the test_online_tests_in_ci branch from 4a643cf to d14c312 Compare August 25, 2022 13:45
@bukka
Copy link
Member

bukka commented Aug 25, 2022

I am not in favor of this as it might depend on external resources that might eventually stop working. In general we should more look into replacing the online tests as often those tests could be done differently and not require it.

@mvorisek
Copy link
Contributor Author

I am not in favor of this as it might depend on external resources that might eventually stop working. In general we should more look into replacing the online tests as often those tests could be done differently and not require it.

This is quite recursive statement. Of course, no external/online tests would be the best. But in a situation they exist, I found them better to be executed as long as there are no frequent random CI failures because of them. Can we aggree on this @bukka or do you have some reason why we should close this PR instead?

@github-actions
Copy link

There has not been any recent activity in this PR. It will automatically be closed in 7 days if no further action is taken.

@github-actions github-actions bot added Stale and removed Stale labels Oct 31, 2022
@mvorisek mvorisek changed the base branch from PHP-8.0 to PHP-8.1 November 12, 2022 14:07
@mvorisek mvorisek closed this Nov 12, 2022
@mvorisek mvorisek deleted the test_online_tests_in_ci branch November 12, 2022 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants