Skip to content

Commit f0bcf37

Browse files
authored
Merge pull request #158 from Cysharp/feature/UnifyHttpClientTest
Use HttpClientTestServer
2 parents 038d19a + 6004fef commit f0bcf37

40 files changed

+170
-913
lines changed

.github/workflows/build-natives.yaml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ jobs:
4949
working-directory: native
5050
steps:
5151
- uses: Cysharp/Actions/.github/actions/checkout@main
52+
with:
53+
submodules: true
5254
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
5355
- run: cargo build --target x86_64-pc-windows-msvc --profile ${{ env._RUST_BUILD_CONFIG == 'debug' && 'dev' || env._RUST_BUILD_CONFIG }}
5456
- uses: Cysharp/Actions/.github/actions/upload-artifact@main
@@ -73,6 +75,8 @@ jobs:
7375
working-directory: native
7476
steps:
7577
- uses: Cysharp/Actions/.github/actions/checkout@main
78+
with:
79+
submodules: true
7680
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
7781
- run: rustup target add aarch64-pc-windows-msvc
7882
- run: |
@@ -100,6 +104,8 @@ jobs:
100104
working-directory: native
101105
steps:
102106
- uses: Cysharp/Actions/.github/actions/checkout@main
107+
with:
108+
submodules: true
103109
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
104110
- run: rustup toolchain install nightly-2024-07-10-x86_64-pc-windows-msvc
105111
- run: rustup component add rust-src --toolchain nightly-2024-07-10-x86_64-pc-windows-msvc
@@ -154,9 +160,9 @@ jobs:
154160
env:
155161
DEBIAN_FRONTEND: noninteractive
156162
- uses: Cysharp/Actions/.github/actions/checkout@main
157-
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
158163
with:
159-
dotnet-version: 8.0.x
164+
submodules: true
165+
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
160166
- uses: actions-rust-lang/setup-rust-toolchain@2fcdc490d667999e01ddbbf0f2823181beef6b39 # v1.15.0
161167
- run: cargo build --target x86_64-unknown-linux-gnu --profile ${{ env._RUST_BUILD_CONFIG == 'debug' && 'dev' || env._RUST_BUILD_CONFIG }}
162168
- uses: Cysharp/Actions/.github/actions/upload-artifact@main
@@ -181,6 +187,8 @@ jobs:
181187
working-directory: native
182188
steps:
183189
- uses: Cysharp/Actions/.github/actions/checkout@main
190+
with:
191+
submodules: true
184192
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
185193
- run: rustup target add x86_64-apple-darwin
186194
- run: cargo build --target x86_64-apple-darwin --profile ${{ env._RUST_BUILD_CONFIG == 'debug' && 'dev' || env._RUST_BUILD_CONFIG }}
@@ -206,6 +214,9 @@ jobs:
206214
working-directory: native
207215
steps:
208216
- uses: Cysharp/Actions/.github/actions/checkout@main
217+
with:
218+
submodules: true
219+
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
209220
- run: rustup target add aarch64-apple-darwin
210221
- run: cargo build --target aarch64-apple-darwin --profile ${{ env._RUST_BUILD_CONFIG == 'debug' && 'dev' || env._RUST_BUILD_CONFIG }}
211222
- uses: Cysharp/Actions/.github/actions/upload-artifact@main
@@ -228,6 +239,8 @@ jobs:
228239
timeout-minutes: 30
229240
steps:
230241
- uses: Cysharp/Actions/.github/actions/checkout@main
242+
with:
243+
submodules: true
231244
- uses: Cysharp/Actions/.github/actions/download-artifact@main
232245
with:
233246
path: native/artifacts
@@ -250,6 +263,8 @@ jobs:
250263
working-directory: native
251264
steps:
252265
- uses: Cysharp/Actions/.github/actions/checkout@main
266+
with:
267+
submodules: true
253268
- run: rustup target add x86_64-apple-ios
254269
- run: cargo build --target x86_64-apple-ios --profile ${{ env._RUST_BUILD_CONFIG == 'debug' && 'dev' || env._RUST_BUILD_CONFIG }}
255270
env:
@@ -272,6 +287,8 @@ jobs:
272287
working-directory: native
273288
steps:
274289
- uses: Cysharp/Actions/.github/actions/checkout@main
290+
with:
291+
submodules: true
275292
- run: rustup target add aarch64-apple-ios
276293
- run: cargo build --target aarch64-apple-ios --profile ${{ env._RUST_BUILD_CONFIG == 'debug' && 'dev' || env._RUST_BUILD_CONFIG }}
277294
env:
@@ -294,6 +311,8 @@ jobs:
294311
working-directory: native
295312
steps:
296313
- uses: Cysharp/Actions/.github/actions/checkout@main
314+
with:
315+
submodules: true
297316
- run: rustup target add aarch64-apple-ios-sim
298317
- run: cargo build --target aarch64-apple-ios-sim --profile ${{ env._RUST_BUILD_CONFIG == 'debug' && 'dev' || env._RUST_BUILD_CONFIG }}
299318
env:
@@ -316,6 +335,8 @@ jobs:
316335
working-directory: native
317336
steps:
318337
- uses: Cysharp/Actions/.github/actions/checkout@main
338+
with:
339+
submodules: true
319340
- name: Use latest Android NDK
320341
run: |
321342
echo "ANDROID_NDK=$ANDROID_NDK_LATEST_HOME" >> $GITHUB_ENV
@@ -343,6 +364,8 @@ jobs:
343364
working-directory: native
344365
steps:
345366
- uses: Cysharp/Actions/.github/actions/checkout@main
367+
with:
368+
submodules: true
346369
- name: Use latest Android NDK
347370
run: |
348371
echo "ANDROID_NDK=$ANDROID_NDK_LATEST_HOME" >> $GITHUB_ENV
@@ -370,6 +393,8 @@ jobs:
370393
working-directory: native
371394
steps:
372395
- uses: Cysharp/Actions/.github/actions/checkout@main
396+
with:
397+
submodules: true
373398
- name: Use latest Android NDK
374399
run: |
375400
echo "ANDROID_NDK=$ANDROID_NDK_LATEST_HOME" >> $GITHUB_ENV
@@ -407,6 +432,9 @@ jobs:
407432
timeout-minutes: 30
408433
steps:
409434
- uses: Cysharp/Actions/.github/actions/checkout@main
435+
with:
436+
submodules: true
437+
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
410438
- uses: Cysharp/Actions/.github/actions/download-artifact@main
411439
with:
412440
path: native/artifacts

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "external/HttpClientTestServer"]
2+
path = external/HttpClientTestServer
3+
url = https://github.com/Cysharp/HttpClientTestServer.git

