Skip to content

Commit

Permalink
chore: add component tests as part of the coverage (#468)
Browse files Browse the repository at this point in the history
  • Loading branch information
thisthat committed Nov 28, 2022
1 parent 21b4d5d commit d521669
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
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

0 comments on commit d521669

Please sign in to comment.