-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
55 lines (46 loc) · 2.08 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!make
VERSION ?= $(shell git describe --tags --exact-match 2>/dev/null || git rev-parse --abbrev-ref HEAD)
DOCKER_BIN := docker
PYTHON_BIN := python
POETRY_BIN := poetry
IMAGE_NAME := keystone
IMAGE_TAG := latest
AZ_CLI_BIN := az
PORT := 5001
.PHONY: build-image
build-image:
$(DOCKER_BIN) build -t $(IMAGE_NAME):$(IMAGE_TAG) .
.PHONY: unit-tests
unit-tests: export CONFIG_PATH=./config/unit-tests.yaml
unit-tests:
$(POETRY_BIN) run pytest tests/unit -p no:warnings --cov-report=html --cov=keystone_scim --asyncio-mode=strict
.PHONY: integration-tests-mem-store
integration-tests-mem-store: export CONFIG_PATH=./config/integration-tests-memory-store.yaml
integration-tests-mem-store:
$(POETRY_BIN) run pytest tests/integration -p no:warnings --verbose --asyncio-mode=strict ; \
$(POETRY_BIN) run tests/integration/scripts/cleanup.py
.PHONY: integration-tests-cosmos-store
integration-tests-cosmos-store: export CONFIG_PATH=./config/integration-tests-cosmos-store.yaml
integration-tests-cosmos-store: export STORE_COSMOS_DB_NAME=scim_int_tsts_$(shell date +%s)
integration-tests-cosmos-store:
$(POETRY_BIN) run pytest tests/integration -p no:warnings --verbose --asyncio-mode=strict ; \
$(POETRY_BIN) run tests/integration/scripts/cleanup.py
.PHONY: integration-tests-mongo-store
integration-tests-mongo-store: export CONFIG_PATH=./config/integration-tests-mongo-store.yaml
integration-tests-mongo-store: export STORE_MONGO_DATABASE=scim_int_tsts_$(shell date +%s)
integration-tests-mongo-store:
$(POETRY_BIN) run pytest tests/integration -p no:warnings --verbose --asyncio-mode=strict ; \
$(POETRY_BIN) run tests/integration/scripts/cleanup.py
.PHONY: security-tests
security-tests:
$(POETRY_BIN) run bandit -r ./keystone_scim
.PHONY: docker-run-dev
docker-run-dev:
$(DOCKER_BIN) run \
--rm -it --name $(IMAGE_NAME)-dev -p $(PORT):$(PORT) \
--mount type=bind,source="$(shell pwd)"/config/dev.yaml,target=/tmp/config.yaml \
--env CONFIG_PATH=/tmp/config.yaml $(IMAGE_NAME):$(IMAGE_TAG)
.PHONY: build-on-mac
build-on-mac:
$(DOCKER_BIN) buildx build --platform linux/amd64 \
-t $(IMAGE_NAME):$(IMAGE_TAG) .