Skip to content

Commit 6664868

Browse files
committed
docs: Clarified the CONTRIBUTING guide.
1 parent ea42c5d commit 6664868

File tree

2 files changed

+33
-9
lines changed

2 files changed

+33
-9
lines changed

CONTRIBUTING.md

+24-6
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ The `nproc` binary is commonly available on most Linux distributions. If it's no
140140
141141
### Unit tests (and code coverage)
142142
143-
This will run Unit and Fuzz tests. This tests the low-level Go code, but not the Terraform integration wrapped around it.
143+
This will run Unit tests. This tests the low-level Go code, but not the Terraform integration wrapped around it.
144144
145145
```bash
146146
# Run all unit tests
@@ -150,15 +150,16 @@ make unit
150150
make unit NAME=TruncateLabel
151151
```
152152
153-
You can view the code coverage report with:
153+
You can view the code coverage report with either:
154154
155155
```bash
156-
make view-cov
156+
make view-cov-cli # on the CLI
157+
make view-cov-html # in the browser
157158
```
158159
159160
### Terraform provider acceptance tests (and code coverage)
160161
161-
This will run all tests: Unit, Acceptance, and Fuzz. Acceptance tests run the code through Terraform and test the Terraform communication pathway.
162+
This will run Acceptance tests. Acceptance tests run the code through Terraform and test the Terraform communication pathway.
162163
163164
```bash
164165
# Run all acceptance tests
@@ -168,10 +169,27 @@ make acc
168169
make acc NAME=TruncateLabel
169170
```
170171
171-
You can view the code coverage report with:
172+
You can view the code coverage report with either:
172173
173174
```bash
174-
make view-cov
175+
make view-cov-cli # on the CLI
176+
make view-cov-html # in the browser
177+
```
178+
179+
### Documentation Examples as tests (and code coverage)
180+
181+
This will run the Documentation Examples as tests. This ensures that the examples we put in front of users actually work.
182+
183+
```bash
184+
# Run all example tests
185+
make examples
186+
```
187+
188+
You can view the code coverage report with either:
189+
190+
```bash
191+
make view-cov-cli # on the CLI
192+
make view-cov-html # in the browser
175193
```
176194
177195
### Fuzzer

Makefile

+9-3
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ install-tools-go:
6262
$(GO) install github.com/bitfield/gotestdox/cmd/gotestdox@latest
6363
$(GO) install github.com/google/osv-scanner/cmd/osv-scanner@v1
6464
$(GO) install github.com/goph/licensei/cmd/licensei@latest
65+
$(GO) install github.com/orlangure/gocovsh@latest
6566
$(GO) install github.com/pelletier/go-toml/v2/cmd/tomljson@latest
6667
$(GO) install github.com/trufflesecurity/driftwood@latest
6768
$(GO) install golang.org/x/perf/cmd/benchstat@latest
@@ -305,9 +306,14 @@ quickbench:
305306
bench:
306307
$(GO) test -bench=. -count=6 -timeout 60m -benchmem -cpuprofile=__cpu.out -memprofile=__mem.out -trace=__trace.out ./corefunc | tee __bench-$(shell date --utc "+%Y%m%dT%H%M%SZ").out
307308

308-
.PHONY: view-cov
309-
## view-cov: [test] After running test or unittest, this will launch a browser to view the coverage report.
310-
view-cov:
309+
.PHONY: view-cov-cli
310+
## view-cov-cli: [test] After running test or unittest, this will view the coverage report on the CLI.
311+
view-cov-cli:
312+
gocovsh --profile=__coverage.out
313+
314+
.PHONY: view-cov-html
315+
## view-cov-html: [test] After running test or unittest, this will launch a browser to view the coverage report.
316+
view-cov-html:
311317
$(GO) tool cover -html=__coverage.out
312318

313319
.PHONY: view-cpupprof

0 commit comments

Comments
 (0)