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 tests version libs to fix warnings and deprecations #1065

Merged
merged 4 commits into from
Nov 7, 2024

Conversation

joanhey
Copy link
Contributor

@joanhey joanhey commented Nov 7, 2024

v1.6.x work OK with PHP 8.4 (without deprecations)

And add ansi color output to composer in the workflow.

Updated workflow actions.

@joanhey
Copy link
Contributor Author

joanhey commented Nov 7, 2024

Mockery before
image

Before composer ansi output

image

After
image

Js actions deprecated
image

It's deprecated in github actions.
Upgrades action to node 20 to fix warnings
@joanhey joanhey changed the title Update composer.json to use Mockery 1.6.x Update tests version libs to fix warnings and deprecations Nov 7, 2024
@joanhey
Copy link
Contributor Author

joanhey commented Nov 7, 2024

When I have free time, I'll add the tests from testman with Workerman v4.
Are functional tests that work with any runtime.
https://github.com/joanhey/TestMan

Actually fail with Windows and need a bit of work (WIP)
https://github.com/joanhey/TestMan/actions/runs/11721591418/job/32649342860

Workerman server to return the tests
https://github.com/joanhey/TestMan/blob/main/tests/Servers/Workerman4.php

@walkor walkor merged commit c65b347 into walkor:master Nov 7, 2024
24 checks passed
@joanhey joanhey deleted the patch-1 branch November 7, 2024 12:43
@walkor
Copy link
Owner

walkor commented Nov 7, 2024

Thank you very much @joanhey . I'm not sure how much work it will be to add tests for Workerman v4, and since Workerman v5 is about to be released, I don't want the testing for Workerman v4 to take up too much of your time.

@joanhey
Copy link
Contributor Author

joanhey commented Nov 7, 2024

Are functional tests that work with any runtime.
The same tests are for workerman (any version), adapterman, php-cli-server, .... And if we add the server file with swoole, reactphp, php-runtime (symfony), ...
Also with the PHP CLI Server (than have more fails than Workerman or Adapterman, I'll create an issue to php-src).
For Workerman v4 are ready.

But you can help to create it for Workerma v5
Only create it changing this to v5
https://github.com/joanhey/TestMan/blob/main/tests/Servers/Workerman4.php

It's working both versions with the same server file !!

Thank you !!

PD: I think that the same will work with Workerman v5 (without or minimal changes) I'll try it later.
It's working OK

@joanhey
Copy link
Contributor Author

joanhey commented Nov 7, 2024

With this tests, I fixed some problems in Adapterman, Workerman v4 and v5.

@walkor
Copy link
Owner

walkor commented Nov 7, 2024

Thank you for your efforts and contributions! I'm glad to see that these feature tests can work in multiple runtime environments. That's great!

@joanhey
Copy link
Contributor Author

joanhey commented Nov 7, 2024

@walkor
Please try to name the RCs correctly, so it'll be easier to test.

In Composer, RC versions are denoted by a suffix -RC (e.g., 1.1-RC1, 2.0-RC2).

PD: I'll try with the actual names

EDIT: It's working OK with that names without any change.

@joanhey
Copy link
Contributor Author

joanhey commented Nov 7, 2024

The same server file from v4 it's working with Workerman v5.
I need some time, and I'll add to both versions.

https://github.com/joanhey/TestMan/actions/runs/11727346885/job/32668200387?pr=2

@joanhey
Copy link
Contributor Author

joanhey commented Nov 7, 2024

The people are crazy about unit tests, but are only for domain (app) logic.
Any runtime (or server) need to meet the same http rules.

@joanhey
Copy link
Contributor Author

joanhey commented Nov 7, 2024

Later we need to run that functional tests with any event loop system.
It's more important that with different OSs.

@joanhey
Copy link
Contributor Author

joanhey commented Nov 7, 2024

One question??

------------------------------------------------ WORKERMAN -------------------------------------------------
Workerman version:5.0.0-rc.2    PHP version:8.1.30 (Jit off)
------------------------------------------------- WORKERS --------------------------------------------------

We can change that for RFC3875 compliance
https://php.watch/versions/8.3/cli-server-server-software-changes

------------------------------------------------ WORKERMAN -------------------------------------------------
Workerman/5.0.0-rc.2    PHP/8.1.30 (Jit off)
------------------------------------------------- WORKERS --------------------------------------------------

So we have more space to add extra information.

Actually Adapterman use it too.
Adapterman/0.6.1 (Workerman/4.2.0) OK

PD: Adapterman it's using also $_SERVER['SERVER_SOFTWARE'] that I think will be good for Workerman

PD: added as issue

@walkor
Copy link
Owner

walkor commented Nov 8, 2024

#1066
Done

@joanhey
Copy link
Contributor Author

joanhey commented Nov 8, 2024

Added Workerman v4 and v5 to Testman.
Both using the same server file.

But v5 fail in one test (session delete) and perhaps it's a bug in v5, as both use the same server file.

Workerman/4 OK
https://github.com/joanhey/TestMan/actions/runs/11732788915/job/32685757726

Workerman/5 Fail
https://github.com/joanhey/TestMan/actions/runs/11732788887/job/32685757580

Workerman session code in server
https://github.com/joanhey/TestMan/blob/main/tests/Servers/Workerman.php#L185-L213

Pest code for session delete
https://github.com/joanhey/TestMan/blob/main/tests/Functional/Session/SessionTest.php#L76

@walkor can you check it ?

Thank you

PD: It's working in the session set, and fail in session delete (in the part of setting the session) perhaps is a problem with the cache.

PD: Just added Testman in packagist (WIP) for easier testing. Still we need to create a bin

@walkor
Copy link
Owner

walkor commented Nov 8, 2024

Okay, I will fix it right away.

@walkor
Copy link
Owner

walkor commented Nov 8, 2024

Fixed.

@joanhey
Copy link
Contributor Author

joanhey commented Nov 8, 2024

Working OK !!
Using dev-master
https://github.com/joanhey/TestMan/actions/runs/11746572674

PD: 👍 create a new version. Like I said these tests work better than the unit tests !!

@joanhey
Copy link
Contributor Author

joanhey commented Nov 8, 2024

mm still another problem.
It's easy to fix:
image

Fixed: #1069

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.

2 participants