Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Try go-httpbin (PR #23398)

69 views
Skip to first unread message

Maarten

unread,
Mar 29, 2023, 1:14:52 PM3/29/23
to wx-...@googlegroups.com, Subscribed

Just a test to see if this will work. When python httpbin fails again, this could be an alternative.


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/23398

Commit Summary

File Changes

(4 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398@github.com>

Maarten

unread,
Mar 29, 2023, 1:16:36 PM3/29/23
to wx-...@googlegroups.com, Push

@MaartenBent pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/push/13119595896@github.com>

Maarten

unread,
Mar 29, 2023, 1:30:03 PM3/29/23
to wx-...@googlegroups.com, Push

@MaartenBent pushed 2 commits.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/push/13119738127@github.com>

Maarten

unread,
Mar 29, 2023, 3:29:54 PM3/29/23
to wx-...@googlegroups.com, Push

@MaartenBent pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/push/13121027820@github.com>

Maarten

unread,
Mar 29, 2023, 3:54:17 PM3/29/23
to wx-...@googlegroups.com, Push

@MaartenBent pushed 1 commit.

  • fcb23b4 fix port, default was 8080


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/push/13121283195@github.com>

Bryan Petty

unread,
Mar 29, 2023, 5:04:36 PM3/29/23
to wx-...@googlegroups.com, Subscribed

I know @vadz did attempt to use this a long time ago once. I don't recall what issues he ran into with it though.

cbb25f6


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/c1489318248@github.com>

Maarten

unread,
Mar 29, 2023, 5:09:20 PM3/29/23
to wx-...@googlegroups.com, Push

@MaartenBent pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/push/13122056921@github.com>

Maarten

unread,
Mar 29, 2023, 5:15:13 PM3/29/23
to wx-...@googlegroups.com, Subscribed

Yes, I remembered that too, and found the below text in the mailing list. Installing works, the only remaining problem I'm looking at now is that it doesn't seem to run in AppVeyor. CURL can't connect / connection refused.

Conclusions so far:

  • running go-httpbin works in all GitHub CI tests
  • can't run go-httpbin in old appveyor containers, it needs at least go 1.16(?). so install it manually
  • go-httpbin (and https://httpbingo.org/ ) responses are slightly different, causing the tests tofail

Also I really, really hate trying to use python/pip in a portable way, this has taken way too much time. So I tried to switch to a version not requiring Python from https://github.com/mccutchen/go-httpbin but I didn't have better luck with Go -- although here it could be due to my total lack of knowledge of it. The "go install" command given in the README didn't
work, and from the documentation it looks like "go get" should be used instead, but it still doesn't work for some reason, even after setting GO{ROOT,PATH} -- it seems to look for the files only locally instead of downloading them for some reason. If anybody knows how to install this under macOS 10.11, please let me know.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/c1489333910@github.com>

Maarten

unread,
Mar 29, 2023, 5:34:22 PM3/29/23
to wx-...@googlegroups.com, Push

@MaartenBent pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/push/13122286000@github.com>

Maarten

unread,
Mar 29, 2023, 5:59:54 PM3/29/23
to wx-...@googlegroups.com, Push

@MaartenBent pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/push/13122494500@github.com>

Maarten

unread,
Mar 29, 2023, 6:01:09 PM3/29/23
to wx-...@googlegroups.com, Push

@MaartenBent pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/push/13122505462@github.com>

Maarten

unread,
Mar 29, 2023, 6:16:27 PM3/29/23
to wx-...@googlegroups.com, Push

@MaartenBent pushed 2 commits.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/push/13122630885@github.com>

Maarten

unread,
Mar 29, 2023, 6:19:35 PM3/29/23
to wx-...@googlegroups.com, Push

@MaartenBent pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/push/13122657723@github.com>

Maarten

unread,
Mar 29, 2023, 6:30:03 PM3/29/23
to wx-...@googlegroups.com, Push

@MaartenBent pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/push/13122749128@github.com>

Maarten

unread,
Mar 29, 2023, 6:39:19 PM3/29/23
to wx-...@googlegroups.com, Push

@MaartenBent pushed 1 commit.

  • e2271ef install needs /q, see if gopath is needed in path


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/push/13122815058@github.com>

Maarten

unread,
Mar 30, 2023, 1:46:24 PM3/30/23
to wx-...@googlegroups.com, Push

@MaartenBent pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/push/13134540126@github.com>

Maarten

unread,
Mar 30, 2023, 2:41:52 PM3/30/23
to wx-...@googlegroups.com, Push

@MaartenBent pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/push/13135143633@github.com>

Maarten

unread,
Mar 30, 2023, 3:11:27 PM3/30/23
to wx-...@googlegroups.com, Push

@MaartenBent pushed 3 commits.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/push/13135450395@github.com>

Maarten

unread,
Mar 30, 2023, 6:36:39 PM3/30/23
to wx-...@googlegroups.com, Push

@MaartenBent pushed 2 commits.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/push/13137368101@github.com>

Maarten

unread,
Apr 2, 2023, 9:15:30 AM4/2/23
to wx-...@googlegroups.com, Push

@MaartenBent pushed 2 commits.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/push/13160250745@github.com>

Maarten

unread,
Apr 2, 2023, 10:51:23 AM4/2/23
to wx-...@googlegroups.com, Subscribed

Closed #23398.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/issue_event/8906563978@github.com>

Maarten

unread,
Apr 2, 2023, 10:57:17 AM4/2/23
to wx-...@googlegroups.com, Subscribed

success


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/c1493362118@github.com>

VZ

unread,
Apr 4, 2023, 11:08:03 AM4/4/23
to wx-...@googlegroups.com, Subscribed

If it works, perhaps we want to switch to it already, without waiting for the next problem?

I haven't compared, but what takes longer: installing Python or Go version?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/c1496141171@github.com>

Maarten

unread,
Apr 4, 2023, 1:48:11 PM4/4/23
to wx-...@googlegroups.com, Subscribed

Build times are all over the place, so it is hard to compare.

On GitHub CI, the setup-python and setup-go actions seem both instant. Comparing Ubuntu 22.04 wxGTK 3 then installing python httpbin takes 5s, building go-httpbin takes 20s.
Appveyor installs Go, this adds between 30s to 60s. And installing go-httpbin seems to take about 10s longer than python httpbin.

python httpbin still seems to fail randomly in one of the builds for the last commit to master: https://ci.appveyor.com/project/wxWidgets/wxwidgets/builds/46699078/job/m30bbfpcqihi6i7q#L3122


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/c1496364796@github.com>

Maarten

unread,
Apr 19, 2023, 4:40:42 PM4/19/23
to wx-...@googlegroups.com, Subscribed

I'll reopen this since it still seems to fail with python: https://ci.appveyor.com/project/wxWidgets/wxwidgets/builds/46818435/job/u8vmba8bh6ey7dmo#L3120


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/c1515350895@github.com>

Maarten

unread,
Apr 19, 2023, 4:40:44 PM4/19/23
to wx-...@googlegroups.com, Subscribed

Reopened #23398.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/issue_event/9050737402@github.com>

VZ

unread,
Apr 20, 2023, 9:34:07 AM4/20/23
to wx-...@googlegroups.com, Subscribed

@vadz commented on this pull request.

Thanks again for working on this, I'm more than willing to try using this, but have a couple of minor questions before merging it.


In tests/net/webrequest.cpp:

> @@ -228,7 +228,7 @@ TEST_CASE_METHOD(RequestFixture,
 
     Create("/base64/VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw==");
     Run();
-    CHECK( request.GetResponse().AsString() == "The quick brown fox jumps over the lazy dog" );
+    CHECK( wxString(request.GetResponse().AsString().c_str()) == "The quick brown fox jumps over the lazy dog" );

Sorry, I am not sure why is this needed?


In tests/net/webrequest.cpp:

> @@ -263,7 +263,7 @@ TEST_CASE_METHOD(RequestFixture,
     pos += strlen(expectedKey);
 
     // There may, or not, be a space after it.
-    while ( wxIsspace(response[pos]) )
+    while ( wxIsspace(response[pos]) || response[pos] == '[' )

Could you please update the comment to explain why do we need to test for [ here? I don't really understand it...


In appveyor.yml:

> @@ -86,15 +88,21 @@ before_build:
 build_script: c:\projects\wxwidgets\build\tools\appveyor.bat
 
 before_test:
+- cmd: |
+    echo Getting and launching httpbin.
+    rmdir %GOROOT% /s /q
+    mkdir %GOROOT%
+    appveyor DownloadFile https://golang.org/dl/go%GOVERSION%.windows-amd64.msi

Just to be clear: we can't use any of Go versions already available on Appveyor?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/review/1393997539@github.com>

Maarten

unread,
Apr 26, 2023, 5:31:09 PM4/26/23
to wx-...@googlegroups.com, Subscribed

@MaartenBent commented on this pull request.


In tests/net/webrequest.cpp:

> @@ -186,11 +186,11 @@ TEST_CASE_METHOD(RequestFixture,
     if ( !InitBaseURL() )
         return;
 
-    Create("/bytes/65536");
+    Create("/bytes/1000");

I changed this to 1000, because go-httpbin doesn't add a content-length header when the size is over 2048 bytes. Resulting in the functions below to return -1.


In tests/net/webrequest.cpp:

> @@ -228,7 +228,7 @@ TEST_CASE_METHOD(RequestFixture,
 
     Create("/base64/VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw==");
     Run();
-    CHECK( request.GetResponse().AsString() == "The quick brown fox jumps over the lazy dog" );
+    CHECK( wxString(request.GetResponse().AsString().c_str()) == "The quick brown fox jumps over the lazy dog" );

The go-httpbin response ends with two \0 characters. See this response.
Converting it to a wxString and back removes these.
I don't want to add the \0 to the string on the right, to keep compatibility with normal httpbin.


In tests/net/webrequest.cpp:

> @@ -263,7 +263,7 @@ TEST_CASE_METHOD(RequestFixture,
     pos += strlen(expectedKey);
 
     // There may, or not, be a space after it.
-    while ( wxIsspace(response[pos]) )
+    while ( wxIsspace(response[pos]) || response[pos] == '[' )

The go-httpbin response returns an array with values instead of just the value. See this response.
I'll update the comment above it.


In appveyor.yml:

> @@ -86,15 +88,21 @@ before_build:
 build_script: c:\projects\wxwidgets\build\tools\appveyor.bat
 
 before_test:
+- cmd: |
+    echo Getting and launching httpbin.
+    rmdir %GOROOT% /s /q
+    mkdir %GOROOT%
+    appveyor DownloadFile https://golang.org/dl/go%GOVERSION%.windows-amd64.msi

Correct. IIRC go-httpbin requires at least 1.16. Most images have 1.13 installed.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/review/1402788801@github.com>

Maarten

unread,
Apr 26, 2023, 6:02:00 PM4/26/23
to wx-...@googlegroups.com, Push

@MaartenBent pushed 2 commits.

  • 23b6574 Use go-httpbin instead of python httpbin
  • 2550738 Update tests to pass with go-httpbin


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/push/13439223286@github.com>

Maarten

unread,
Sep 30, 2023, 11:59:43 AM9/30/23
to wx-...@googlegroups.com, Push

@MaartenBent pushed 2 commits.

  • d70ab00 Use go-httpbin instead of python httpbin
  • c512153 Update tests to pass with go-httpbin

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/push/15241578244@github.com>

VZ

unread,
Mar 12, 2024, 2:26:01 PM3/12/24
to wx-...@googlegroups.com, Subscribed

It looks like something got broken again in Python ecosystem. Can we try switching to this one?


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/c1992292183@github.com>

Maarten

unread,
Mar 12, 2024, 2:30:55 PM3/12/24
to wx-...@googlegroups.com, Subscribed

Sure. I think I addressed all the comments, though not marked them as resolved yet.

I can rebase to check if it still works. But if you want to play with it, I don't mind if you push to this PR.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/c1992299948@github.com>

VZ

unread,
Mar 12, 2024, 2:58:03 PM3/12/24
to wx-...@googlegroups.com, Subscribed

If you could please rebase it, please do, otherwise I will, but I won't be able to do it today and maybe not tomorrow neither, unfortunately, and in the meanwhile Windows CMake CI seems to be permanently broken (i.e. the error above is not just a fluke, I've already tried rerunning the build and it failed again). TIA!


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/c1992340322@github.com>

Maarten

unread,
Mar 12, 2024, 3:37:49 PM3/12/24
to wx-...@googlegroups.com, Push

@MaartenBent pushed 2 commits.

  • 3b6939e Use go-httpbin instead of python httpbin
  • 3c4e102 Update tests to pass with go-httpbin


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23398/push/17511546185@github.com>

Maarten

unread,
Mar 12, 2024, 6:11:54 PM3/12/24