Skip to content

Commit

Permalink
fix: Added CodeCov Support to GitHub Workflow (#449)
Browse files Browse the repository at this point in the history
* fix: Added CodeCov Support to GitHub Workflow
  • Loading branch information
willguibr authored May 1, 2024
1 parent 1dd0231 commit 8d75ef3
Show file tree
Hide file tree
Showing 13 changed files with 100 additions and 29 deletions.
45 changes: 34 additions & 11 deletions .github/workflows/zpa-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
timeout_minutes: 30 # Adjust as needed
command: |
make sweep
go test -v -cover ./zpa -v -parallel 20 -timeout 60m
make test:integration:zpa
make sweep
env:
ZPA_CLIENT_ID: ${{ secrets.ZPA_CLIENT_ID }}
Expand All @@ -88,6 +88,13 @@ jobs:
TF_ACC: ${{ secrets.TF_ACC }}
ZPA_ACC_TEST_FORCE_SWEEPERS: ${{ secrets.ZPA_ACC_TEST_FORCE_SWEEPERS }}

- name: Publish test coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.out
fail_ci_if_error: true

zpa-qa2-tenants:
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -151,7 +158,7 @@ jobs:
timeout_minutes: 30 # Adjust as needed
command: |
make sweep
go test -v -cover ./zpa -v -parallel 20 -timeout 60m
make test:integration:zpa
make sweep
env:
ZPA_CLIENT_ID: ${{ secrets.ZPA_CLIENT_ID }}
Expand All @@ -161,7 +168,15 @@ jobs:
TF_ACC: ${{ secrets.TF_ACC }}
ZPA_ACC_TEST_FORCE_SWEEPERS: ${{ secrets.ZPA_ACC_TEST_FORCE_SWEEPERS }}

- name: Publish test coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.out
fail_ci_if_error: true

zpa-beta-tenants:
needs: [zpa-qa1-tenants, zpa-qa2-tenants]
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -223,7 +238,7 @@ jobs:
timeout_minutes: 30 # Adjust as needed
command: |
make sweep
go test -v -cover ./zpa -v -parallel 20 -timeout 60m
make test:integration:zpa
make sweep
env:
ZPA_CLIENT_ID: ${{ secrets.ZPA_CLIENT_ID }}
Expand All @@ -232,11 +247,16 @@ jobs:
ZPA_CLOUD: ${{ secrets.ZPA_CLOUD }}
TF_ACC: ${{ secrets.TF_ACC }}
ZPA_ACC_TEST_FORCE_SWEEPERS: ${{ secrets.ZPA_ACC_TEST_FORCE_SWEEPERS }}
needs:
- zpa-qa1-tenants
- zpa-qa2-tenants

- name: Publish test coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.out
fail_ci_if_error: true

zpa-prod-tenants:
needs: [zpa-qa1-tenants, zpa-qa2-tenants, zpa-beta-tenants]
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -298,7 +318,7 @@ jobs:
timeout_minutes: 30 # Adjust as needed
command: |
make sweep
go test -v -cover ./zpa -v -parallel 20 -timeout 60m
make test:integration:zpa
make sweep
env:
ZPA_CLIENT_ID: ${{ secrets.ZPA_CLIENT_ID }}
Expand All @@ -307,7 +327,10 @@ jobs:
ZPA_CLOUD: ${{ secrets.ZPA_CLOUD }}
TF_ACC: ${{ secrets.TF_ACC }}
ZPA_ACC_TEST_FORCE_SWEEPERS: ${{ secrets.ZPA_ACC_TEST_FORCE_SWEEPERS }}
needs:
- zpa-qa1-tenants
- zpa-qa2-tenants
- zpa-beta-tenants

- name: Publish test coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.out
fail_ci_if_error: true
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ dist/*
local_test/
local_test/*
acceptance_test.yml
.VSCodeCounter
.VSCodeCounter
coverage.out
coverage.html
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## 3.2.2 (May, xx 2024)

### Notes

- Release date: **(May, xx 2024)**
- Supported Terraform version: **v1.x**

### Internal Changes

- [PR #449](https://github.com/zscaler/terraform-provider-zpa/pull/449) - Added `CodeCov` Support to GitHub Workflow

## 3.2.1 (April, 8 2024)

### Notes
Expand Down
10 changes: 6 additions & 4 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ test:
testacc:
TF_ACC=1 go test $(TEST) $(TESTARGS) $(TEST_FILTER) -timeout 120m

test\:integration\:zpa:
@echo "$(COLOR_ZSCALER)Running zpa integration tests...$(COLOR_NONE)"
go test -v -race -cover -coverprofile=coverage.out -covermode=atomic ./zpa -parallel 20 -timeout 60m
go tool cover -html=coverage.out -o coverage.html


build13: GOOS=$(shell go env GOOS)
build13: GOARCH=$(shell go env GOARCH)
ifeq ($(OS),Windows_NT) # is Windows_NT on XP, 2000, 7, Vista, 10...
Expand All @@ -57,10 +63,6 @@ build13: fmtcheck
@mkdir -p $(DESTINATION)
go build -o $(DESTINATION)/terraform-provider-zpa_v3.2.1

coverage: test
@echo "✓ Opening coverage for unit tests ..."
@go tool cover -html=coverage.txt

vet:
@echo "==> Checking source code against go vet and staticcheck"
@go vet ./...
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
[![Test](https://github.com/zscaler/terraform-provider-zpa/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/zscaler/terraform-provider-zpa/actions/workflows/test.yml)
[![Release](https://github.com/zscaler/terraform-provider-zpa/actions/workflows/release.yml/badge.svg?branch=master)](https://github.com/zscaler/terraform-provider-zpa/actions/workflows/release.yml)
[![Release](https://github.com/zscaler/terraform-provider-zpa/actions/workflows/release.yml/badge.svg)](https://github.com/zscaler/terraform-provider-zpa/actions/workflows/release.yml)
[![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/zscaler/terraform-provider-zpa)](https://github.com/zscaler/terraform-provider-zpa/v2/blob/master/.go-version)
[![Go Report Card](https://goreportcard.com/badge/github.com/zscaler/terraform-provider-zpa)](https://goreportcard.com/report/github.com/zscaler/terraform-provider-zpa)
[![codecov](https://codecov.io/gh/zscaler/terraform-provider-zpa/graph/badge.svg?token=7YX2V2LV8H)](https://codecov.io/gh/zscaler/terraform-provider-zpa)
[![License](https://img.shields.io/github/license/zscaler/terraform-provider-zpa?color=blue)](https://github.com/zscaler/terraform-provider-zpa/v2/blob/master/LICENSE)
[![Zscaler Community](https://img.shields.io/badge/zscaler-community-blue)](https://community.zscaler.com/)
[![Slack](https://img.shields.io/badge/Join%20Our%20Community-Slack-blue)](https://forms.gle/3iMJvVmJDvmUy36q9)

Expand Down
17 changes: 17 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ignore:
- "vendor/**/*"
- "dist/**/*"

coverage:
status:
project: yes
patch: yes
changes: yes
comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: false # if true: only post the comment if coverage changes
require_base: yes # [yes :: must have a base report to post]
require_head: yes # [yes :: must have a head report to post]
branches:
- master
13 changes: 12 additions & 1 deletion docs/guides/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,21 @@ Track all ZPA Terraform provider's releases. New resources, features, and bug fi

---

``Last updated: v3.2.1``
``Last updated: v3.2.2``

---

## 3.2.2 (May, xx 2024)

### Notes

- Release date: **(May, xx 2024)**
- Supported Terraform version: **v1.x**

### Internal Changes

- [PR #449](https://github.com/zscaler/terraform-provider-zpa/pull/449) - Added `CodeCov` Support to GitHub Workflow

## 3.2.1 (April, 8 2024)

### Notes
Expand Down
4 changes: 2 additions & 2 deletions zpa/common/testing/variable/variable.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const (
ServiceEdgeDescription = "testAcc_service_edge_group"
ServiceEdgeEnabled = true
ServiceEdgeIsPublic = true
ServiceEdgeLatitude = "37.3382082"
ServiceEdgeLongitude = "-121.8863286"
ServiceEdgeLatitude = "37.33874"
ServiceEdgeLongitude = "-121.8852525"
ServiceEdgeLocation = "San Jose, CA, USA"
ServiceEdgeVersionProfileName = "Default"
)
Expand Down
2 changes: 1 addition & 1 deletion zpa/common/version.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package common

var version = "3.2.0"
var version = "3.2.2"

// Version returns version of provider
func Version() string {
Expand Down
4 changes: 2 additions & 2 deletions zpa/resource_zpa_app_connector_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ resource "%s" "%s" {
enabled = "%s"
country_code = "US"
city_country = "San Jose, US"
latitude = "37.3382082"
longitude = "-121.8863286"
latitude = "37.33874"
longitude = "-121.8852525"
location = "San Jose, CA, USA"
upgrade_day = "SUNDAY"
upgrade_time_in_secs = "66600"
Expand Down
2 changes: 1 addition & 1 deletion zpa/resource_zpa_lss_config_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ resource "%s" "%s" {
operator = "OR"
operands {
object_type = "CLIENT_TYPE"
values = ["zpn_client_type_exporter", "zpn_client_type_ip_anchoring", "zpn_client_type_zapp", "zpn_client_type_edge_connector", "zpn_client_type_machine_tunnel", "zpn_client_type_browser_isolation", "zpn_client_type_slogger", "zpn_client_type_branch_connector"]
values = ["zpn_client_type_exporter", "zpn_client_type_machine_tunnel", "zpn_client_type_ip_anchoring", "zpn_client_type_edge_connector", "zpn_client_type_zapp", "zpn_client_type_slogger", "zpn_client_type_slogger", "zpn_client_type_zapp_partner", "zpn_client_type_branch_connector"]
}
}
conditions {
Expand Down
8 changes: 5 additions & 3 deletions zpa/resource_zpa_service_edge_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,12 @@ resource "%s" "%s" {
is_public = "%s"
upgrade_day = "SUNDAY"
upgrade_time_in_secs = "66600"
latitude = "37.3382082"
longitude = "-121.8863286"
country_code = "US"
city_country = "San Jose, US"
latitude = "37.33874"
longitude = "-121.8852525"
location = "San Jose, CA, USA"
version_profile_name = "Default"
version_profile_id = 0
}
data "%s" "%s" {
Expand Down
2 changes: 1 addition & 1 deletion zpa/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package zpa

// ProviderVersion is set at build-time in the release process
var ProviderVersion = "3.2.0"
var ProviderVersion = "3.2.2"

0 comments on commit 8d75ef3

Please sign in to comment.