forked from kubernetes-client/csharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run integration tests as part of CI (after kubernetes-client#129) (ku…
…bernetes-client#131) * Run CI scripts on both Mac and Linux * Fix AuthTests for macOS * Use SocketsHttpHandler * Install minikube on the Travis CI servers * Add integration tests * Fix an issue where StreamConnectAsync would crash if the credentials were not set
- Loading branch information
1 parent
12769b6
commit cf1c995
Showing
6 changed files
with
126 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,30 @@ | ||
sudo: required | ||
dist: trusty | ||
|
||
os: | ||
- osx | ||
- linux | ||
|
||
language: csharp | ||
sudo: false | ||
matrix: | ||
include: | ||
- mono: none | ||
dist: trusty | ||
# We need the .NET Core 2.1 (preview 1) SDK to build. Travis doesn't know how to install this yet. | ||
before_install: | ||
- echo 'Installing .NET Core...' | ||
- export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 | ||
- export DOTNET_CLI_TELEMETRY_OPTOUT=1 | ||
- curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg | ||
- sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg | ||
- sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list' | ||
- sudo apt-get -qq update | ||
- sudo apt-get install -y dotnet-sdk-2.1.300-preview1-008174 | ||
mono: none | ||
env: | ||
global: | ||
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 | ||
- DOTNET_CLI_TELEMETRY_OPTOUT=1 | ||
- COMPlus_UseManagedHttpClientHandler=true | ||
|
||
# minikube-related changes | ||
- CHANGE_MINIKUBE_NONE_USER=true | ||
- MINIKUBE_WANTREPORTERRORPROMPT=false | ||
- MINIKUBE_WANTUPDATENOTIFICATION=false | ||
- KUBECONFIG=/home/travis/.kube/config | ||
|
||
# We need the .NET Core 2.1 (preview 1) SDK to build. Travis doesn't know how to install this yet. | ||
before_install: | ||
- ./install-$TRAVIS_OS_NAME.sh | ||
|
||
script: | ||
- ./ci.sh | ||
|
||
after_script: | ||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then ./integration-tests.sh; fi |
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,10 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: nginx | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:1.7.9 | ||
ports: | ||
- containerPort: 80 |
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,27 @@ | ||
#!/bin/sh | ||
echo 'Installing .NET Core...' | ||
|
||
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg | ||
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg | ||
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list' | ||
sudo apt-get -qq update | ||
sudo apt-get install -y dotnet-sdk-2.1.300-preview1-008174 | ||
|
||
echo 'Installing kubecl' | ||
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.9.0/bin/linux/amd64/kubectl | ||
chmod +x kubectl | ||
sudo mv kubectl /usr/local/bin/ | ||
|
||
echo 'Installing minikube' | ||
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.25.0/minikube-linux-amd64 | ||
chmod +x minikube | ||
sudo mv minikube /usr/local/bin/ | ||
|
||
echo 'Creating the minikube cluster' | ||
sudo minikube start --vm-driver=none --kubernetes-version=v1.9.0 --extra-config=apiserver.Authorization.Mode=RBAC | ||
minikube update-context | ||
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 |
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,8 @@ | ||
#!/bin/sh | ||
echo 'Installing .NET Core...' | ||
|
||
wget https://download.microsoft.com/download/D/7/8/D788D3CD-44C4-487D-829B-413E914FB1C3/dotnet-sdk-2.1.300-preview1-008174-osx-x64.pkg -O ~/dotnet-sdk-2.1.300-preview1-008174-osx-x64.pkg | ||
sudo installer -pkg ~/dotnet-sdk-2.1.300-preview1-008174-osx-x64.pkg -target / | ||
|
||
# https://github.com/dotnet/cli/issues/2544 | ||
ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/ |
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,21 @@ | ||
#!/bin/sh | ||
cd examples | ||
|
||
echo 'Creating a nginx pod in the default namespace' | ||
kubectl create -f nginx.yml | ||
|
||
echo 'Running the simple example' | ||
cd simple | ||
dotnet run | ||
|
||
echo 'Running the exec example' | ||
cd ../exec | ||
dotnet run | ||
|
||
echo 'Running the labels example' | ||
cd ../labels | ||
dotnet run | ||
|
||
echo 'Running the namespace example' | ||
cd ../namespace | ||
dotnet run |
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