Skip to content

Import some HTTP tests#36

Open
timschumi wants to merge 3 commits into
CFC-Servers:mainfrom
timschumi:patch/http-tests
Open

Import some HTTP tests#36
timschumi wants to merge 3 commits into
CFC-Servers:mainfrom
timschumi:patch/http-tests

Conversation

@timschumi
Copy link
Copy Markdown

I have been writing behavior tests for HTTP while testing CHTTP, figured I might as well clean them up and import the tests that apply to both.

Draft until I figure out where I can start and kill the testing HTTP server.

@sarahsturgeon
Copy link
Copy Markdown
Member

Haven't read yet, but thank you!

We can host test pages on a subdomain on gluatest.com?

@timschumi
Copy link
Copy Markdown
Author

We can host test pages on a subdomain on gluatest.com?

I'm worried that putting any kind of additional layer in between (reverse proxy, Cloudflare, etc.) or switching to another language (e.g. PHP) may break the sometimes very-intentionally-broken test cases.

Additionally, having this as a locally runnable Python script is probably the best we can get for developer experience, we just need to figure out where to place the following in the CI setup:

"${GITHUB_WORKSPACE}/gmod_tests/lua/tests/gmod/unit/globals/HTTP.py" 1>/dev/null 2>&1 &
until curl --silent "http://127.0.0.1:5000" 1>/dev/null 2>&1; do sleep 1; done

[do the gluatest things]

kill $!

Also, thinking about it, probably a good idea to disable the tests (instead of letting them fail) if the HTTP server isn't running.

@timschumi
Copy link
Copy Markdown
Author

timschumi commented Oct 19, 2025

Figured out launching the server, killing it is optional at this point in time.

Now why does HTTP always fall back to unsuccessful?

EDIT: How much will explode if I just --net=host this?

@timschumi
Copy link
Copy Markdown
Author

Could I get some workflow approval for this?

@timschumi timschumi marked this pull request as ready for review December 24, 2025 21:42
@timschumi
Copy link
Copy Markdown
Author

The x86-64 failure we also get on main, so I suppose this is merge-ready now? Codifying the differences for dedicated servers I will submit in another PR down the line.

@timschumi
Copy link
Copy Markdown
Author

Bump? :^)

@RaphaelIT7
Copy link
Copy Markdown
Collaborator

RaphaelIT7 commented Jan 7, 2026

iirc like 9 months ago when @sarahsturgeon thought of HTTP tests we'd concluded to include the HttpServer module from HolyLib into HolyTest to be used for that purpose.
I think it would be better if that were used instead of Python, as shipping yet more external things needed when the HolyTest DLL exists for that purpose already seems pointless & just more complex.
From looking at the Python code, I think most of it should all work, though the echo_method may be an issue as it won't support TRACE & CONNECT

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.

3 participants