chore: use ginkgo for test executions (#537) (#562)

* go test -> ginkgo

* added FlakeAttempts to flaky test definition

Co-authored-by: Dimitri Herzog <dimitri.herzog@gmail.com>
This commit is contained in:
Kwitsch 2022-07-08 08:04:08 +02:00 committed by GitHub
parent 988556dc80
commit 061419f68f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -32,10 +32,12 @@ build: ## Build binary
go build -v -ldflags="-w -s -X github.com/0xERR0R/blocky/util.Version=${VERSION} -X github.com/0xERR0R/blocky/util.BuildTime=${BUILD_TIME}" -o $(BIN_OUT_DIR)/$(BINARY_NAME)$(BINARY_SUFFIX)
test: ## run tests
go test -v -coverprofile=coverage.txt -covermode=atomic -cover ./...
go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo
$(shell go env GOPATH)/bin/ginkgo -v --coverprofile=coverage.txt --covermode=atomic -cover ./...
race: ## run tests with race detector
go test -race -short ./...
go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo
$(shell go env GOPATH)/bin/ginkgo --race ./...
lint: build ## run golangcli-lint checks
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.46.2

View File

@ -200,7 +200,7 @@ var _ = Describe("Downloader", func() {
WithAttempts(3),
WithCooldown(time.Millisecond))
})
It("Should perform a retry until max retry attempt count is reached and return DNSError", func() {
It("Should perform a retry until max retry attempt count is reached and return DNSError", FlakeAttempts(5), func() {
reader, err := sut.DownloadFile("http://some.domain.which.does.not.exist")
Expect(err).Should(HaveOccurred())
var dnsError *net.DNSError