YetAnotherHttpHandler.slnx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@
1414
<File Path=".github/workflows/build-release.yml" />
1515
</Folder>
1616
<Folder Name="/tests/">
17-
<Project Path="test/YetAnotherHttpHandler.StandaloneTestServer/YetAnotherHttpHandler.StandaloneTestServer.csproj" />
1817
<Project Path="test/YetAnotherHttpHandler.Test/YetAnotherHttpHandler.Test.csproj" />
1918
</Folder>
19+
<Folder Name="/tests/external/">
20+
<Project Path="external/HttpClientTestServer/src/HttpClientTestServer.Abstractions/HttpClientTestServer.Abstractions.csproj" />
21+
<Project Path="external/HttpClientTestServer/src/HttpClientTestServer.Launcher.Container/HttpClientTestServer.Launcher.Container.csproj" />
22+
<Project Path="external/HttpClientTestServer/src/HttpClientTestServer/HttpClientTestServer.csproj" />
23+
</Folder>
2024
<Project Path="src/YetAnotherHttpHandler/YetAnotherHttpHandler.csproj" />
2125
</Solution>

external/HttpClientTestServer

Submodule HttpClientTestServer added at 0f8be71

test/YetAnotherHttpHandler.StandaloneTestServer/Program.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

test/YetAnotherHttpHandler.StandaloneTestServer/Properties/launchSettings.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

test/YetAnotherHttpHandler.StandaloneTestServer/YetAnotherHttpHandler.StandaloneTestServer.csproj

Lines changed: 0 additions & 22 deletions
This file was deleted.

test/YetAnotherHttpHandler.StandaloneTestServer/appsettings.Development.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

test/YetAnotherHttpHandler.StandaloneTestServer/appsettings.json

Lines changed: 0 additions & 21 deletions
This file was deleted.

test/YetAnotherHttpHandler.Test/BackPressureTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public async Task FlushTest(int size)
1515
{
1616
using var httpHandler = new YetAnotherHttpHandler();
1717
using var client = new HttpClient(httpHandler);
18-
await using var server = await LaunchServerAsync<TestServerForHttp1AndHttp2>(TestWebAppServerListenMode.InsecureHttp1Only);
18+
await using var server = await LaunchServerAsync(TestServerListenMode.InsecureHttp1Only);
1919

2020
var numRequests = Environment.ProcessorCount + 1; // more than the number of tokio worker threads
2121

@@ -36,4 +36,4 @@ public async Task FlushTest(int size)
3636

3737
foreach (var stream in pendingStreams) await stream.DisposeAsync();
3838
}
39-
}
39+
}

0 commit comments

Comments
 (0)