-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Commit f7cd72d
committed
cmd/go: invalidate test cache when -coverpkg sources change
When using -coverpkg, test caching could return stale coverage data
if covered packages were modified but the test package itself was
unchanged. This occurred because the test cache only considered the
test package's dependencies, not the broader set of packages specified
by -coverpkg.
This change adds dependency tracking for covered packages and includes
their source file hashes in cache validation. When any file in a
covered package changes, the test cache is properly invalidated,
ensuring fresh coverage data is generated.
Fixes issue where coverage reports contained duplicate entries with
different line ranges after source modifications in covered packages.
Fixes #74873 1 parent 6fbad4b commit f7cd72d
File tree
2 files changed
+166
-2
lines changed- src/cmd/go
- internal/test
- testdata/script
2 files changed
+166
-2
lines changedLines changed: 29 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1290 | 1290 |
| |
1291 | 1291 |
| |
1292 | 1292 |
| |
1293 | - | ||
1294 | - | ||
1293 | + | ||
1294 | + | ||
1295 | + | ||
1296 | + | ||
1297 | + | ||
1298 | + | ||
1299 | + | ||
1300 | + | ||
1301 | + | ||
1295 | 1302 |
| |
1296 | 1303 |
| |
1297 | 1304 |
| |
| |||
1833 | 1840 |
| |
1834 | 1841 |
| |
1835 | 1842 |
| |
1843 | + | ||
1836 | 1844 |
| |
1837 | 1845 |
| |
1838 | 1846 |
| |
| |||
1927 | 1935 |
| |
1928 | 1936 |
| |
1929 | 1937 |
| |
1938 | + | ||
1939 | + | ||
1940 | + | ||
1941 | + | ||
1942 | + | ||
1943 | + | ||
1944 | + | ||
1945 | + | ||
1946 | + | ||
1947 | + | ||
1948 | + | ||
1949 | + | ||
1950 | + | ||
1951 | + | ||
1952 | + | ||
1953 | + | ||
1954 | + | ||
1955 | + | ||
1956 | + | ||
1930 | 1957 |
| |
1931 | 1958 |
| |
1932 | 1959 |
| |
|
Lines changed: 137 additions & 0 deletions
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 | + | ||
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 | + |
0 commit comments