2020-01-31 19:10:09 +00:00
|
|
|
ifeq ($(OS), Windows_NT)
|
|
|
|
VERSION := $(shell git describe --exact-match --tags 2>nil)
|
2020-02-12 00:42:44 +00:00
|
|
|
GOBINDATA := $(shell go-bindata.exe --version 2>nil)
|
2020-01-31 19:10:09 +00:00
|
|
|
else
|
|
|
|
VERSION := $(shell git describe --exact-match --tags 2>/dev/null)
|
2020-02-12 00:42:44 +00:00
|
|
|
GOBINDATA := $(shell which go-bindata 2> /dev/null)
|
2020-01-31 19:10:09 +00:00
|
|
|
endif
|
2020-02-12 00:42:44 +00:00
|
|
|
|
2016-11-02 20:29:16 +00:00
|
|
|
COMMIT ?= $(shell git rev-parse --short=8 HEAD)
|
2017-02-09 00:17:10 +00:00
|
|
|
YARN := $(shell command -v yarn 2> /dev/null)
|
2016-09-15 21:01:51 +00:00
|
|
|
|
2017-05-16 21:58:25 +00:00
|
|
|
SOURCES := $(shell find . -name '*.go' ! -name '*_gen.go' -not -path "./vendor/*" )
|
Cypress tests and e2e github action flow (#5896)
* test: welcome test, dashboard test, explore browser test
* test: snapshot testing
* feat: adding testing snapshots
* chore: update unmet peer dependency
* fix: name of dropdown toggle
* test: connecting to influxdb
* fix: remove unnecessary influxdb-onboarding.sh script.
* chore: updated go 1.17.1 for cypress tests
* refactor: remove unnecessary influxdb-onboarding command from Makefile
* refactor: remove unnecessary influxdb-onboarding command from circleci config
* test: initialising database by using environment properties (in Makefile)
* chore: fixing cypress tests
* test: deleting connection to influxd1
* tests: optimize build, reuse workspace
* tests: optimize build
* test: remove unused code
* fix: remove unuse dashboard
* chore(e2e-pipeline): add pipeline for chrono cypress tests
* chore: run action on push
* chore: fix e2e pipeline
* chore: add yarn install
* chore: add log upload
* chore: show logs to see what is going on with chronograf
* chore: fix log cats
* chore: add sleep
* fix: chronograf run command
* chore(ui): regenerate yarn.lock after rebase
* test: welcome test, dashboard test, explore browser test
* test: snapshot testing
* feat: adding testing snapshots
* chore(e2e): local script for influxdb enterprise deployment
* chore(e2e): update cert-manager in actions pipeline
* chore: fix coredns issue
* chore: fix certmanager deployment
* test: welcome test, dashboard test, explore browser test
* test: snapshot testing
* feat: adding testing snapshots
* chore: update unmet peer dependency
* test(cypress): add cypress env, and commands
* test(cypress): add basic InfluxDB setup connection test
* fix: temporary commented out the file as it uses non existing functions
* test(cypress): add dashboard create, rename and delelete test
* test(cypress): add routes
* chore: regenerate yarn.lock
* chore: remove unused file
* chore: comment out code
* chore: comment out code
* fix: remove calling non-existent function
* fix: createConnection uses unsafe SSL
* turns on flux
* test(cypress): rewritten Query Builder tests using _internal.monitor
* chore: yarn prettier
* fix: add missing custom window period
* fix: remove it.only
* Add flux-enable to a workflow file
* fix: github actions workflow file flux-enabled
* fix: force restart by deleing pod
* fix: restart a container to apply a new configmap
* fix: restart container
* chore: flux-enabled is now true by default
* fix: selecting correct elements
* chore: update e2e pipeline
* chore: add scheduled action run once a working day
* chore: remove commented code
* chore: change file extenction to .ts and adjust code accordingly
* chore: pipeline fixes
* chore: clean up e2e:influxdb2 references
* fix: yarn installation, no risky changes in make clean
* chore: update changelog
Co-authored-by: Iszy-Ami <huyiktran@gmail.com>
Co-authored-by: Iszy-Ami <56554624+Iszy-Ami@users.noreply.github.com>
Co-authored-by: Robert Hajek <robert.hajek@gmail.com>
Co-authored-by: Pavel Zavora <pavel.zavora@bonitoo.io>
Co-authored-by: k3yi0 <definitelynotkeyio@gmail.com>
Co-authored-by: k3yi0 <97002262+k3yi0@users.noreply.github.com>
2022-03-25 08:27:29 +00:00
|
|
|
UISOURCES := $(shell find ui -type f -not \( -path ui/build/\* -o -path ui/node_modules/\* -o -path ui/cypress/\* -prune \) )
|
2016-09-15 21:01:51 +00:00
|
|
|
|
2017-11-30 23:38:06 +00:00
|
|
|
unexport LDFLAGS
|
2020-01-31 19:10:09 +00:00
|
|
|
ifdef VERSION
|
2020-02-21 16:08:41 +00:00
|
|
|
TMP_BUILD_VERSION = -X main.version=$(VERSION)
|
2020-01-31 19:10:09 +00:00
|
|
|
endif
|
2020-02-21 16:08:41 +00:00
|
|
|
LDFLAGS=-ldflags "-s -X main.commit=${COMMIT} ${TMP_BUILD_VERSION}"
|
|
|
|
unexport TMP_BUILD_VERSION
|
2020-01-31 19:10:09 +00:00
|
|
|
|
2016-10-20 14:38:23 +00:00
|
|
|
BINARY=chronograf
|
2018-02-09 15:30:02 +00:00
|
|
|
CTLBINARY=chronoctl
|
2019-04-11 21:56:28 +00:00
|
|
|
GO111MODULE=on
|
2016-09-15 21:01:51 +00:00
|
|
|
|
2017-02-09 00:17:10 +00:00
|
|
|
.DEFAULT_GOAL := all
|
|
|
|
|
2020-02-12 00:42:44 +00:00
|
|
|
.PHONY: assets dep clean test gotest gotestrace jstest run run-dev ctags
|
|
|
|
|
2017-02-09 00:17:10 +00:00
|
|
|
all: dep build
|
2016-09-15 21:01:51 +00:00
|
|
|
|
2016-09-19 16:36:48 +00:00
|
|
|
build: assets ${BINARY}
|
|
|
|
|
2017-02-19 18:17:37 +00:00
|
|
|
${BINARY}: $(SOURCES) .bindata .jsdep .godep
|
2019-04-11 21:56:28 +00:00
|
|
|
GO111MODULE=on go build -o ${BINARY} ${LDFLAGS} ./cmd/chronograf/main.go
|
|
|
|
GO111MODULE=on go build -o ${CTLBINARY} ${LDFLAGS} ./cmd/chronoctl
|
2016-09-15 21:01:51 +00:00
|
|
|
|
2017-04-06 18:40:57 +00:00
|
|
|
define CHRONOGIRAFFE
|
2017-11-27 15:13:02 +00:00
|
|
|
._ o o
|
|
|
|
\_`-)|_
|
|
|
|
,"" _\_
|
|
|
|
," ## | 0 0.
|
|
|
|
," ## ,-\__ `.
|
|
|
|
," / `--._;) - "HAI, I'm Chronogiraffe. Let's be friends!"
|
|
|
|
," ## /
|
|
|
|
," ## /
|
2017-04-06 18:40:57 +00:00
|
|
|
endef
|
|
|
|
export CHRONOGIRAFFE
|
|
|
|
chronogiraffe: ${BINARY}
|
|
|
|
@echo "$$CHRONOGIRAFFE"
|
|
|
|
|
2016-09-15 21:01:51 +00:00
|
|
|
docker-${BINARY}: $(SOURCES)
|
2019-04-11 21:56:28 +00:00
|
|
|
CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -installsuffix cgo -o ${BINARY} ${LDFLAGS} \
|
2016-11-02 20:29:16 +00:00
|
|
|
./cmd/chronograf/main.go
|
2016-09-19 16:36:48 +00:00
|
|
|
|
|
|
|
docker: dep assets docker-${BINARY}
|
2016-10-20 14:38:23 +00:00
|
|
|
docker build -t chronograf .
|
2016-09-15 21:01:51 +00:00
|
|
|
|
2017-02-09 00:17:10 +00:00
|
|
|
assets: .jssrc .bindata
|
|
|
|
|
2018-11-09 01:27:27 +00:00
|
|
|
.bindata: server/swagger_gen.go canned/bin_gen.go protoboards/bin_gen.go dist/dist_gen.go
|
2017-02-09 00:17:10 +00:00
|
|
|
@touch .bindata
|
2016-09-16 22:50:49 +00:00
|
|
|
|
2017-02-09 00:17:10 +00:00
|
|
|
dist/dist_gen.go: $(UISOURCES)
|
2016-10-25 15:20:06 +00:00
|
|
|
go generate -x ./dist
|
2017-02-09 00:17:10 +00:00
|
|
|
|
|
|
|
server/swagger_gen.go: server/swagger.json
|
2016-10-25 15:20:06 +00:00
|
|
|
go generate -x ./server
|
2016-09-16 17:05:09 +00:00
|
|
|
|
2017-02-09 00:17:10 +00:00
|
|
|
canned/bin_gen.go: canned/*.json
|
|
|
|
go generate -x ./canned
|
2019-11-21 22:58:22 +00:00
|
|
|
|
2018-11-09 01:27:27 +00:00
|
|
|
protoboards/bin_gen.go: protoboards/*.json
|
|
|
|
go generate -x ./protoboards
|
2017-02-09 00:17:10 +00:00
|
|
|
|
|
|
|
.jssrc: $(UISOURCES)
|
2018-08-01 16:30:45 +00:00
|
|
|
cd ui && yarn run clean && yarn run build
|
2017-02-09 00:17:10 +00:00
|
|
|
@touch .jssrc
|
2016-09-16 20:11:00 +00:00
|
|
|
|
2017-02-09 00:17:10 +00:00
|
|
|
dep: .jsdep .godep
|
2016-09-16 20:11:00 +00:00
|
|
|
|
2017-05-13 19:42:55 +00:00
|
|
|
.godep:
|
2017-02-09 00:17:10 +00:00
|
|
|
ifndef GOBINDATA
|
|
|
|
@echo "Installing go-bindata"
|
2021-09-24 15:24:03 +00:00
|
|
|
go install github.com/kevinburke/go-bindata/...@v3.22.0+incompatible
|
2019-04-11 21:56:28 +00:00
|
|
|
GO111MODULE=on go get
|
2017-02-09 00:17:10 +00:00
|
|
|
endif
|
|
|
|
@touch .godep
|
2016-09-16 17:05:09 +00:00
|
|
|
|
2021-03-09 06:30:07 +00:00
|
|
|
.jsdep: ./yarn.lock
|
2017-02-09 00:17:10 +00:00
|
|
|
ifndef YARN
|
2019-11-21 22:58:22 +00:00
|
|
|
$(error Please install yarn 1.19.1+)
|
2017-02-09 00:17:10 +00:00
|
|
|
else
|
|
|
|
cd ui && yarn --no-progress --no-emoji
|
|
|
|
@touch .jsdep
|
|
|
|
endif
|
2016-09-15 21:01:51 +00:00
|
|
|
|
2017-05-13 19:42:55 +00:00
|
|
|
gen: internal.pb.go
|
|
|
|
|
2020-02-15 01:08:37 +00:00
|
|
|
internal.pb.go: kv/internal/internal.proto
|
|
|
|
GO111MODULE=on go generate -x ./kv/internal
|
2016-09-28 19:32:58 +00:00
|
|
|
|
2018-07-24 00:08:20 +00:00
|
|
|
test: jstest gotest gotestrace lint-ci
|
2016-09-15 21:01:51 +00:00
|
|
|
|
2016-09-16 20:11:00 +00:00
|
|
|
gotest:
|
2019-04-11 21:56:28 +00:00
|
|
|
GO111MODULE=on go test -timeout 10s ./...
|
2016-10-03 17:41:50 +00:00
|
|
|
|
|
|
|
gotestrace:
|
2019-04-11 21:56:28 +00:00
|
|
|
GO111MODULE=on go test -race ./...
|
2016-09-15 21:01:51 +00:00
|
|
|
|
2016-09-16 20:11:00 +00:00
|
|
|
jstest:
|
2018-03-14 17:00:37 +00:00
|
|
|
cd ui && yarn test --runInBand
|
2016-09-16 20:11:00 +00:00
|
|
|
|
2018-07-24 00:08:20 +00:00
|
|
|
lint:
|
|
|
|
cd ui && yarn run lint
|
|
|
|
|
|
|
|
lint-ci:
|
2021-03-09 06:47:10 +00:00
|
|
|
cd ui && yarn run eslint && yarn run tsc # fail fast for ci process
|
2018-03-23 18:08:06 +00:00
|
|
|
|
2016-09-19 16:36:48 +00:00
|
|
|
run: ${BINARY}
|
2016-11-07 17:10:47 +00:00
|
|
|
./chronograf
|
2016-09-16 20:47:38 +00:00
|
|
|
|
2017-04-06 18:40:57 +00:00
|
|
|
run-dev: chronogiraffe
|
2018-08-01 18:16:07 +00:00
|
|
|
mkdir -p ui/build
|
2017-02-19 06:54:52 +00:00
|
|
|
./chronograf -d --log-level=debug
|
2016-09-20 18:44:22 +00:00
|
|
|
|
Cypress tests and e2e github action flow (#5896)
* test: welcome test, dashboard test, explore browser test
* test: snapshot testing
* feat: adding testing snapshots
* chore: update unmet peer dependency
* fix: name of dropdown toggle
* test: connecting to influxdb
* fix: remove unnecessary influxdb-onboarding.sh script.
* chore: updated go 1.17.1 for cypress tests
* refactor: remove unnecessary influxdb-onboarding command from Makefile
* refactor: remove unnecessary influxdb-onboarding command from circleci config
* test: initialising database by using environment properties (in Makefile)
* chore: fixing cypress tests
* test: deleting connection to influxd1
* tests: optimize build, reuse workspace
* tests: optimize build
* test: remove unused code
* fix: remove unuse dashboard
* chore(e2e-pipeline): add pipeline for chrono cypress tests
* chore: run action on push
* chore: fix e2e pipeline
* chore: add yarn install
* chore: add log upload
* chore: show logs to see what is going on with chronograf
* chore: fix log cats
* chore: add sleep
* fix: chronograf run command
* chore(ui): regenerate yarn.lock after rebase
* test: welcome test, dashboard test, explore browser test
* test: snapshot testing
* feat: adding testing snapshots
* chore(e2e): local script for influxdb enterprise deployment
* chore(e2e): update cert-manager in actions pipeline
* chore: fix coredns issue
* chore: fix certmanager deployment
* test: welcome test, dashboard test, explore browser test
* test: snapshot testing
* feat: adding testing snapshots
* chore: update unmet peer dependency
* test(cypress): add cypress env, and commands
* test(cypress): add basic InfluxDB setup connection test
* fix: temporary commented out the file as it uses non existing functions
* test(cypress): add dashboard create, rename and delelete test
* test(cypress): add routes
* chore: regenerate yarn.lock
* chore: remove unused file
* chore: comment out code
* chore: comment out code
* fix: remove calling non-existent function
* fix: createConnection uses unsafe SSL
* turns on flux
* test(cypress): rewritten Query Builder tests using _internal.monitor
* chore: yarn prettier
* fix: add missing custom window period
* fix: remove it.only
* Add flux-enable to a workflow file
* fix: github actions workflow file flux-enabled
* fix: force restart by deleing pod
* fix: restart a container to apply a new configmap
* fix: restart container
* chore: flux-enabled is now true by default
* fix: selecting correct elements
* chore: update e2e pipeline
* chore: add scheduled action run once a working day
* chore: remove commented code
* chore: change file extenction to .ts and adjust code accordingly
* chore: pipeline fixes
* chore: clean up e2e:influxdb2 references
* fix: yarn installation, no risky changes in make clean
* chore: update changelog
Co-authored-by: Iszy-Ami <huyiktran@gmail.com>
Co-authored-by: Iszy-Ami <56554624+Iszy-Ami@users.noreply.github.com>
Co-authored-by: Robert Hajek <robert.hajek@gmail.com>
Co-authored-by: Pavel Zavora <pavel.zavora@bonitoo.io>
Co-authored-by: k3yi0 <definitelynotkeyio@gmail.com>
Co-authored-by: k3yi0 <97002262+k3yi0@users.noreply.github.com>
2022-03-25 08:27:29 +00:00
|
|
|
e2e-prepare:
|
|
|
|
./ui/cypress/local-chronograf-influxdb-enterprise.sh
|
|
|
|
|
|
|
|
e2e:
|
|
|
|
cd ui && yarn test:e2e
|
|
|
|
|
2016-09-19 16:36:48 +00:00
|
|
|
clean:
|
|
|
|
if [ -f ${BINARY} ] ; then rm ${BINARY} ; fi
|
2017-08-07 19:28:23 +00:00
|
|
|
cd ui && yarn run clean
|
2016-11-08 21:42:56 +00:00
|
|
|
cd ui && rm -rf node_modules
|
2018-11-09 01:27:27 +00:00
|
|
|
rm -f dist/dist_gen.go canned/bin_gen.go protoboards/bin_gen.go server/swagger_gen.go
|
2018-08-01 16:45:13 +00:00
|
|
|
@rm -f .godep .jsdep .jssrc .bindata
|
2017-02-19 18:17:37 +00:00
|
|
|
|
2017-02-14 19:22:35 +00:00
|
|
|
ctags:
|
|
|
|
ctags -R --languages="Go" --exclude=.git --exclude=ui .
|