Commit 831a22d
chore(scripts): flag unquoted
* chore(scripts): flag unquoted `**` globs in npm scripts
POSIX sh — which is what both `npm run` and `yarn run` ultimately
invoke — does not support globstar. An unquoted `**` in a package.json
script therefore collapses to a single `*`, so the shell only passes
one directory level through to mocha/glob and specs deeper than that
are silently skipped. That is how a handful of suites were under-running
without anyone noticing.
Two coordinated pieces:
1. A new `findUnquotedGlobstar` helper (quote-state-aware, so it
doesn't false-positive on patterns that are already quoted) runs
over every `scripts` entry during `verify-exercised-tests` and
fails the check with a pointer to the offending column if any
unquoted `**` is found. Doing this via string scanning instead of
a glob-expansion probe is important because `globSync` itself
will happily expand `**` recursively regardless of quoting, so it
can't distinguish "works locally because glob is being nice" from
"broken in CI because sh already collapsed it".
2. Wrap the existing offenders in double quotes so they actually pass
the check: `test:aiguard`, `test:debugger`, `test:trace:guardrails`,
`test:esbuild`, `test:webpack`, `test:instrumentations:misc`,
`test:core`, `test:code-origin`, `test:lambda`, `test:openfeature`,
and `test:profiler`.
* test(debugger): work around fake-timers hasOwnProperty regression
Root cause is an upstream regression in fake-timers commit
`9c56bfdc` ("fix(#534): remove memory leak and potential security
issue"), which renamed what looked like a typo:
- clock[method].hadOwnProperty = Object.prototype.hasOwnProperty.call(
+ clock[method].hasOwnProperty = Object.prototype.hasOwnProperty.call(
The original name (`hadOwnProperty`) was load-bearing: the property
holds a boolean flag used by `uninstall` to decide whether to
`delete` the method or write it back. After the rename, every fake
clock method has its inherited `Object.prototype.hasOwnProperty`
shadowed by a boolean. When sinon later does
`sinon.stub(process.hrtime, 'bigint')`, its `wrapMethod` goes
const owned = object.hasOwnProperty
? object.hasOwnProperty(property) // ← boolean, not callable
: hasOwnProperty(object, property);
and crashes on the invocation.** globs in npm scripts (#8061)1 parent f269ef2 commit 831a22d
4 files changed
Lines changed: 102 additions & 17 deletions
File tree
- packages/dd-trace/test/debugger
- devtools_client/snapshot
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
66 | 69 | | |
67 | | - | |
| 70 | + | |
68 | 71 | | |
69 | | - | |
70 | | - | |
| 72 | + | |
| 73 | + | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
| |||
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
111 | 117 | | |
112 | | - | |
| 118 | + | |
113 | 119 | | |
114 | | - | |
| 120 | + | |
115 | 121 | | |
116 | | - | |
| 122 | + | |
117 | 123 | | |
118 | 124 | | |
119 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
| |||
225 | 227 | | |
226 | 228 | | |
227 | 229 | | |
| 230 | + | |
228 | 231 | | |
229 | 232 | | |
230 | 233 | | |
| |||
234 | 237 | | |
235 | 238 | | |
236 | 239 | | |
| 240 | + | |
237 | 241 | | |
238 | 242 | | |
239 | 243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
268 | 318 | | |
269 | 319 | | |
270 | 320 | | |
| |||
927 | 977 | | |
928 | 978 | | |
929 | 979 | | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
930 | 1005 | | |
931 | 1006 | | |
932 | 1007 | | |
| |||
0 commit comments