-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
66 lines (54 loc) · 1.88 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
56
57
58
59
60
61
62
63
64
65
66
# Paths for Docker named volumes
OLD_STORE_DATA ?= /tmp/old-store-data
create-volumes: ## Create external data volumes.
mkdir -p ${OLD_STORE_DATA}
docker volume create \
--opt type=none \
--opt o=bind \
--opt device=$(OLD_STORE_DATA) \
old-store-data
bootstrap: bootstrap-old ## Full bootstrap.
bootstrap-old: ## Boostrap OLD (new database).
docker-compose exec mysql mysql -hlocalhost -uroot -p12345 -e "\
DROP DATABASE IF EXISTS olddev; \
CREATE DATABASE oldtests DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin; \
GRANT ALL PRIVILEGES ON olddev.* TO 'old'@'%' IDENTIFIED BY 'demo'"
docker-compose run \
--rm \
--entrypoint initialize_old_db /usr/src/old/config-env.ini \
old
docker-compose run \
--rm \
--workdir /usr/src/old \
--entrypoint pserve config-env.ini \
old
restart-old: ## Restart OLD
docker-compose restart old
db: ## Connect to the MySQL server using the CLI.
mysql -h127.0.0.1 --port=62001 -uroot -p12345
test-all: test-old ## Run all tests.
test-old: ## Run OLD tests.
docker-compose run \
--workdir /usr/src/old \
--rm \
--entrypoint=pytest /usr/src/old/old/tests/ -v
test-sqlite-part: ## Run a particular test in a SQLite testing environment.
OLD_NAME_TESTS=oldtests \
OLD_PERMANENT_STORE=test-store \
OLD_TESTING=1 \
OLD_DB_RDBMS=sqlite \
OLD_SESSION_TYPE=file \
SMTP_SERVER_ABSENT=1 \
pytest $(part) -v -s -x
test-readonly: ## Run tests for read-only mode
OLD_NAME_TESTS=oldtests \
OLD_PERMANENT_STORE=test-store \
OLD_TESTING=1 \
OLD_READONLY=1 \
OLD_DB_RDBMS=sqlite \
OLD_SESSION_TYPE=file \
SMTP_SERVER_ABSENT=1 \
pytest old/tests/functional/test_readonly_mode.py::TestReadonlyMode::test_readonly_mode -v -s -x
help: ## Print this help message.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.DEFAULT_GOAL := help