Commit caa8f79
authored
chore(selenium): use dockerized selenium setup for tests (#17708)
## Description
The selenium tests were previously gated behind a `platform.machine() == "x86_64"` check because `selenium-manager` (bundled with the `selenium` package) has no binary for `linux/aarch64`, making them impossible to run locally on Apple Silicon.
This PR replaces the local `webdriver.Chrome` setup with `webdriver.Remote` pointing at a `selenium/standalone-chrome` Docker service (linux/amd64). This decouples the test runner architecture from the browser architecture, so tests run on any host.
Changes:
- **`docker-compose.yml`**: adds a `selenium-chrome` service (`selenium/standalone-chrome:latest`, `platform: linux/amd64`, `network_mode: host`) so local runs via `scripts/ddtest` work on arm64 hosts
- **`.gitlab/services.yml`**: registers `selenium-chrome` as a named GitLab CI service pointing at the internal registry mirror
- **`tests/ci_visibility/suitespec.yml`**: adds `selenium-chrome` to the selenium suite's required services and sets `SELENIUM_GRID_URL=http://selenium-chrome:4444` for CI (where services are accessed by hostname alias rather than `localhost`)
- **`test_selenium_chrome.py`**: removes the `x86_64` skipif guards and the `platform` import; extracts a `_make_driver()` helper that uses `webdriver.Remote` with `SELENIUM_GRID_URL` (defaults to `http://localhost:4444` for local runs)
- **Snapshots**: updated `test.source.start` / `test.source.end` metrics to reflect the refactored test script line numbers; also added `meta._dd.svc_src` and `meta._dd.tags.process` to the snapshot ignore list (new fields emitted by newer ddtrace versions)
## Testing
- Ran all 4 selenium tests locally via `scripts/run-tests` with the `selenium-chrome` Docker service active — all pass
- `test_selenium_v3_plugin_tags` (mock-based, no real browser) continues to pass as before
## Risks
- `selenium/standalone-chrome:latest` is a mutable tag — if the image is updated it may change browser/driver versions. The snapshot ignore list already excludes `test.browser.version` and `test.browser.driver_version` so this is safe.
## Additional Notes
The `SELENIUM_GRID_URL` env var allows the grid endpoint to be overridden without code changes, which is useful if the service is ever moved or renamed.
Co-authored-by: federico.mon <federico.mon@datadoghq.com>1 parent 84284e9 commit caa8f79
7 files changed
Lines changed: 87 additions & 84 deletions
File tree
- .gitlab
- tests
- ci_visibility
- contrib/selenium
- snapshots
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
193 | 202 | | |
194 | 203 | | |
195 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| 160 | + | |
| 161 | + | |
160 | 162 | | |
161 | 163 | | |
162 | 164 | | |
| |||
170 | 172 | | |
171 | 173 | | |
172 | 174 | | |
| 175 | + | |
| 176 | + | |
173 | 177 | | |
174 | 178 | | |
175 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
48 | 65 | | |
49 | 66 | | |
50 | 67 | | |
| |||
74 | 91 | | |
75 | 92 | | |
76 | 93 | | |
77 | | - | |
78 | 94 | | |
79 | 95 | | |
80 | | - | |
81 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
82 | 101 | | |
83 | | - | |
84 | | - | |
85 | | - | |
| 102 | + | |
86 | 103 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| 104 | + | |
91 | 105 | | |
92 | | - | |
93 | | - | |
| 106 | + | |
94 | 107 | | |
95 | | - | |
| 108 | + | |
96 | 109 | | |
97 | | - | |
| 110 | + | |
98 | 111 | | |
99 | | - | |
| 112 | + | |
| 113 | + | |
100 | 114 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 115 | + | |
| 116 | + | |
110 | 117 | | |
111 | 118 | | |
112 | 119 | | |
| |||
127 | 134 | | |
128 | 135 | | |
129 | 136 | | |
130 | | - | |
131 | 137 | | |
132 | 138 | | |
133 | | - | |
134 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
135 | 144 | | |
136 | | - | |
137 | | - | |
138 | | - | |
| 145 | + | |
139 | 146 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 147 | + | |
144 | 148 | | |
145 | | - | |
146 | | - | |
| 149 | + | |
147 | 150 | | |
148 | | - | |
| 151 | + | |
149 | 152 | | |
150 | | - | |
| 153 | + | |
151 | 154 | | |
152 | | - | |
| 155 | + | |
| 156 | + | |
153 | 157 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
| 158 | + | |
| 159 | + | |
163 | 160 | | |
164 | 161 | | |
165 | 162 | | |
| |||
180 | 177 | | |
181 | 178 | | |
182 | 179 | | |
183 | | - | |
184 | 180 | | |
185 | 181 | | |
186 | | - | |
187 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
188 | 185 | | |
189 | | - | |
190 | | - | |
191 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
192 | 190 | | |
193 | | - | |
| 191 | + | |
194 | 192 | | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
| 193 | + | |
200 | 194 | | |
201 | | - | |
202 | | - | |
| 195 | + | |
203 | 196 | | |
204 | | - | |
| 197 | + | |
205 | 198 | | |
206 | | - | |
| 199 | + | |
207 | 200 | | |
208 | | - | |
| 201 | + | |
| 202 | + | |
209 | 203 | | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
| 204 | + | |
| 205 | + | |
219 | 206 | | |
220 | 207 | | |
221 | 208 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
182 | | - | |
| 181 | + | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
183 | | - | |
| 182 | + | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
177 | | - | |
| 176 | + | |
| 177 | + | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| |||
0 commit comments