Skip to content

Commit

Permalink
Merge pull request #3 from wallarm/feature/unit
Browse files Browse the repository at this point in the history
fix: unit test
  • Loading branch information
denisqsound authored Mar 11, 2024
2 parents 1317f69 + 4803e1f commit 068a275
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
-include .env
.EXPORT_ALL_VARIABLES:

.PHONY: all test lint vet fmt travis coverage checkfmt prepare deps build
.PHONY: all test lint fmt coverage checkfmt prepare deps build

NO_COLOR=\033[0m
OK_COLOR=\033[32;01m
ERROR_COLOR=\033[31;01m
WARN_COLOR=\033[33;01m


all: test vet checkfmt

travis: test checkfmt coverage
all: test checkfmt

prepare: fmt test

test:
@echo "$(OK_COLOR)Test packages$(NO_COLOR)"
@go test -v ./...
@go test -race -v ./...

coverage:
@echo "$(OK_COLOR)Make coverage report$(NO_COLOR)"
@./script/coverage.sh
-goveralls -coverprofile=gover.coverprofile -service=travis-ci

#failed to decode ammo with err: unexpected EOF, at position: 1047; data: "GET /?sleep=50 HTTP/1.0\nHost: wallarm."

checkfmt:
@echo "$(OK_COLOR)Check formats$(NO_COLOR)"
Expand All @@ -48,7 +47,7 @@ deps:
#==================== DOCKER ====================

IMAGE_NAME ?= denisqsound/specter
PLATFORMS := linux/arm64 linux/amd64# darwin/amd64 darwin/arm64
PLATFORMS := linux/arm64 linux/amd64#darwin/amd64 darwin/arm64
IMAGE_FILE := pipeline#specter#

define BUILD_template
Expand Down
2 changes: 1 addition & 1 deletion cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const defaultConfigFile = "load"
const stdinConfigSelector = "-"
const mainBucket = "wallarm-perf-pandora"

var configSearchDirs = []string{"./", "./config", "/etc/specter", "./../suite/mirroring"}
var configSearchDirs = []string{"./", "./config", "/etc/specter", "./../suite/mirroring", "./bin"}

type cliConfig struct {
Engine engine.Config `config:",squash"`
Expand Down
2 changes: 1 addition & 1 deletion components/providers/http/decoders/raw_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/wallarm/specter/components/providers/http/config"
)

const rawDecoderInput = `38 good50
const rawDecoderInput = `44 good50
GET /?sleep=50 HTTP/1.0
Host: wallarm.com
Expand Down
5 changes: 0 additions & 5 deletions script/coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ set -o pipefail
main() {
_cd_into_top_level
_generate_coverage_files
_combine_coverage_reports
}

_cd_into_top_level() {
Expand All @@ -22,8 +21,4 @@ _generate_coverage_files() {
}


_combine_coverage_reports() {
gover
}

main "$@"

0 comments on commit 068a275

Please sign in to comment.