-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathshell.nix
More file actions
147 lines (129 loc) · 3.86 KB
/
shell.nix
File metadata and controls
147 lines (129 loc) · 3.86 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
{ pkgs ? import <nixpkgs> {} }:
let
python = pkgs.python312;
# Test helper scripts
test-unit = pkgs.writeShellScriptBin "test-unit" ''
python -m pytest tests/unit/ -v
'';
test-unit-backend = pkgs.writeShellScriptBin "test-unit-backend" ''
python -m pytest tests/unit/ -v -k "backend or middleware or api"
'';
test-unit-worker = pkgs.writeShellScriptBin "test-unit-worker" ''
python -m pytest tests/unit/ -v -k "worker"
'';
test-unit-scanner = pkgs.writeShellScriptBin "test-unit-scanner" ''
python -m pytest tests/unit/ -v -k "scanner"
'';
test-integration = pkgs.writeShellScriptBin "test-integration" ''
python -m pytest tests/integration/ -v -s
'';
test-setup = pkgs.writeShellScriptBin "test-setup" ''
python -m pytest tests/integration/test_setup_wizard.py -v -s
'';
test-setup-clean = pkgs.writeShellScriptBin "test-setup-clean" ''
python -m pytest tests/integration/test_setup_wizard.py --cleanup -v -s
'';
test-e2e = pkgs.writeShellScriptBin "test-e2e" ''
python -m pytest tests/e2e/ -v -s
'';
test-e2e-parallel = pkgs.writeShellScriptBin "test-e2e-parallel" ''
python -m pytest tests/e2e/ -n auto -v -s
'';
test-all = pkgs.writeShellScriptBin "test-all" ''
echo "🧪 Running all tests..."
python -m pytest tests/unit/ tests/integration/ tests/e2e/ -v
'';
test-all-clean = pkgs.writeShellScriptBin "test-all-clean" ''
echo "🧪 Running all tests with cleanup..."
python -m pytest tests/unit/ tests/integration/ tests/e2e/ --cleanup -v -s
'';
test-quick = pkgs.writeShellScriptBin "test-quick" ''
echo "⚡ Quick test run (unit tests only)..."
python -m pytest tests/unit/ -v
'';
in
pkgs.mkShell {
buildInputs = [
(python.withPackages (ps: with ps; [
pytest
pytest-asyncio
pytest-xdist
httpx
docker
email-validator
defusedxml
fastapi
uvicorn
pydantic
pydantic-settings
asyncpg
sqlalchemy
alembic
redis
aioredis
pyjwt
passlib
python-multipart
structlog
pyyaml
python-dateutil
python-dotenv
prometheus-fastapi-instrumentator
cryptography
argon2-cffi
# dependency-injector fix
(dependency-injector.overridePythonAttrs (old: {
nativeBuildInputs = (old.nativeBuildInputs or []) ++ [ ps.cython ];
doCheck = false;
}))
]))
pkgs.ripgrep
pkgs.curl
pkgs.jq
pkgs.docker
pkgs.docker-compose
# Test helper scripts
test-unit
test-unit-backend
test-unit-worker
test-unit-scanner
test-integration
test-setup
test-setup-clean
test-e2e
test-e2e-parallel
test-all
test-all-clean
test-quick
];
shellHook = ''
echo "🧪 SimpleSecCheck Dev Environment"
echo ""
echo "📋 Test Commands:"
echo ""
echo " Unit Tests:"
echo " test-unit - Run all unit tests"
echo " test-unit-backend - Backend unit tests"
echo " test-unit-worker - Worker unit tests"
echo " test-unit-scanner - Scanner unit tests"
echo ""
echo " Integration Tests:"
echo " test-integration - Run all integration tests"
echo " test-setup - Setup wizard tests"
echo " test-setup-clean - Setup tests with cleanup"
echo ""
echo " E2E Tests:"
echo " test-e2e - Run all E2E tests"
echo " test-e2e-parallel - E2E tests in parallel"
echo ""
echo " All Tests:"
echo " test-all - Run all tests (unit + integration + e2e)"
echo " test-all-clean - All tests with cleanup"
echo ""
echo " Quick Tests:"
echo " test-quick - Quick test run (unit only)"
echo ""
echo "💡 Tip: Use 'nix-shell --run \"test-unit\"' to run tests"
echo ""
'';
}