Skip to content

Commit 6f38808

Browse files
authored
Merge pull request #11190 from medyagh/containerd_func
ci: add functional contained
2 parents e42ea6c + fa02590 commit 6f38808

File tree

2 files changed

+202
-0
lines changed

2 files changed

+202
-0
lines changed

.github/workflows/master.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,105 @@ jobs:
183183
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
184184
if [ "$numPass" -lt 36 ];then echo "*** Failed to pass at least 36 ! ***";exit 2;fi
185185
if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi
186+
functional_docker_containerd_ubuntu:
187+
needs: [build_minikube]
188+
env:
189+
TIME_ELAPSED: time
190+
JOB_NAME: "functional_docker_containerd_ubuntu"
191+
GOPOGH_RESULT: ""
192+
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
193+
runs-on: ubuntu-18.04
194+
steps:
195+
- name: Install kubectl
196+
shell: bash
197+
run: |
198+
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/linux/amd64/kubectl
199+
sudo install kubectl /usr/local/bin/kubectl
200+
kubectl version --client=true
201+
- name: Docker Info
202+
shell: bash
203+
run: |
204+
echo "--------------------------"
205+
docker version || true
206+
echo "--------------------------"
207+
docker info || true
208+
echo "--------------------------"
209+
docker system df || true
210+
echo "--------------------------"
211+
docker system info --format='{{json .}}'|| true
212+
echo "--------------------------"
213+
docker ps || true
214+
echo "--------------------------"
215+
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
216+
- uses: actions/setup-go@v2
217+
with:
218+
go-version: ${{env.GO_VERSION}}
219+
stable: true
220+
- name: Install gopogh
221+
222+
shell: bash
223+
run: |
224+
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.6.0/gopogh-linux-amd64
225+
sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
226+
- name: Download Binaries
227+
uses: actions/download-artifact@v1
228+
with:
229+
name: minikube_binaries
230+
- name: Run Integration Test
231+
continue-on-error: false
232+
# bash {0} to allow test to continue to next step. in case of
233+
shell: bash {0}
234+
run: |
235+
cd minikube_binaries
236+
mkdir -p report
237+
mkdir -p testhome
238+
chmod a+x e2e-*
239+
chmod a+x minikube-*
240+
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
241+
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
242+
START_TIME=$(date -u +%s)
243+
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args="--vm-driver=docker --container-runtime=containerd" -test.run TestFunctional -test.timeout=30m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
244+
END_TIME=$(date -u +%s)
245+
TIME_ELAPSED=$(($END_TIME-$START_TIME))
246+
min=$((${TIME_ELAPSED}/60))
247+
sec=$((${TIME_ELAPSED}%60))
248+
TIME_ELAPSED="${min} min $sec seconds "
249+
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
250+
- name: Generate HTML Report
251+
shell: bash
252+
run: |
253+
cd minikube_binaries
254+
export PATH=${PATH}:`go env GOPATH`/bin
255+
go tool test2json -t < ./report/testout.txt > ./report/testout.json || true
256+
STAT=$(gopogh -in ./report/testout.json -out_html ./report/testout.html -out_summary ./report/testout_summary.json -name "${JOB_NAME} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
257+
echo status: ${STAT}
258+
FailNum=$(echo $STAT | jq '.NumberOfFail')
259+
TestsNum=$(echo $STAT | jq '.NumberOfTests')
260+
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
261+
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
262+
echo 'STAT<<EOF' >> $GITHUB_ENV
263+
echo "${STAT}" >> $GITHUB_ENV
264+
echo 'EOF' >> $GITHUB_ENV
265+
- uses: actions/upload-artifact@v1
266+
with:
267+
name: functional_docker_containerd_ubuntu
268+
path: minikube_binaries/report
269+
- name: The End Result functional_docker_containerd_ubuntu
270+
shell: bash
271+
run: |
272+
echo ${GOPOGH_RESULT}
273+
numFail=$(echo $STAT | jq '.NumberOfFail')
274+
numPass=$(echo $STAT | jq '.NumberOfPass')
275+
echo "*******************${numPass} Passes :) *******************"
276+
echo $STAT | jq '.PassedTests' || true
277+
echo "*******************************************************"
278+
echo "---------------- ${numFail} Failures :( ----------------------------"
279+
echo $STAT | jq '.FailedTests' || true
280+
echo "-------------------------------------------------------"
281+
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
282+
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
283+
if [ "$numPass" -lt 36 ];then echo "*** Failed to pass at least 36 ! ***";exit 2;fi
284+
if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi
186285
functional_virtualbox_macos:
187286
needs: [build_minikube]
188287
env:
@@ -781,6 +880,7 @@ jobs:
781880
needs:
782881
[
783882
functional_docker_ubuntu,
883+
functional_docker_containerd_ubuntu,
784884
functional_docker_ubuntu_arm64,
785885
functional_virtualbox_macos,
786886
functional_docker_windows,
@@ -798,6 +898,7 @@ jobs:
798898
mkdir -p all_reports
799899
ls -lah
800900
cp -r ./functional_docker_ubuntu ./all_reports/
901+
cp -r ./functional_docker_containerd_ubuntu ./all_reports/
801902
cp -r ./functional_docker_ubuntu_arm64 ./all_reports/
802903
cp -r ./functional_virtualbox_macos ./all_reports/
803904
cp -r ./functional_docker_windows ./all_reports/

.github/workflows/pr.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,105 @@ jobs:
181181
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
182182
if [ "$numPass" -lt 36 ];then echo "*** Failed to pass at least 36 ! ***";exit 2;fi
183183
if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi
184+
functional_docker_containerd_ubuntu:
185+
needs: [build_minikube]
186+
env:
187+
TIME_ELAPSED: time
188+
JOB_NAME: "functional_docker_containerd_ubuntu"
189+
GOPOGH_RESULT: ""
190+
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
191+
runs-on: ubuntu-18.04
192+
steps:
193+
- name: Install kubectl
194+
shell: bash
195+
run: |
196+
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/linux/amd64/kubectl
197+
sudo install kubectl /usr/local/bin/kubectl
198+
kubectl version --client=true
199+
- name: Docker Info
200+
shell: bash
201+
run: |
202+
echo "--------------------------"
203+
docker version || true
204+
echo "--------------------------"
205+
docker info || true
206+
echo "--------------------------"
207+
docker system df || true
208+
echo "--------------------------"
209+
docker system info --format='{{json .}}'|| true
210+
echo "--------------------------"
211+
docker ps || true
212+
echo "--------------------------"
213+
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
214+
- uses: actions/setup-go@v2
215+
with:
216+
go-version: ${{env.GO_VERSION}}
217+
stable: true
218+
- name: Install gopogh
219+
220+
shell: bash
221+
run: |
222+
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.6.0/gopogh-linux-amd64
223+
sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
224+
- name: Download Binaries
225+
uses: actions/download-artifact@v1
226+
with:
227+
name: minikube_binaries
228+
- name: Run Integration Test
229+
continue-on-error: false
230+
# bash {0} to allow test to continue to next step. in case of
231+
shell: bash {0}
232+
run: |
233+
cd minikube_binaries
234+
mkdir -p report
235+
mkdir -p testhome
236+
chmod a+x e2e-*
237+
chmod a+x minikube-*
238+
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
239+
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
240+
START_TIME=$(date -u +%s)
241+
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args="--vm-driver=docker --container-runtime=containerd" -test.run TestFunctional -test.timeout=30m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
242+
END_TIME=$(date -u +%s)
243+
TIME_ELAPSED=$(($END_TIME-$START_TIME))
244+
min=$((${TIME_ELAPSED}/60))
245+
sec=$((${TIME_ELAPSED}%60))
246+
TIME_ELAPSED="${min} min $sec seconds "
247+
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
248+
- name: Generate HTML Report
249+
shell: bash
250+
run: |
251+
cd minikube_binaries
252+
export PATH=${PATH}:`go env GOPATH`/bin
253+
go tool test2json -t < ./report/testout.txt > ./report/testout.json || true
254+
STAT=$(gopogh -in ./report/testout.json -out_html ./report/testout.html -out_summary ./report/testout_summary.json -name "${JOB_NAME} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
255+
echo status: ${STAT}
256+
FailNum=$(echo $STAT | jq '.NumberOfFail')
257+
TestsNum=$(echo $STAT | jq '.NumberOfTests')
258+
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
259+
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
260+
echo 'STAT<<EOF' >> $GITHUB_ENV
261+
echo "${STAT}" >> $GITHUB_ENV
262+
echo 'EOF' >> $GITHUB_ENV
263+
- uses: actions/upload-artifact@v1
264+
with:
265+
name: functional_docker_containerd_ubuntu
266+
path: minikube_binaries/report
267+
- name: The End Result functional_docker_containerd_ubuntu
268+
shell: bash
269+
run: |
270+
echo ${GOPOGH_RESULT}
271+
numFail=$(echo $STAT | jq '.NumberOfFail')
272+
numPass=$(echo $STAT | jq '.NumberOfPass')
273+
echo "*******************${numPass} Passes :) *******************"
274+
echo $STAT | jq '.PassedTests' || true
275+
echo "*******************************************************"
276+
echo "---------------- ${numFail} Failures :( ----------------------------"
277+
echo $STAT | jq '.FailedTests' || true
278+
echo "-------------------------------------------------------"
279+
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
280+
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
281+
if [ "$numPass" -lt 36 ];then echo "*** Failed to pass at least 36 ! ***";exit 2;fi
282+
if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi
184283
functional_virtualbox_macos:
185284
needs: [build_minikube]
186285
env:
@@ -779,6 +878,7 @@ jobs:
779878
needs:
780879
[
781880
functional_docker_ubuntu,
881+
functional_docker_containerd_ubuntu,
782882
functional_docker_ubuntu_arm64,
783883
functional_virtualbox_macos,
784884
functional_docker_windows,
@@ -796,6 +896,7 @@ jobs:
796896
mkdir -p all_reports
797897
ls -lah
798898
cp -r ./functional_docker_ubuntu ./all_reports/
899+
cp -r ./functional_docker_containerd_ubuntu ./all_reports/
799900
cp -r ./functional_docker_ubuntu_arm64 ./all_reports/
800901
cp -r ./functional_virtualbox_macos ./all_reports/
801902
cp -r ./functional_docker_windows ./all_reports/

0 commit comments

Comments
 (0)