-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Add gRPC interop tests #17040
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
Merged
Merged
Add gRPC interop tests #17040
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
0b7f2d0
WIP add interop tests
JamesNK 22b8365
Clean up
JamesNK d7e80d3
Move test project into build infrastructure
JamesNK 6e74c49
Clean up
JamesNK 63ba180
Remove hardcoded paths
JamesNK a1b61b4
Clean up
JamesNK 1c745e6
Fix build
JamesNK a892da0
Add copyright notices
JamesNK cae017f
Update azure template
JamesNK ca876b1
Fix build
JamesNK e6bf3ee
Fix build?
JamesNK 59c451c
Fix build?
JamesNK 47dd2b6
Add gRPC interop tests to CI
e52af66
Cleanup
3a83d67
Rebase fix
71c0ab4
Include tests assets in build directory for Helix
a3b9a96
Incorporate changes in ProcessEx
7e573e3
Include Grpc test in regular build
d5d4bea
Fixup
bda68fb
Test
1be83e3
exe doesn't always exist
a9ded02
Merge branch 'master' into jamesnk/interoptests
34e6499
Capture logs on helix
c2cbdc4
Maybe this will work
9e9f7d3
There are two application started messages
252c891
Derp
b655372
Cleanup
0738590
Update directory
57a3942
Add interop tests to more pipelines
344bd2d
mkdir
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project> | ||
<Target Name="CollectFunctionalTestPayload" DependsOnTargets="Publish" Returns="@(DependencyPayload)" > | ||
<ItemGroup> | ||
<DependencyPayload Include="@(ResolvedFileToPublish)"> | ||
<RelativePath>$(MSBuildProjectName)\%(ResolvedFileToPublish.RelativePath)</RelativePath> | ||
</DependencyPayload> | ||
</ItemGroup> | ||
</Target> | ||
</Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<Project> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="@(FunctionalTestAssetProjectReference)" ReferenceOutputAssembly="false" /> | ||
</ItemGroup> | ||
|
||
<Target Name="CollectTestAssetPayload" BeforeTargets="GetCopyToOutputDirectoryItems" > | ||
<MSBuild Targets="CollectFunctionalTestPayload" | ||
BuildInParallel="true" | ||
SkipNonexistentTargets="true" | ||
Projects="%(FunctionalTestAssetProjectReference.Identity)" | ||
RebaseOutputs="True"> | ||
<Output TaskParameter="TargetOutputs" ItemName="DependencyPayload" /> | ||
</MSBuild> | ||
|
||
<ItemGroup> | ||
<ContentWithTargetPath | ||
Include="@(DependencyPayload)" | ||
Condition="'@(DependencyPayload->Count())' != '0'"> | ||
<TargetPath>%(DependencyPayload.RelativePath)</TargetPath> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> | ||
</ContentWithTargetPath> | ||
</ItemGroup> | ||
</Target> | ||
|
||
</Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
| ||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.29505.145 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{0FFB3605-0203-450F-80C8-F82CA2E8269F}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "testassets", "testassets", "{F5841B0A-901A-448F-9CC5-4CB393CE86AF}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InteropTests", "test\InteropTests\InteropTests.csproj", "{90BF37E6-B3F1-4EFC-A233-8288D8B32DD2}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InteropWebsite", "test\testassets\InteropWebsite\InteropWebsite.csproj", "{3AB7E8E4-BA36-44CE-844E-39DB66E46D45}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InteropClient", "test\testassets\InteropClient\InteropClient.csproj", "{66E6C55E-E4E3-4F4B-834A-BB34BFE00D2F}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{90BF37E6-B3F1-4EFC-A233-8288D8B32DD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{90BF37E6-B3F1-4EFC-A233-8288D8B32DD2}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{90BF37E6-B3F1-4EFC-A233-8288D8B32DD2}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{90BF37E6-B3F1-4EFC-A233-8288D8B32DD2}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{3AB7E8E4-BA36-44CE-844E-39DB66E46D45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{3AB7E8E4-BA36-44CE-844E-39DB66E46D45}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{3AB7E8E4-BA36-44CE-844E-39DB66E46D45}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{3AB7E8E4-BA36-44CE-844E-39DB66E46D45}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{66E6C55E-E4E3-4F4B-834A-BB34BFE00D2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{66E6C55E-E4E3-4F4B-834A-BB34BFE00D2F}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{66E6C55E-E4E3-4F4B-834A-BB34BFE00D2F}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{66E6C55E-E4E3-4F4B-834A-BB34BFE00D2F}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(NestedProjects) = preSolution | ||
{90BF37E6-B3F1-4EFC-A233-8288D8B32DD2} = {0FFB3605-0203-450F-80C8-F82CA2E8269F} | ||
{3AB7E8E4-BA36-44CE-844E-39DB66E46D45} = {F5841B0A-901A-448F-9CC5-4CB393CE86AF} | ||
{66E6C55E-E4E3-4F4B-834A-BB34BFE00D2F} = {F5841B0A-901A-448F-9CC5-4CB393CE86AF} | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {3CAE66FD-9A59-49C2-B133-1D599225259A} | ||
EndGlobalSection | ||
EndGlobal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.NET Core uses third-party libraries or other resources that may be | ||
distributed under licenses different than the .NET Core software. | ||
|
||
In the event that we accidentally failed to list a required notice, please | ||
bring it to our attention. Post an issue or email us: | ||
|
||
[email protected] | ||
|
||
The attached notices are provided for information only. | ||
|
||
License notice for gRPC interop tests | ||
------------------------------------- | ||
|
||
Copyright 2019 The gRPC Authors | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@ECHO OFF | ||
SET RepoRoot=%~dp0..\.. | ||
%RepoRoot%\build.cmd -projects %~dp0**\*.*proj %* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
repo_root="$DIR/../.." | ||
"$repo_root/build.sh" --projects "$DIR/**/*.*proj" "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@ECHO OFF | ||
|
||
%~dp0..\..\startvs.cmd %~dp0Grpc.sln |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.Diagnostics; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Internal; | ||
using Xunit.Abstractions; | ||
|
||
namespace InteropTests.Helpers | ||
{ | ||
public class ClientProcess : IDisposable | ||
{ | ||
private readonly Process _process; | ||
private readonly ProcessEx _processEx; | ||
private readonly TaskCompletionSource<object> _startTcs; | ||
|
||
public ClientProcess(ITestOutputHelper output, string path, string serverPort, string testCase) | ||
{ | ||
_process = new Process(); | ||
_process.StartInfo = new ProcessStartInfo | ||
{ | ||
RedirectStandardOutput = true, | ||
RedirectStandardError = true, | ||
FileName = "dotnet", | ||
Arguments = @$"{path} --use_tls false --server_port {serverPort} --client_type httpclient --test_case {testCase}" | ||
}; | ||
_process.EnableRaisingEvents = true; | ||
_process.OutputDataReceived += Process_OutputDataReceived; | ||
_process.Start(); | ||
|
||
_processEx = new ProcessEx(output, _process); | ||
|
||
_startTcs = new TaskCompletionSource<object>(TaskCreationOptions.RunContinuationsAsynchronously); | ||
} | ||
|
||
public Task WaitForReady() | ||
{ | ||
return _startTcs.Task; | ||
} | ||
|
||
public int ExitCode => _process.ExitCode; | ||
public Task Exited => _processEx.Exited; | ||
|
||
private void Process_OutputDataReceived(object sender, DataReceivedEventArgs e) | ||
{ | ||
var data = e.Data; | ||
if (data != null) | ||
{ | ||
if (data.Contains("Application started.")) | ||
{ | ||
_startTcs.TrySetResult(null); | ||
} | ||
} | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
_processEx.Dispose(); | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.Threading.Tasks; | ||
using Xunit.Abstractions; | ||
|
||
namespace InteropTests.Helpers | ||
{ | ||
public class InteropTestsFixture : IDisposable | ||
{ | ||
private WebsiteProcess _process; | ||
|
||
public string Path { get; set; } | ||
|
||
|
||
public string ServerPort { get; private set; } | ||
|
||
|
||
public async Task EnsureStarted(ITestOutputHelper output) | ||
{ | ||
if (_process != null) | ||
{ | ||
return; | ||
} | ||
|
||
if (string.IsNullOrEmpty(Path)) | ||
{ | ||
throw new InvalidOperationException("Path has not been set."); | ||
} | ||
|
||
_process = new WebsiteProcess(Path, output); | ||
|
||
await _process.WaitForReady(); | ||
|
||
ServerPort = _process.ServerPort; | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
_process.Dispose(); | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.