-
Notifications
You must be signed in to change notification settings - Fork 14
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 controller tests and CI #97
Merged
Merged
Changes from 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f515dc9
fix: Use provided rest config
codablock b0c2f62
tests: Add initial ObjectHandler tests
codablock 3b4f38d
ci: Add tests workflow
codablock e82793c
chore: Run make manifests
codablock 49451cd
ci: Use verbose mode when running tests
codablock cee3c2c
fix: Stop using pointers as list elements when not really necessary
codablock 44660af
chore: Run go mod tidy
codablock dd4085a
ci: Use go-version-file instead of go-version
codablock 9c62dfb
tests: Use typed objects when possible
codablock 31c2568
tests: Don't use client2 alias
codablock fa92d68
tests: Remove temporary kubeconfig
codablock f0f5e34
tests: Move utility functions into own source file
codablock File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,91 @@ | ||||||
name: tests | ||||||
|
||||||
on: | ||||||
push: | ||||||
branches: | ||||||
- main | ||||||
- release-v* | ||||||
pull_request: | ||||||
branches: | ||||||
- main | ||||||
|
||||||
jobs: | ||||||
generate-checks: | ||||||
runs-on: ubuntu-latest | ||||||
steps: | ||||||
- name: Checkout | ||||||
uses: actions/checkout@v4 | ||||||
with: | ||||||
fetch-depth: 0 | ||||||
- uses: actions/setup-go@v5 | ||||||
with: | ||||||
go-version: '1.22' | ||||||
- uses: actions/cache@v4 | ||||||
with: | ||||||
path: | | ||||||
~/go/pkg/mod | ||||||
~/.cache/go-build | ||||||
key: generate-check-go-${{ runner.os }}-${{ hashFiles('**/go.sum') }} | ||||||
restore-keys: | | ||||||
generate-check-go-${{ runner.os }}- | ||||||
- name: Verify generated source is up-to-date | ||||||
run: | | ||||||
make generate | ||||||
if [ ! -z "$(git status --porcelain)" ]; then | ||||||
echo "make generate must be invoked and the result committed" | ||||||
git status | ||||||
git diff | ||||||
exit 1 | ||||||
fi | ||||||
- name: Verify generated manifests are up-to-date | ||||||
run: | | ||||||
make manifests | ||||||
if [ ! -z "$(git status --porcelain)" ]; then | ||||||
echo "make manifests must be invoked and the result committed" | ||||||
git status | ||||||
git diff | ||||||
exit 1 | ||||||
fi | ||||||
- name: Verify generated api-docs are up-to-date | ||||||
run: | | ||||||
make api-docs | ||||||
if [ ! -z "$(git status --porcelain)" ]; then | ||||||
echo "make api-docs must be invoked and the result committed" | ||||||
git status | ||||||
git diff | ||||||
exit 1 | ||||||
fi | ||||||
- name: Verify go.mod and go.sum are clean | ||||||
run: | | ||||||
go mod tidy | ||||||
if [ ! -z "$(git status --porcelain)" ]; then | ||||||
echo "go mod tidy must be invoked and the result committed" | ||||||
git status | ||||||
git diff | ||||||
exit 1 | ||||||
fi | ||||||
|
||||||
tests: | ||||||
runs-on: ubuntu-22.04 | ||||||
name: tests | ||||||
steps: | ||||||
- name: Checkout | ||||||
uses: actions/checkout@v4 | ||||||
- uses: actions/setup-go@v5 | ||||||
with: | ||||||
go-version: '1.22' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
- uses: actions/setup-python@v5 | ||||||
with: | ||||||
python-version: '3.11' | ||||||
- uses: actions/cache@v4 | ||||||
with: | ||||||
path: | | ||||||
~/go/pkg/mod | ||||||
~/.cache/go-build | ||||||
key: tests-go-${{ runner.os }}-${{ hashFiles('**/go.sum') }} | ||||||
restore-keys: | | ||||||
tests-go-${{ runner.os }}- | ||||||
- name: Run tests | ||||||
shell: bash | ||||||
run: | | ||||||
make test |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One less thing to maintain.