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

Add code coverage tool #228

Closed
wants to merge 43 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
aa16ef7
Added coverlet as code coverage tool
sesispla Mar 25, 2018
5128fd8
Increased wait server yield time
sesispla Mar 25, 2018
2595e1c
Added code coverage arguments to ci.sh
sesispla Mar 25, 2018
2ec9a96
Left only coverage collection
sesispla Mar 25, 2018
fc38173
Removed no restore and no rebuild since it may be conflicting with Co…
sesispla Mar 25, 2018
eb6a606
Disabled code coverage for testing purpose
sesispla Mar 25, 2018
641480a
Merge commit 'b3135f72b2dfebacf0da5ac955ccae61efae24fd' into feature/…
sesispla Mar 30, 2018
9b05b32
Updated coverlet to 1.0.1
sesispla Mar 30, 2018
5bfa2aa
Reenabled CollectCoverrage flag
sesispla Mar 30, 2018
46f92f4
Marge from master
sesispla Apr 7, 2018
fd9a421
Merge branch 'master' into feature/codecov
sesispla Jul 7, 2018
faf92e4
Updated coverlet version
sesispla Jul 7, 2018
101b9e5
Merge branch 'master' of https://github.com/kubernetes-client/csharp …
sesispla Aug 17, 2018
f089710
Updated to coverlet 2.2.1
sesispla Aug 17, 2018
81eb75c
Added coveralls setup
sesispla Aug 18, 2018
82ee9b0
chmod test.sh
sesispla Aug 18, 2018
25eaad9
Local tools install
sesispla Aug 18, 2018
0985320
Trying to use relative paths
sesispla Aug 18, 2018
2550c23
Exclude generated files
sesispla Aug 18, 2018
456d592
Added support for codacy coverage
sesispla Aug 18, 2018
a0dc5f6
chmod and codacy tweaks
sesispla Aug 18, 2018
593800a
More codacy
sesispla Aug 18, 2018
767c28e
More codacy
sesispla Aug 18, 2018
3b69b5b
Removed --forceLanguage flag
sesispla Aug 18, 2018
837d6ee
Force language
sesispla Aug 18, 2018
59ebe49
comment
sesispla Aug 18, 2018
8d92ef3
Changed output format
sesispla Aug 18, 2018
0c454cb
Clean up
sesispla Aug 18, 2018
4f45bf3
Added codacy quality and coverage badges (poiting to sesispla codacy)
sesispla Aug 18, 2018
8d03196
Simplified upload name
sesispla Aug 18, 2018
f4f2550
Removed coveralls
sesispla Aug 19, 2018
7cbda54
Switched coverage info to osx
sesispla Aug 19, 2018
31f86f8
Updated brew install command
sesispla Aug 19, 2018
37ed900
Downloading exact version of codacy reporter
sesispla Aug 19, 2018
f391ebe
Merge commit '05273b7db71d6f900b5dd39d2cd8d6821388012f' into feature/…
sesispla Jan 5, 2019
138dc07
Added codacy commands to include code coverage
sesispla Jan 5, 2019
c43a627
Merge branch 'feature/codecov'
sesispla Jan 5, 2019
842fff3
fixed path issues
sesispla Jan 5, 2019
bee35ec
Clean-up
sesispla Jan 5, 2019
b40acd9
More path issues with Travis...
sesispla Jan 5, 2019
19f3492
Re-enabling coverlet
sesispla Jan 5, 2019
aac2e22
Dumb change for final test
sesispla Jan 5, 2019
0ea30a9
Removing unnecesary coverage from osx
sesispla Jan 5, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
.vs
obj/
bin/
tools/**

# User-specific VS files
*.suo
*.user
*.userosscache
*.sln.docstates
coverage.xml

4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ env:
# We need the .NET Core 2.1 SDK to build. Travis doesn't know how to install this yet.
before_install:
- ./install-$TRAVIS_OS_NAME.sh
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then ./integration-tests.sh; fi

script:
- ./ci.sh
- ./ci.sh
- ./$TRAVIS_OS_NAME-unit-test.sh

after_script:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then ./integration-tests.sh; fi
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
[![Travis](https://img.shields.io/travis/kubernetes-client/csharp.svg)](https://travis-ci.org/kubernetes-client/csharp)
[![Client Capabilities](https://img.shields.io/badge/Kubernetes%20client-Silver-blue.svg?style=flat&colorB=C0C0C0&colorA=306CE8)](http://bit.ly/kubernetes-client-capabilities-badge)
[![Client Support Level](https://img.shields.io/badge/kubernetes%20client-beta-green.svg?style=flat&colorA=306CE8)](http://bit.ly/kubernetes-client-support-badge)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/01780bcc92474b1290470804ee7a978d)](https://www.codacy.com/project/sesispla/kubernetes-client-csharp/dashboard)
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/01780bcc92474b1290470804ee7a978d)](https://www.codacy.com/app/sesispla/kubernetes-client-csharp)

# Usage
[Nuget Package](https://www.nuget.org/packages/KubernetesClient/)
Expand Down
8 changes: 3 additions & 5 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ find . -name *.csproj -exec dotnet build {} \;
# Create the NuGet package
cd src/KubernetesClient/
dotnet pack -c Release
cd ../..

# Execute Unit tests
cd tests/KubernetesClient.Tests
dotnet restore
dotnet test
if [[ $? != 0 ]]; then
exit 1
fi

cd ../..
7 changes: 6 additions & 1 deletion install-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsof
sudo apt-get -qq update
sudo apt-get install -y dotnet-sdk-2.1

echo 'Installing code coverage tools...'
sudo apt-get install jq
mkdir -p tools
wget -O ./tools/codacy-coverage-reporter.jar $(curl https://api.github.com/repos/codacy/codacy-coverage-reporter/releases/latest | jq -r .assets[0].browser_download_url)

echo 'Installing kubectl'
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.9.0/bin/linux/amd64/kubectl
chmod +x kubectl
Expand All @@ -24,4 +29,4 @@ minikube addons disable dashboard

echo 'Waiting for the cluster nodes to be ready'
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; \
until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1; done
until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1; done
4 changes: 4 additions & 0 deletions install-osx.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/bin/sh

echo 'Installing Brew...'
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

echo 'Installing .NET Core...'

wget https://download.visualstudio.microsoft.com/download/pr/38102737-cb48-46c2-8f52-fb7102b50ae7/d81958d71c3c2679796e1ecfbd9cc903/dotnet-sdk-2.1.403-osx-x64.pkg -O ~/dotnet-sdk-2.1.403-osx-x64.pkg
Expand Down
12 changes: 12 additions & 0 deletions linux-unit-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Execute Unit tests
cd tests/KubernetesClient.Tests
dotnet restore
dotnet test --no-restore --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=./coverage.xml
cd ../..
echo Uploading coverage...
java -jar ./tools/codacy-coverage-reporter.jar report -l CSharp -r tests/KubernetesClient.Tests/coverage.xml;
if [[ $? != 0 ]]; then
exit 1
fi

cd ../..
10 changes: 10 additions & 0 deletions osx-unit-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Execute Unit tests
cd tests/KubernetesClient.Tests
dotnet restore
dotnet test --no-restore --no-build

if [[ $? != 0 ]]; then
exit 1
fi

cd ../..
4 changes: 4 additions & 0 deletions tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="2.5.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.2" />
<PackageReference Include="System.Reactive" Version="3.1.1" />
Expand Down