mirror of
https://github.com/MontFerret/ferret.git
synced 2024-12-16 11:37:36 +02:00
2643321e0f
* Switched to Lab for e2e tests * Switched to binary * Updated lab installation * Updated use of Lab installer * updates * Changed lab installation path * Updated use of installer * Works * Added additional functions * Updated some tests * Updated go.sum * Works * Refactored assertions * Added tests for testing.True * Added tests for testing.None * Added tests for testing.Lte * Added tests for testing.Lt * Added generic consturctor * Added tests for testing.Len * Added tests for testing.Gte * Added tests for testing.Gt * Added tests for testing.False * Added tests for testing.Empty * Added tests for testing.Fail * Added tests for testing.Equal * Added tests for testing.Include * Updated urls in static page tests * Fixed namespace unit tests * Fixed unit test for testing.Len * Updated E2E scripts * Updaes * Updated Chrome in CI/CD * Added e2e for example test click.fql * Added suite cases for example scripts * Updated examples * Updated * Added type assertions * Updated Chrome opts and disabled headers and cookies related tests * Fixed iframes example * Increased timeouts in navigation examples * Updated value example * Updated comments * Disabled cookies examples * Fixed static url * Disabled headers examples * Disabled UA test * Simplified wait logic * Added base testing module * Fixes after codereview * Disabled failing tests
69 lines
1.6 KiB
Makefile
69 lines
1.6 KiB
Makefile
.PHONY: build install compile test e2e doc fmt lint vet release
|
|
|
|
export GOPATH
|
|
export GO111MODULE=on
|
|
|
|
VERSION ?= $(shell git describe --tags --always --dirty)
|
|
RELEASE_VERSION ?= $(version)
|
|
DIR_BIN = ./bin
|
|
DIR_PKG = ./pkg
|
|
DIR_CLI = ./cli
|
|
DIR_E2E = ./e2e
|
|
|
|
default: build
|
|
|
|
build: vet generate test compile
|
|
|
|
install:
|
|
go get
|
|
|
|
compile:
|
|
go build -v -o ${DIR_BIN}/ferret \
|
|
-ldflags "-X main.version=${VERSION}" \
|
|
./main.go
|
|
|
|
test:
|
|
go test -race ${DIR_PKG}/...
|
|
|
|
cover:
|
|
go test -race -coverprofile=coverage.txt -covermode=atomic ${DIR_PKG}/... && \
|
|
curl -s https://codecov.io/bash | bash
|
|
|
|
e2e:
|
|
lab --timeout=120 --concurrency=2 --wait=http://127.0.0.1:9222/json/version --runtime=bin://./bin/ferret --files=file://./e2e/tests --dir=./e2e/pages/dynamic:8080@dynamic --dir=./e2e/pages/static:8081@static
|
|
|
|
bench:
|
|
go test -run=XXX -bench=. ${DIR_PKG}/...
|
|
|
|
generate:
|
|
go generate ${DIR_PKG}/...
|
|
|
|
doc:
|
|
godoc -http=:6060 -index
|
|
|
|
# http://golang.org/cmd/go/#hdr-Run_gofmt_on_package_sources
|
|
fmt:
|
|
go fmt ${DIR_CLI}/... ${DIR_PKG}/...
|
|
|
|
# https://github.com/mgechev/revive
|
|
# go get github.com/mgechev/revive
|
|
lint:
|
|
revive -config revive.toml -formatter stylish -exclude ./pkg/parser/fql/... -exclude ./vendor/... ./...
|
|
|
|
# http://godoc.org/code.google.com/p/go.tools/cmd/vet
|
|
# go get code.google.com/p/go.tools/cmd/vet
|
|
vet:
|
|
go vet ${DIR_CLI}/... ${DIR_PKG}/...
|
|
|
|
release:
|
|
ifeq ($(RELEASE_VERSION), )
|
|
$(error "Release version is required (version=x)")
|
|
else ifeq ($(GITHUB_TOKEN), )
|
|
$(error "GitHub token is required (GITHUB_TOKEN)")
|
|
else
|
|
rm -rf ./dist && \
|
|
git tag -a v$(RELEASE_VERSION) -m "New $(RELEASE_VERSION) version" && \
|
|
git push origin v$(RELEASE_VERSION) && \
|
|
goreleaser
|
|
endif
|