Skip to content

Commit

Permalink
Merge pull request #159 from Venafi/terraform-make-test-update
Browse files Browse the repository at this point in the history
feat: Enhances Makefile and code to handle different plataform test executions, fixes issues and more
  • Loading branch information
luispresuelVenafi authored Jan 22, 2025
2 parents 8693056 + 9e8bc4e commit 7282f61
Show file tree
Hide file tree
Showing 11 changed files with 2,053 additions and 1,994 deletions.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,18 @@ dev: clean fmtcheck

test: fmtcheck linter test_go testacc test_e2e

test_internal: fmtcheck linter test_go test_e2e_dev test_e2e_dev_ecdsa

test_tpp: test_tpp_tf_acc test_e2e_tpp test_e2e_tpp_token

test_vaas: test_vaas_tf_acc test_e2e_vaas

test_tpp_tf_acc:
TF_ACC=1 go test -tags=tpp -run ^TestTPP $(TEST) -v $(TESTARGS) -timeout 120m

test_vaas_tf_acc:
TF_ACC=1 go test -tags=vaas -run ^TestVAAS $(TEST) -v $(TESTARGS) -timeout 120m

test_go:
go test -v -coverprofile=cov1.out ./venafi
go tool cover -func=cov1.out
Expand Down
2 changes: 2 additions & 0 deletions venafi/resource_venafi_certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,8 @@ func checkForRenew(cert x509.Certificate, expirationWindow int) (renewRequired b
renewWindow := time.Duration(expirationWindow) * time.Hour
certDuration := getCertDuration(&cert)
validExpirationWindow(certDuration, renewWindow)
// time now + 90 will be after (date) cert After?
// if yes, renew is required
renewRequired = time.Now().Add(renewWindow).After(cert.NotAfter)
return renewRequired
}
Expand Down
Loading

0 comments on commit 7282f61

Please sign in to comment.