-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* AVRO-2161: Upgrade C# unit tests to NUnit 3 * AVRO-2112: Update C# projects to target .NET Standard/Core and .NET Framework 4.0 * AVRO-2112: Move C# IPC tests to a Avro.ipc.test * AVRO-2112: Ignore C# tests that use System.CodeDom compilation when targeting .NET Core See https://github.com/dotnet/corefx/issues/12180 * AVRO-2112: Replace usage of JToken.ToString() in C# projects In Newtonsoft.Json v3.5, JToken.ToString() returned the raw JSON representation of the token. In later versions of Newtonsoft.Json, JToken.ToString() returns a simple string representation of the value. See the examples below: - v3.5: "\"Hello World\"" - Later versions: "Hello World" In this commit, I've updated the project to work with later versions of Newtonsoft.Json as well as v3.5. I've replaced some usages of JToken.ToString(). When we need the raw JSON representation, we use JsonConvert.Serialize(). When we need the string value of a string JToken, we use JToken.Value<string>(). * AVRO-2112: Update C# README * Update pom.xml with new C# paths to ignore for license check * csharp: Cut support for net35, update Dockerfile and csharp build.sh * Add mono-complete to Dockerfile for build * csharp: Remove unnecessary ProjectGuid elements from projects * Revert to only running tests for Avro.test.dll This is what we were doing on master. I was trying to run the IPC tests, but that has not seemed to work well in our automated builds. * List all tests as they are run * Add build.ps1 and update README * Update Target Frameworks table in README * Try disabling tests that take a long time to run
- Loading branch information
Showing
58 changed files
with
619 additions
and
1,066 deletions.
There are no files selected for viewing
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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,42 @@ | ||
# Avro C# | ||
|
||
## Build & Test | ||
|
||
### Windows | ||
|
||
1. Install [Microsoft Visual Studio Community 2017](https://www.visualstudio.com/downloads/) | ||
2. `./build.ps1 Test` | ||
|
||
### Linux with Mono | ||
|
||
1. Install [Mono v5.18+](https://www.mono-project.com/download/stable/). Install the **mono-devel** | ||
and **mono-complete** packages. | ||
2. `./build.sh test` | ||
|
||
### Linux with .NET Core SDK | ||
|
||
1. Install [.NET Core SDK 2.1+](https://www.microsoft.com/net/download/linux) | ||
2. Build and run unit tests: | ||
``` | ||
cd src/apache/test | ||
dotnet test --framework netcoreapp2.0 | ||
``` | ||
|
||
## Target Frameworks | ||
|
||
The table below shows the frameworks that the various projects target. | ||
|
||
Project | Type | .NET Standard 2.0 | .NET Core 2.0 | .NET Framework 4.0 | ||
------------ | ------------ |:------------------:|:------------------:|:------------------: | ||
Avro.codegen | Exe | | :heavy_check_mark: | :heavy_check_mark: | ||
Avro.ipc | Library | | | :heavy_check_mark: | ||
Avro.ipc.test | Unit Tests | | | :heavy_check_mark: | ||
Avro.main | Exe | :heavy_check_mark: | | :heavy_check_mark: | ||
Avro.msbuild | Library | :heavy_check_mark: | | :heavy_check_mark: | ||
Avro.perf | Exe | | :heavy_check_mark: | :heavy_check_mark: | ||
Avro.test | Unit Tests | | :heavy_check_mark: | :heavy_check_mark: | ||
|
||
|
||
## Notes | ||
|
||
The [LICENSE](./LICENSE) and [NOTICE](./NOTICE) files in the lang/csharp source directory are used to build the binary distribution. The [LICENSE.txt](../../LICENSE.txt) and [NOTICE.txt](../../NOTICE.txt) information for the Avro C# source distribution is in the root directory. |
This file contains 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,59 @@ | ||
#!/usr/bin/env pwsh | ||
|
||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You 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. | ||
|
||
param( | ||
[Parameter(Position=0)] | ||
[ValidateSet('Test')] | ||
[string] | ||
$Target = 'Test', | ||
|
||
[Parameter()] | ||
[ValidateSet('Release', 'Debug')] | ||
[string] | ||
$Configuration = 'Release' | ||
) | ||
|
||
# Catch any PowerShell errors and exit with a non-zero exit code. | ||
$ErrorActionPreference = 'Stop' | ||
trap { | ||
$ErrorActionPreference = 'Continue' | ||
Write-Error $_ | ||
exit 1 | ||
} | ||
|
||
# Checks the LASTEXITCODE. If it is non-zero, exits with that code. | ||
function checkExitCode { | ||
if ($LASTEXITCODE) { | ||
exit $LASTEXITCODE | ||
} | ||
} | ||
|
||
try { | ||
Push-Location $PSScriptRoot | ||
|
||
switch ($Target) { | ||
"Test" { | ||
dotnet build --configuration $Configuration | ||
checkExitCode | ||
|
||
dotnet test --configuration $Configuration --no-build ./src/apache/test/Avro.test.csproj | ||
checkExitCode | ||
} | ||
} | ||
} finally { | ||
Pop-Location | ||
} |
This file contains 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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.