Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add E2E tests for all built-in checks (#238)
- Loading branch information
1 parent
0db0f5f
commit 8231fb5
Showing
49 changed files
with
2,462 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Test kube-linter via BATS | ||
|
||
on: | ||
- pull_request | ||
- push | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
# Checkout all repo history to make tags available for figuring out kube-linter version during build. | ||
fetch-depth: 0 | ||
|
||
- name: Read Go version from go.mod | ||
run: echo "GO_VERSION=$(grep -E "^go\s+[0-9.]+$" go.mod | cut -d " " -f 2)" >> $GITHUB_ENV | ||
|
||
- name: Setup Go environment | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Cache Go modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Build binaries | ||
run: make build | ||
|
||
- name: Print kube-linter version | ||
run: .gobin/kube-linter version | ||
|
||
- name: Setup BATS | ||
uses: mig4/setup-bats@v1 | ||
with: | ||
bats-version: 1.5.0 | ||
|
||
- name: Run bats tests | ||
run: make e2e-bats |
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 |
---|---|---|
|
@@ -10,3 +10,4 @@ | |
# Empty file touched by `make deps` | ||
/deps | ||
|
||
e2etests/test_helper |
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
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
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,9 @@ | ||
if [[ ! -d "e2etests/test_helper/bats-support" ]]; then | ||
# Download bats-support dynamically so it doesnt need to be added into source | ||
git clone https://github.com/ztombol/bats-support e2etests/test_helper/bats-support --depth 1 | ||
fi | ||
|
||
if [[ ! -d "e2etests/test_helper/redhatcop-bats-library" ]]; then | ||
# Download redhat-cop/bats-library dynamically so it doesnt need to be added into source | ||
git clone https://github.com/redhat-cop/bats-library e2etests/test_helper/redhatcop-bats-library --depth 1 | ||
fi |
Oops, something went wrong.