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

Upload unit test coverage #879

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
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
8 changes: 8 additions & 0 deletions .github/workflows/run-acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,14 @@ jobs:
run: make provider
- name: Unit-test provider code
run: make test_provider
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
verbose: true
directory: provider
files: coverage.txt
functionalities: fixes
token: ${{ secrets.CODECOV_TOKEN }}
- if: github.event_name == 'pull_request'
name: Check Schema is Valid
run: |
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ install_plugins: .pulumi/bin/pulumi
lint_provider: provider
cd provider && golangci-lint run -c ../.golangci.yml

# `make provider_no_deps` builds the provider binary directly, without ensuring that
# `cmd/pulumi-resource-docker/schema.json` is valid and up to date.
# `make provider_no_deps` builds the provider binary directly, without ensuring that
# `cmd/pulumi-resource-docker/schema.json` is valid and up to date.
# To create a release ready binary, you should use `make provider`.
provider_no_deps:
(cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "-X $(PROJECT)/$(VERSION_PATH)=$(VERSION)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER))
Expand All @@ -118,7 +118,7 @@ test_provider:
@echo ""
@echo "== test_provider ==================================================================="
@echo ""
cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM)
cd provider && go test -v -short -race -cover -coverprofile="coverage.txt" -coverpkg ./... ./... -parallel $(TESTPARALLELISM)

tfgen: install_plugins upstream docs
(cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "-X $(PROJECT)/$(VERSION_PATH)=$(VERSION)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN))
Expand Down
15 changes: 15 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
comment:
layout: "header, files, footer"
hide_project_coverage: false

fixes:
- "provider/v4/::provider/"

coverage:
status:
project:
default:
informational: true
patch:
default:
informational: true
Loading