http urls monitor.

Makefile 937B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. SHELL := bash
  2. DB_HOST ?= 127.0.0.1
  3. DB_PORT ?= 3306
  4. DB_USERNAME ?= upperio_tests
  5. DB_PASSWORD ?= upperio_secret
  6. DB_NAME ?= upperio_tests
  7. TEST_FLAGS ?=
  8. export DB_HOST
  9. export DB_NAME
  10. export DB_PASSWORD
  11. export DB_PORT
  12. export DB_USERNAME
  13. build:
  14. go build && go install
  15. require-client:
  16. @if [ -z "$$(which mysql)" ]; then \
  17. echo 'Missing "mysql" command. Please install the MySQL client and try again.' && \
  18. exit 1; \
  19. fi
  20. generate:
  21. go generate && \
  22. go get -d -t -v ./...
  23. reset-db: require-client
  24. SQL="" && \
  25. SQL+="DROP DATABASE IF EXISTS $(DB_NAME);" && \
  26. SQL+="CREATE DATABASE $(DB_NAME);" && \
  27. SQL+="GRANT ALL PRIVILEGES ON $(DB_NAME).* TO $(DB_USERNAME) IDENTIFIED BY '$(DB_PASSWORD)';" && \
  28. mysql -uroot -h"$(DB_HOST)" -P$(DB_PORT) <<< $$SQL
  29. test: reset-db generate
  30. #go test -tags generated -v -race # race: limit on 8192 simultaneously alive goroutines is exceeded, dying
  31. go test -tags generated -v $(TEST_FLAGS)