Skip to content
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

chore: add component tests as part of the coverage #468

Merged
merged 6 commits into from
Nov 28, 2022
Merged
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
10 changes: 6 additions & 4 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
cache: true
cache-dependency-path: '${{ matrix.config.folder }}go.sum'

- name: Test ${{ matrix.config.name }}
- name: Unit Test ${{ matrix.config.name }}
working-directory: ./${{ matrix.config.folder }}
run: make test

Expand All @@ -90,6 +90,7 @@ jobs:
with:
flags: ${{ matrix.config.name }}


build_image:
name: Build Docker Image
needs: prepare_ci_run
Expand All @@ -115,7 +116,7 @@ jobs:

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v2

- name: Build Docker Image
uses: docker/build-push-action@v3
Expand All @@ -136,7 +137,7 @@ jobs:
cache-from: type=gha, scope=${{ github.workflow }}
cache-to: type=gha, scope=${{ github.workflow }}
outputs: type=docker,dest=/tmp/${{ matrix.config.name }}-image.tar

- name: Upload image as artifact
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -167,6 +168,7 @@ jobs:
needs: prepare_ci_run
uses: ./.github/workflows/component-test.yml


integration_tests:
name: Integration Tests
needs: [ prepare_ci_run, build_image ]
Expand Down Expand Up @@ -211,7 +213,7 @@ jobs:

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v2

- name: Build Docker Image
uses: docker/build-push-action@v3
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/component-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ jobs:
- name: Execute Component Tests
working-directory: operator
run: make component-test

- name: Report code coverage
uses: codecov/codecov-action@v3
with:
flags: component-tests
4 changes: 4 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ flags:
paths:
- scheduler/
carryforward: true
component-tests:
paths:
- operator/
carryforward: true
2 changes: 1 addition & 1 deletion operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ test: manifests fmt vet generate envtest ## Run tests.

.PHONY: component-test
component-test: manifests generate envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./test/component/... -v -timeout 30m
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./test/component/... -v -timeout 30m -coverprofile cover.out -coverpkg "github.com/keptn/lifecycle-toolkit/operator/controllers/..."

.PHONY: performance-test
performance-test: manifests generate envtest ## Run tests.
Expand Down