Skip to content
Merged
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ go.work.sum

# Unit test files
stackit/internal/services/iaas/test-512k.img

# Test coverage reports
coverage.out
coverage.html
1 change: 1 addition & 0 deletions CONTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ These commands can be executed from the project root:
- `make lint`: lint the code and examples
- `make generate-docs`: generate terraform documentation
- `make test`: run unit tests
- `make coverage`: create unit test coverage report (output file: `stackit/coverage.html`)
- `make test-acceptance-tf`: run acceptance tests

### Repository structure
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ test:
@echo "Running tests for the terraform provider"
@cd $(ROOT_DIR)/stackit && go test ./... -count=1 && cd $(ROOT_DIR)

# Test coverage
coverage:
@echo ">> Creating test coverage report for the terraform provider"
@cd $(ROOT_DIR)/stackit && (go test ./... -count=1 -coverprofile=coverage.out || true) && cd $(ROOT_DIR)
@cd $(ROOT_DIR)/stackit && go tool cover -html=coverage.out -o coverage.html && cd $(ROOT_DIR)

test-acceptance-tf:
@if [ -z $(TF_ACC_PROJECT_ID) ]; then echo "Input TF_ACC_PROJECT_ID missing"; exit 1; fi
@if [ -z $(TF_ACC_ORGANIZATION_ID) ]; then echo "Input TF_ACC_ORGANIZATION_ID missing"; exit 1; fi
Expand Down