Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
on:
pull_request:

jobs:
check-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '^1.19'


- name: Unit tests
run: |
go test `go list ./... | grep -v e2e` -coverprofile coverage.out -covermode count
go tool cover -func coverage.out
- name: Quality Gate - Test coverage shall be above threshold
env:
TESTCOVERAGE_THRESHOLD: 0
run: |
echo "Quality Gate: checking test coverage is above threshold ..."
echo "Threshold : $TESTCOVERAGE_THRESHOLD %"
totalCoverage=`go tool cover -func=coverage.out | grep total | grep -Eo '[0-9]+\.[0-9]+'`
echo "Current test coverage : $totalCoverage %"
if (( $(echo "$totalCoverage $TESTCOVERAGE_THRESHOLD" | awk '{print ($1 > $2)}') )); then
echo "OK"
else
echo "Failed"
exit 1
fi
27 changes: 27 additions & 0 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

on:
pull_request:

jobs:
coveralls:
runs-on: ubuntu-latest
steps:
- name: Install Go
if: success()
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Checkout code
uses: actions/checkout@v2
- name: Calc coverage
run: go test `go list ./... | grep -v e2e` -coverprofile coverageRaw.out -covermode count
- name: Remove mocks.go lines
run: |
sed '/mocks.go/d' coverage_raw.out > coverage.out
- name: Convert coverage to lcov
uses: jandelgado/gcov2lcov-action@v1
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
path-to-lcov: coverage.lcov

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Agentbaker
[![Coverage Status](https://coveralls.io/repos/github/UtheMan/AgentBaker/badge.svg?branch=master)](https://coveralls.io/github/UtheMan/AgentBaker?branch=master)

Agentbaker is a collection of components used to provision Kubernetes nodes in Azure.

Expand Down
2 changes: 1 addition & 1 deletion parts/linux/cloud-init/artifacts/cse_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ configureHTTPProxyCA() {
update_cmd="update-ca-trust"
else
cert_dest="/usr/local/share/ca-certificates"
update_cmd="update-ca-certificates"
update_cmd="update-ca-certificates-test"
fi
echo "${HTTP_PROXY_TRUSTED_CA}" | base64 -d > "${cert_dest}/proxyCA.crt" || exit $ERR_UPDATE_CA_CERTS
$update_cmd || exit $ERR_UPDATE_CA_CERTS
Expand Down