From 177e7d5805692713cd5edba42456005c819a41df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Wed, 14 Feb 2024 18:23:30 +0100 Subject: [PATCH 1/5] Use bash instead of PowerShell for Windows CI jobs. --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d2f06620..590c6da7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,6 +60,7 @@ jobs: env: VIBED_DRIVER: vibe-core PARTS: ${{ matrix.parts }} + shell: bash run: | ./run-ci.sh @@ -107,5 +108,6 @@ jobs: env: VIBED_DRIVER: vibe-core PARTS: ${{ matrix.parts }} + shell: bash run: | ./run-ci.sh From 0a7eb7de2a9d51f836be4818ee2d48291f935867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Wed, 14 Feb 2024 18:47:26 +0100 Subject: [PATCH 2/5] Fix test case for Windows. --- tests/vibe.http.client.1389/source/app.d | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/vibe.http.client.1389/source/app.d b/tests/vibe.http.client.1389/source/app.d index a50605556..761983e00 100644 --- a/tests/vibe.http.client.1389/source/app.d +++ b/tests/vibe.http.client.1389/source/app.d @@ -30,10 +30,15 @@ shared static this() auto url = "http://"~serverAddr.toString; logInfo(url); - auto cs = new HTTPClientSettings; - cs.networkInterface = resolveHost("127.0.0.1"); - auto res = requestHTTP(url, null, cs).bodyReader.readAllUTF8(); - assert(res == "local", "Unexpected reply: "~res); + string res; + + version (Windows) {} + else { + auto cs = new HTTPClientSettings; + cs.networkInterface = resolveHost("127.0.0.1"); + res = requestHTTP(url, null, cs).bodyReader.readAllUTF8(); + assert(res == "local", "Unexpected reply: "~res); + } auto cs2 = new HTTPClientSettings; cs2.networkInterface = resolveHost(externalAddr.toAddressString()); From 2fd96821fb4678d3f3d03010d7abfab4aed2bd78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Wed, 14 Feb 2024 21:14:00 +0100 Subject: [PATCH 3/5] Fix test case for different Windows sockets behavior. --- tests/vibe.http.client.1426/source/app.d | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/vibe.http.client.1426/source/app.d b/tests/vibe.http.client.1426/source/app.d index bfb1072d6..6b5047869 100644 --- a/tests/vibe.http.client.1426/source/app.d +++ b/tests/vibe.http.client.1426/source/app.d @@ -9,8 +9,11 @@ extern(C) __gshared string[] rt_options = [ "gcopt=parallel:0" ]; int main () { immutable serverAddr = listenTCP(0, (TCPConnection c) @safe nothrow { - try c.write("HTTP/1.1 200 OK\r\nConnection: Close\r\n\r\nqwerty"); - catch (Exception e) assert(0, e.msg); + try { + // skip request + c.readUntil(cast(immutable(ubyte)[])"\r\n\r\n"); + c.write("HTTP/1.1 200 OK\r\nConnection: Close\r\n\r\nqwerty"); + } catch (Exception e) assert(0, e.msg); }, "127.0.0.1").bindAddress; runTask({ From 5a518c96adaf5d0995a4372be499c3901289792f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Wed, 14 Feb 2024 21:27:57 +0100 Subject: [PATCH 4/5] Fix connection target address in test case. --- tests/vibe.http.server.listenHTTP/source/app.d | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/vibe.http.server.listenHTTP/source/app.d b/tests/vibe.http.server.listenHTTP/source/app.d index 32bfc39e3..0bdbd712e 100644 --- a/tests/vibe.http.server.listenHTTP/source/app.d +++ b/tests/vibe.http.server.listenHTTP/source/app.d @@ -9,9 +9,11 @@ import std.socket : AddressFamily; shared static this() { - immutable serverAddr = listenHTTP(":0", (scope req, scope res) { + immutable serverPort = listenHTTP(":0", (scope req, scope res) { res.writeBody("Hello world."); - }).bindAddresses.find!(addr => addr.family == AddressFamily.INET).front; + }).bindAddresses.find!(addr => addr.family == AddressFamily.INET).front.port; + auto serverAddr = resolveHost("127.0.0.1"); + serverAddr.port = serverPort; runTask({ scope (exit) exitEventLoop(); From c95a80242c1e33f494ac55208c63843900724ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Wed, 14 Feb 2024 21:28:05 +0100 Subject: [PATCH 5/5] Skip x86 build on Windows due to out-of-memory errors on the CI machines. --- .github/workflows/ci.yml | 4 +++- run-ci.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 590c6da7e..6d9a6f335 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,6 +60,7 @@ jobs: env: VIBED_DRIVER: vibe-core PARTS: ${{ matrix.parts }} + OS: ${{ matrix.os }} shell: bash run: | ./run-ci.sh @@ -104,10 +105,11 @@ jobs: compiler: ${{ matrix.dc }} dub: 1.29.0 - - name: '[POSIX] Run tests' + - name: '[WINDOWS] Run tests' env: VIBED_DRIVER: vibe-core PARTS: ${{ matrix.parts }} + OS: ${{ matrix.os }} shell: bash run: | ./run-ci.sh diff --git a/run-ci.sh b/run-ci.sh index 2edc82c92..fe4674962 100755 --- a/run-ci.sh +++ b/run-ci.sh @@ -24,7 +24,7 @@ if [[ $PARTS =~ (^|,)builds(,|$) ]]; then dub clean --all-packages # test for successful 32-bit build - if [ "$DC" == "dmd" ]; then + if [ "$DC" == "dmd" && "$OS" != "windows-latest" ]; then dub build --combined --arch=x86 dub clean --all-packages fi