Skip to content

Commit 9de74e5

Browse files
committed
Merge remote-tracking branch 'origin/staging': Release v0.7.1
2 parents 98ab406 + 539a76a commit 9de74e5

File tree

6 files changed

+44
-22
lines changed

6 files changed

+44
-22
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ bin
33
**/*/.DS_Store
44
.DS_Store
55
**/*.swp
6-
cover*
76
site/
87
docs/go-client/pkg/*
98
docs/**/swag*
109
docs/**/docs.go
10+
.coverage

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [v0.7.1]
11+
### PVE API client
12+
#### Fixed
13+
- Removed unused imports.
14+
1015
## [v0.7.0]
1116
### PVE API wrapper
1217
#### Added
@@ -142,7 +147,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
142147
- Proxmox api token credentials support.
143148
- Proxmox api version endpoint.
144149

145-
[unreleased]: https://github.com/iolave/go-proxmox/compare/v0.7.0...staging
150+
[unreleased]: https://github.com/iolave/go-proxmox/compare/v0.7.1...staging
151+
[v0.7.1]: https://github.com/iolave/go-proxmox/releases/tag/v0.7.1
146152
[v0.7.0]: https://github.com/iolave/go-proxmox/releases/tag/v0.7.0
147153
[v0.6.1]: https://github.com/iolave/go-proxmox/releases/tag/v0.6.1
148154
[v0.6.0]: https://github.com/iolave/go-proxmox/releases/tag/v0.6.0

Makefile

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,30 @@
11
GOBIN ?= $$(go env GOPATH)/bin
22

3-
.PHONY: install-go-test-coverage install-docs-dependencies
4-
5-
install-go-test-coverage:
6-
go install github.com/vladopajic/go-test-coverage/v2@latest
7-
3+
.PHONY: install-docs-dependencies
84
install-docs-dependencies:
95
./scripts/install-docs-deps.sh
106

7+
.phony: install-dependencies
118
install-dependencies: install-docs-dependencies
129
go mod tidy
1310

11+
.PHONY: test
12+
test:
13+
go test -v ./...
1414

15-
.PHONY: coverage-check
16-
coverage-check: install-go-test-coverage
17-
go test -v ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./...
18-
${GOBIN}/go-test-coverage --config=./.testcoverage.yml
19-
20-
coverage-report:
21-
go tool cover -html=cover.out -o=cover.html
22-
15+
.PHONY: coverage
2316
coverage:
24-
$(MAKE) $(MAKEFLAGS) coverage-check; rc=$$? \
25-
; $(MAKE) $(MAKEFLAGS) coverage-report \
26-
; exit $$rc
17+
./scripts/coverage.sh
2718

19+
.PHONY: generate-docs
2820
generate-docs: install-docs-dependencies
2921
bash ./scripts/generate-docs.sh
3022

23+
.PHONY: preview-docs
3124
preview-docs: install-docs-dependencies generate-docs
3225
bash ./scripts/preview-docs.sh
3326

27+
.PHONY: build
3428
build: install-dependencies
3529
$(eval $@GOOS = linux)
3630
$(eval $@GOARCH = amd64)
@@ -55,6 +49,4 @@ build: install-dependencies
5549
$(eval $@GOOS = darwin)
5650
$(eval $@GOARCH = amd64)
5751
CGO_ENABLED=0 GOOS=$($@GOOS) GOARCH=$($@GOARCH) go build -ldflags="-extldflags=-static" -o "bin/pve-api-wrapper-$($@GOOS)-$($@GOARCH)" ./cmd/pve_api_wrapper/pve_api_wrapper.go
58-
test:
59-
go test -v ./...
6052

pkg/pve/pve_lxc.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"net/http"
66
"net/url"
77
"path"
8-
"slices"
98
"strconv"
109

1110
"github.com/iolave/go-proxmox/internal/api_def"

pkg/pve/pve_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func TestBuildHttpRequestUrl(t *testing.T) {
157157
}
158158

159159
for i := 0; i < len(testCases); i++ {
160-
result := api.httpClient.buildRequestUrl(testCases[i])
160+
result := api.client.buildRequestUrl(testCases[i])
161161

162162
if result != expected {
163163
t.Fatalf(`buildRequestUrl("%s"), expected "%s", got "%s"`, testCases[i], expected, result)

scripts/coverage.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
# checks/install uncover
4+
which uncover &> /dev/null
5+
if [ "$?" -ne "0" ]; then
6+
set -e
7+
go install github.com/gregoryv/uncover/cmd/uncover@v0.9.0
8+
set +e
9+
fi
10+
11+
# Test and create a .coverage file
12+
PKG_LIST=$(go list ./... | grep -v /vendor/ | xargs)
13+
go test -covermode=count -coverprofile .coverage $PKG_LIST
14+
if [ "$?" -ne "0" ]; then
15+
rm -rf .coverage
16+
exit 1
17+
fi
18+
19+
# Do the coverage
20+
uncover -min 85 .coverage
21+
if [ "$?" -ne "0" ]; then
22+
rm -rf .coverage
23+
exit 1
24+
fi
25+

0 commit comments

Comments
 (0)