Commit 693c335
committed
feat: add native database support for e2e tests without Docker
Add a new native package (internal/sqltest/native/) that can install and
start PostgreSQL and MySQL servers directly on Linux systems without
requiring Docker. This enables running end-to-end tests in environments
where Docker is not available (e.g., CI environments without Docker).
Key changes:
- Add internal/sqltest/native/ package with support for:
- PostgreSQL installation and startup via apt-get and systemctl/pg_ctlcluster
- MySQL installation and startup via apt-get and systemctl/service
- Graceful fallback when installation fails (e.g., no network)
- Update internal/sqltest/local/ to fall back to native installation
when Docker is not available
- Update internal/endtoend/endtoend_test.go to:
- Check environment variables first (POSTGRESQL_SERVER_URI, MYSQL_SERVER_URI)
- Fall back to Docker, then native installation
- Skip database-specific tests when that database is unavailable
- Support partial database availability (run with just PostgreSQL)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>1 parent a8b20cc commit 693c335
File tree
6 files changed
+573
-21
lines changed- internal
- endtoend
- sqltest
- local
- native
6 files changed
+573
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 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 | + | |
121 | 144 | | |
122 | | - | |
123 | 145 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
128 | 166 | | |
129 | | - | |
130 | 167 | | |
131 | 168 | | |
132 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
133 | 174 | | |
134 | 175 | | |
135 | 176 | | |
| |||
138 | 179 | | |
139 | 180 | | |
140 | 181 | | |
141 | | - | |
142 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
143 | 186 | | |
144 | 187 | | |
145 | 188 | | |
146 | | - | |
147 | | - | |
148 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
149 | 193 | | |
150 | 194 | | |
151 | 195 | | |
152 | | - | |
| 196 | + | |
153 | 197 | | |
| 198 | + | |
| 199 | + | |
154 | 200 | | |
155 | 201 | | |
156 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
157 | 206 | | |
158 | 207 | | |
159 | 208 | | |
160 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
161 | 213 | | |
162 | 214 | | |
163 | 215 | | |
| |||
172 | 224 | | |
173 | 225 | | |
174 | 226 | | |
175 | | - | |
176 | | - | |
| 227 | + | |
| 228 | + | |
177 | 229 | | |
178 | 230 | | |
179 | 231 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
34 | 42 | | |
35 | | - | |
| 43 | + | |
36 | 44 | | |
37 | 45 | | |
38 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
44 | 52 | | |
45 | | - | |
| 53 | + | |
46 | 54 | | |
47 | 55 | | |
48 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
0 commit comments