-
Notifications
You must be signed in to change notification settings - Fork 304
Tests with netstandard2.0/2.1 version of KubernetesClient without .NET Core 3.1 #1029
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
Closed
Closed
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
339e399
Update buildtest.yaml
m3nax 195de37
Update buildtest.yaml
m3nax 1ac4166
Added custom property UseLibNetStandard2_1 to E2E.Test and Kubernetes…
m3nax 77ce025
Update buildtest.yaml
m3nax 4b384af
Update buildtest.yaml
m3nax ec6fbc9
Remove net 3.1 from test projects
m3nax f98d588
Merge branch 'netstandard2.1-compilation' of https://github.com/m3nax…
m3nax 8a0cdd4
Update buildtest.yaml
m3nax 8f6592b
Adde UsetNetStandard2_0 flag to E2E.Tests and KubernetesClient.Class…
m3nax 61da23e
Removed UseLibNetStandard2_0 from KubernetesClient.Classic.Tests.csproj
m3nax fbf22dd
Merged with master
m3nax 70940b5
Removed netstandard2.0 action
m3nax c8858e4
Merged branch master in netstandard2.1-compilation
m3nax 5012973
Added netstandard2.0 compilation for KubernetesClient
m3nax 1e91dab
Improved KubernetesClient.csproj inclusion flag
m3nax e1956a5
Excluded watch tests for netstandard2.0
m3nax 37a63d8
Rewritten build and test action for netstandard 2.0/2.1
m3nax 1c7dd0b
Removed if confition from action
m3nax a08875d
Fixed constants naming
m3nax 1ac0d9e
Merged with master
m3nax 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>netstandard2.1;net5.0;net6.0</TargetFrameworks> | ||
<RootNamespace>k8s</RootNamespace> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks> | ||
<RootNamespace>k8s</RootNamespace> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<!--TODO merge util folder --> | ||
<Compile Remove="Util\**" /> | ||
<EmbeddedResource Remove="Util\**" /> | ||
<None Remove="Util\**" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<!--TODO merge util folder --> | ||
<Compile Remove="Util\**" /> | ||
<EmbeddedResource Remove="Util\**" /> | ||
<None Remove="Util\**" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="prometheus-net" Version="6.0.0" /> | ||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.23.1" /> | ||
<PackageReference Include="System.IO.Abstractions" Version="17.2.3" /> | ||
<PackageReference Include="IdentityModel.OidcClient" Version="5.0.2" /> | ||
<ItemGroup> | ||
<PackageReference Include="prometheus-net" Version="6.0.0" /> | ||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.23.1" /> | ||
<PackageReference Include="System.IO.Abstractions" Version="17.2.3" /> | ||
<PackageReference Include="IdentityModel.OidcClient" Version="5.0.2" /> | ||
|
||
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" Condition="'$(TargetFramework)' == 'netstandard2.1'" /> | ||
</ItemGroup> | ||
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" Condition="('$(TargetFramework)' == 'netstandard2.0') or ('$(TargetFramework)' == 'netstandard2.1')" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\KubernetesClient.Models\KubernetesClient.Models.csproj" /> | ||
<ProjectReference Include="..\KubernetesClient.Basic\KubernetesClient.Basic.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\KubernetesClient.Models\KubernetesClient.Models.csproj" /> | ||
<ProjectReference Include="..\KubernetesClient.Basic\KubernetesClient.Basic.csproj" /> | ||
</ItemGroup> | ||
|
||
</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 |
---|---|---|
@@ -1,33 +1,75 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<IsPackable>false</IsPackable> | ||
<SignAssembly>true</SignAssembly> | ||
<RootNamespace>k8s.E2E</RootNamespace> | ||
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<IsPackable>false</IsPackable> | ||
<SignAssembly>true</SignAssembly> | ||
<RootNamespace>k8s.E2E</RootNamespace> | ||
<TargetFrameworks>net5.0;net6.0</TargetFrameworks> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ItemGroup> | ||
|
||
<PackageReference Include="JsonPatch.Net" Version="2.0.4" /> | ||
<PackageReference Include="SharpZipLib" Version="1.4.0" /> | ||
<PackageReference Include="JsonPatch.Net" Version="2.0.4" /> | ||
<PackageReference Include="SharpZipLib" Version="1.4.0" /> | ||
|
||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" /> | ||
|
||
<PackageReference Include="Nito.AsyncEx.Coordination" Version="5.1.2" /> | ||
<PackageReference Include="xunit" Version="2.4.2" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\KubernetesClient\KubernetesClient.csproj" /> | ||
<ProjectReference Include="..\SkipTestLogger\SkipTestLogger.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Update="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.2" /> | ||
</ItemGroup> | ||
<PackageReference Include="Nito.AsyncEx.Coordination" Version="5.1.2" /> | ||
<PackageReference Include="xunit" Version="2.4.2" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\SkipTestLogger\SkipTestLogger.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Update="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.2" /> | ||
</ItemGroup> | ||
|
||
<!-- set -p:KubernetesClientVersion=targetmoniker to force the inclusion of specific version of libraries--> | ||
<!-- example: dotnet build -p:KubernetesClientVersion="netstandard2.0" ./tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj --> | ||
<PropertyGroup> | ||
<KubernetesClientVersion></KubernetesClientVersion> | ||
</PropertyGroup> | ||
|
||
<!-- Display version used in compilation output when is forced--> | ||
<Target Name="DisplayMessages" BeforeTargets="Build" Condition="'$(KubernetesClientVersion)' != ''"> | ||
<message Importance="High" Text="[Flag] KubernetesClient used version = '$(KubernetesClientVersion)'" /> | ||
</Target> | ||
|
||
<Choose> | ||
|
||
<!-- include standard version of KubernetesClient project (auto selected by compiler) --> | ||
<When Condition="'$(KubernetesClientVersion)' == ''"> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\KubernetesClient\KubernetesClient.csproj" /> | ||
</ItemGroup> | ||
</When> | ||
|
||
<!-- include nestandard2.0 version of KubernetesClient project and define KUBERNETESCLIENT_NETSTANDARD2_0 constant for #if preprocessor directives (used for tests exclusion) --> | ||
<When Condition="'$(KubernetesClientVersion)' == 'netstandard2.0'"> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\KubernetesClient\KubernetesClient.csproj" AdditionalProperties="TargetFramework=$(KubernetesClientVersion)" /> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<DefineConstants>KUBERNETESCLIENT_NETSTANDARD2_0</DefineConstants> | ||
</PropertyGroup> | ||
</When> | ||
|
||
|
||
<!-- include nestandard2.1 version of KubernetesClient project and define KUBERNETESCLIENT_NETSTANDARD2_1 constant for #if preprocessor directives (used for tests exclusion) --> | ||
<When Condition="'$(KubernetesClientVersion)' == 'netstandard2.1'"> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\KubernetesClient\KubernetesClient.csproj" AdditionalProperties="TargetFramework=$(KubernetesClientVersion)" /> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<DefineConstants>KUBERNETESCLIENT_NETSTANDARD2_1</DefineConstants> | ||
</PropertyGroup> | ||
</When> | ||
|
||
</Choose> | ||
</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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about this?
any idea to fix asp.net?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't target netstandard2.0/2.1 directly inside test project because , as stated in the docs
and depends by the framework implementation of the apis docs.
xunit can't directly test netstandard because like other programs, require the netstandard api implementation to run xunit docs
The additional property is the only trick i know to test netstandard implementation with xunit.
I tested on my machine the suggestion and, as i wrote, i can't build test project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup that is where i stopped.
prefer it than changing target during build.
it is not testing what is really shipped to nuget.