Skip to content

Commit d20fc3f

Browse files
committed
chore: refine justfile test URL helpers
1 parent 52554d7 commit d20fc3f

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

justfile

100644100755
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1+
#!/usr/bin/env -S just --justfile
2+
# ^ A shebang isn't required, but allows a justfile to be executed
3+
# like a script, with `./justfile lint`, for example.
4+
# Use powershell for Windows so that 'Git Bash' and 'PyCharm Terminal' get the same result
5+
16
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
27

38
src_dir := "aerich"
4-
checkfiles := "aerich tests/ conftest.py"
9+
checkfiles := src_dir + " tests/ conftest.py"
510
pytest_opts := "--cov=aerich --cov-append --tb=native -q"
6-
mysql_url := "mysql://root:" + env_var_or_default("MYSQL_PASS", "123456") + "@" + env_var_or_default("MYSQL_HOST", "127.0.0.1") + ":" + env_var_or_default("MYSQL_PORT", "3306") + "/test_\\{\\}"
7-
postgres_url := "postgres://postgres:" + env_var_or_default("POSTGRES_PASS", "123456") + "@" + env_var_or_default("POSTGRES_HOST", "127.0.0.1") + ":" + env_var_or_default("POSTGRES_PORT", "5432") + "/test_\\{\\}"
8-
psycopg_url := "psycopg://postgres:" + env_var_or_default("POSTGRES_PASS", "123456") + "@" + env_var_or_default("POSTGRES_HOST", "127.0.0.1") + ":" + env_var_or_default("POSTGRES_PORT", "5432") + "/test_\\{\\}"
11+
test_db := "/test_\\{\\}"
12+
mysql_url := "mysql://root:" + env_var_or_default("MYSQL_PASS", "123456") + "@" + env_var_or_default("MYSQL_HOST", "127.0.0.1") + ":" + env_var_or_default("MYSQL_PORT", "3306") + test_db
13+
postgres_test_uri := env_var_or_default("POSTGRES_USER", "postgres") + ":" + env_var_or_default("POSTGRES_PASS", "123456") + "@" + env_var_or_default("POSTGRES_HOST", "127.0.0.1") + ":" + env_var_or_default("POSTGRES_PORT", "5432") + test_db
14+
postgres_url := "postgres://" + postgres_test_uri
15+
psycopg_url := "psycopg://" + postgres_test_uri
916

1017
default:
1118
@just --list

0 commit comments

Comments
 (0)