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

Revive Windows CI #2781

Merged
merged 5 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ jobs:
env:
VIBED_DRIVER: vibe-core
PARTS: ${{ matrix.parts }}
OS: ${{ matrix.os }}
shell: bash
run: |
./run-ci.sh

Expand Down Expand Up @@ -103,9 +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
2 changes: 1 addition & 1 deletion run-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 9 additions & 4 deletions tests/vibe.http.client.1389/source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
7 changes: 5 additions & 2 deletions tests/vibe.http.client.1426/source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
6 changes: 4 additions & 2 deletions tests/vibe.http.server.listenHTTP/source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading