PHP version specific tests

Hi,

I was chatting with Yulia Kostrikova on slack about the test in
https://github.com/phpcommunity/phptestfest-php-src/pull/76/files.

In 7.2 it returns "resource (closed)", but in 7.1 it returns "unknown type".

My first response was to add a PHP_VERSION check in the SKIPIF, but this is
almost used nowhere in tests.

What is the best solution to target different PHP versions?

Regards,
Jachim Coudenys
jachimcoudenys@gmail.com

Good question, Jachim, I'll follow this discussion.

···

On Friday, November 17, 2017 at 1:01:28 PM UTC-2, Jachim Coudenys wrote:

Hi,

I was chatting with Yulia Kostrikova on slack about the test in
https://github.com/phpcommunity/phptestfest-php-src/pull/76/files
<https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fphpcommunity%2Fphptestfest-php-src%2Fpull%2F76%2Ffiles&sa=D&sntz=1&usg=AFQjCNEeqcM6LzpK2iq_dDnyZ5IwRGkC1A>
.

In 7.2 it returns "resource (closed)", but in 7.1 it returns "unknown
type".

My first response was to add a PHP_VERSION check in the SKIPIF, but this
is almost used nowhere in tests.

What is the best solution to target different PHP versions?

Regards,
Jachim Coudenys
jachimc...@gmail.com <javascript:>

Hi,

The question was kind of answered on twitter by Sara (
https://twitter.com/SaraMG/status/931637505065193472).

The reason why no PHP_VERSION can be found in SKIPIF in the codebase, is
because the tests only apply to the version branch they were added to (and
newer versions).

The test of Yulia fails because a new PHP version returns something
different ("the output type is probably bugish"), which is should not (yay
for testing).

Regards,
Jachim Coudenys
jachimcoudenys@gmail.com

···

2017-11-19 22:05 GMT+01:00 Rogerio Prado de Jesus <rogeriopradoj@gmail.com>:

Good question, Jachim, I'll follow this discussion.

On Friday, November 17, 2017 at 1:01:28 PM UTC-2, Jachim Coudenys wrote:

Hi,

I was chatting with Yulia Kostrikova on slack about the test in
https://github.com/phpcommunity/phptestfest-php-src/pull/76/files
<https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fphpcommunity%2Fphptestfest-php-src%2Fpull%2F76%2Ffiles&sa=D&sntz=1&usg=AFQjCNEeqcM6LzpK2iq_dDnyZ5IwRGkC1A>
.

In 7.2 it returns "resource (closed)", but in 7.1 it returns "unknown
type".

My first response was to add a PHP_VERSION check in the SKIPIF, but this
is almost used nowhere in tests.

What is the best solution to target different PHP versions?

Regards,
Jachim Coudenys
jachimc...@gmail.com

--
You received this message because you are subscribed to the Google Groups
"PHP TestFest" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to testfest+unsubscribe@phpcommunity.org.
To post to this group, send email to testfest@phpcommunity.org.
Visit this group at https://groups.google.com/a/phpcommunity.org/group/
testfest/.
To view this discussion on the web visit https://groups.google.com/a/
phpcommunity.org/d/msgid/testfest/045e7a7e-3763-40aa-b683-fdcec6dc9a5f%
40phpcommunity.org
<https://groups.google.com/a/phpcommunity.org/d/msgid/testfest/045e7a7e-3763-40aa-b683-fdcec6dc9a5f%40phpcommunity.org?utm_medium=email&utm_source=footer>
.

Hey Jachim!

Nice find! This was brought up in the mailing list here:
https://externals.io/message/101140 and it seems like everyone is on board
with the BC.

So the "correct" answer is to just --EXPECT-- "resource (closed)" since
that's what's expected on the master branch ATM. :slight_smile:

Thanks,
Sammy Kaye Powers
www.SammyK.me

···

On Fri, Nov 17, 2017 at 9:01 AM, Jachim Coudenys <jachimcoudenys@gmail.com> wrote:

Hi,

I was chatting with Yulia Kostrikova on slack about the test in
https://github.com/phpcommunity/phptestfest-php-src/pull/76/files.

In 7.2 it returns "resource (closed)", but in 7.1 it returns "unknown
type".

My first response was to add a PHP_VERSION check in the SKIPIF, but this
is almost used nowhere in tests.

What is the best solution to target different PHP versions?

Regards,
Jachim Coudenys
jachimcoudenys@gmail.com

--
You received this message because you are subscribed to the Google Groups
"PHP TestFest" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to testfest+unsubscribe@phpcommunity.org.
To post to this group, send email to testfest@phpcommunity.org.
Visit this group at https://groups.google.com/a/phpcommunity.org/group/
testfest/.
To view this discussion on the web visit https://groups.google.com/a/
phpcommunity.org/d/msgid/testfest/CAAmbfvc%2BziJDxJpkNWu-20%2BLMYq%
2Bg1bcLfwmYUUvvJtGJeVAwQ%40mail.gmail.com
<https://groups.google.com/a/phpcommunity.org/d/msgid/testfest/CAAmbfvc%2BziJDxJpkNWu-20%2BLMYq%2Bg1bcLfwmYUUvvJtGJeVAwQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
.

Ok, I will fix that test. And as I understood we don't have to care about
SKIPIF version and merely write tests for the master branch?

Hi, so I guess phptt is doing a great job on this, right, because in spite
of the fact it can be run with any of the PHP versions listed in
http://gcov.php.net/, by default it runs against PHP_HEAD (master branch),
isn't?

Then...

phptt test <path-to-phpt>

phptt lcov <path-to-phpt>

phptt generate -f <function-name> [...]

... all is going to run in "best possible branch"!

For guys that doesn't know phptt yet, here is repository:

https://github.com/PHPTestFestBrasil/phptt

phptt, a.k.a php test tools, is totally based on herdphp/docker-phpqa with
several enhancements (we are working with original phpqa authors in order
to merging both projects in just one).

We definitely have to write some phptt tutorials for https://phptestfest.org
website!!!

Best

Rogerio
@RogerioPradoJ
PHPSP / PHPDF / PHPTestFestBrasil

···

Sent from Astro <https://www.helloastro.com> for Android

On 22/11/17 at 12:16, Yulia wrote:

Ok, I will fix that test. And as I understood we don't have to care about
SKIPIF version and merely write tests for the master branch?

--
You received this message because you are subscribed to the Google Groups
"PHP TestFest" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to testfest+unsubscribe@phpcommunity.org.
To post to this group, send email to testfest@phpcommunity.org.
Visit this group at
https://groups.google.com/a/phpcommunity.org/group/testfest/.
To view this discussion on the web visit
https://groups.google.com/a/phpcommunity.org/d/msgid/testfest/2cc8d689-8139-49c7-b8ca-fa2efa1754b9%40phpcommunity.org
<https://groups.google.com/a/phpcommunity.org/d/msgid/testfest/2cc8d689-8139-49c7-b8ca-fa2efa1754b9%40phpcommunity.org?utm_medium=email&utm_source=footer>.