Add new-alert make target to create alert and unit test template

This commit is contained in:
Brandon Myers 2018-10-31 14:21:29 -05:00
Родитель e65790cdab
Коммит 685a911b39
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 8AA79AD83045BBC7
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -38,7 +38,7 @@ restart-cloudy-mozdef:
test: build-tests run-tests test: build-tests run-tests
tests: build-tests run-tests ## Run all tests (getting/building images as needed) tests: build-tests run-tests ## Run all tests (getting/building images as needed)
run-test: run-test:
run-tests: ## Just run the tests (no build/get). Use `make TEST_CASE=test/...` for specific tests only run-tests: ## Just run the tests (no build/get). Use `make TEST_CASE=tests/...` for specific tests only
docker-compose -f docker/compose/docker-compose-tests.yml -p test-$(NAME) up -d docker-compose -f docker/compose/docker-compose-tests.yml -p test-$(NAME) up -d
docker run -it --rm mozdef/mozdef_tester bash -c "source /opt/mozdef/envs/python/bin/activate && flake8 --config .flake8 ./" docker run -it --rm mozdef/mozdef_tester bash -c "source /opt/mozdef/envs/python/bin/activate && flake8 --config .flake8 ./"
docker run -it --rm --network=test-mozdef_default mozdef/mozdef_tester bash -c "source /opt/mozdef/envs/python/bin/activate && py.test --delete_indexes --delete_queues $(TEST_CASE)" docker run -it --rm --network=test-mozdef_default mozdef/mozdef_tester bash -c "source /opt/mozdef/envs/python/bin/activate && py.test --delete_indexes --delete_queues $(TEST_CASE)"
@ -76,3 +76,8 @@ clean: ## Cleanup all docker volumes and shutdown all related services
# Shorthands # Shorthands
.PHONY: rebuild .PHONY: rebuild
rebuild: clean build rebuild: clean build
# Allow creation of alert and unit test skeleton
.PHONY: new-alert
new-alert: ## Create an example alert and working alert unit test
python tests/alert_templater.py