parallelize.go ×15

Frontier kind: Code frontier

unlabeled · c_00dcab114b6c

4 tests · 52 LOC · 1 file · introduces 0 tests · 33 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
15 ranges33 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
21 ranges52 lines · 1 file · Browse complete extent
All tests (intent)
4 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Introduced files, introduced tests, and structurally relevant concept specializationparallelize.go ×2 · 7 introduced LOCparallelize.go ×2parallelize.go ×1 · 2 introduced LOCparallelize.go ×1parallelize.go ×8 · 21 introduced LOCparallelize.go ×8parallelize.go ×2 · 5 introduced LOCparallelize.go ×2parallelize.go ×3 · 5 introduced LOCparallelize.go ×3parallelize.go ×2 · 3 introduced LOCparallelize.go ×2parallelize.go ×1 · 1 introduced LOCparallelize.go ×1parallelize.go ×5 · 18 introduced LOCparallelize.go ×5TestOperatorServiceMetadata, TestWorkflowServiceMetadata · 0 introduced LOCTestOperatorServiceMetad…go.temporal.io/server/tools/parallelize/parallelize.go · 198 LOCparallelize/parallelize.…TestOperatorServiceMetadata · introduced test · go.temporal.io/server/common/api/TestOperatorServiceMetadataTestOperatorServiceMetad…TestWorkflowServiceMetadata · introduced test · go.temporal.io/server/common/api/TestWorkflowServiceMetadataTestWorkflowServiceMetad…TestProcessDir · introduced test · go.temporal.io/server/tools/parallelize/TestProcessDirTestProcessDiradds_t.Parallel_to_multiple_tests · introduced test · go.temporal.io/server/tools/parallelize/TestProcessFile/adds_t.Parallel_to_multiple_testsadds_t.Parallel_to_multi…skips_test_that_already_has_t.Parallel · introduced test · go.temporal.io/server/tools/parallelize/TestProcessFile/skips_test_that_already_has_t.Parallelskips_test_that_already_…skips_test_with_parallelize:ignore · introduced test · go.temporal.io/server/tools/parallelize/TestProcessFile/skips_test_with_parallelize:ignoreskips_test_with_parallel…Focused concept · parallelize.go ×15 · 33 introduced LOCparallelize.go ×15

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 33 introduced LOC across 15 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/tools/parallelize/parallelize.go 33 introduced LOC · 15 ranges

Open complete file

66 continue
67 }
68 > paramName := testingTParamName(fn) parallelize.go
69 > if paramName == "" {
70 continue
71 }
72 > if hasParallelCall(fn.Body, paramName) { parallelize.go
73 continue
74 }
125 return false
126 }
127 > if fn.Body == nil { parallelize.go
128 return false
129 }
130 > return testingTParamName(fn) != "" parallelize.go
131 }
132
133 // testingTParamName returns the name of the *testing.T parameter, or "" if not found.
134 > func testingTParamName(fn *ast.FuncDecl) string { parallelize.go
135 > if fn.Type.Params == nil || len(fn.Type.Params.List) == 0 {
136 return ""
137 }
138 > for _, field := range fn.Type.Params.List { parallelize.go
139 > starExpr, ok := field.Type.(*ast.StarExpr)
140 > if !ok {
141 continue
142 }
143 > selExpr, ok := starExpr.X.(*ast.SelectorExpr) parallelize.go
144 > if !ok {
145 continue
146 }
147 > pkg, ok := selExpr.X.(*ast.Ident) parallelize.go
148 > if !ok {
149 continue
150 }
151 > if pkg.Name == "testing" && selExpr.Sel.Name == "T" { parallelize.go
152 > if len(field.Names) > 0 {
153 > return field.Names[0].Name
154 > }
155 }
156 }
172
173 // hasParallelCall checks if the function body already contains <param>.Parallel().
174 > func hasParallelCall(body *ast.BlockStmt, paramName string) bool { parallelize.go
175 > found := false
176 > ast.Inspect(body, func(n ast.Node) bool {
177 > if found {
178 return false
179 }
180 > call, ok := n.(*ast.CallExpr) parallelize.go
181 > if !ok {
182 > return true
183 > }
184 > sel, ok := call.Fun.(*ast.SelectorExpr)
185 > if !ok {
186 return true
187 }
188 > ident, ok := sel.X.(*ast.Ident) parallelize.go
189 > if !ok {
190 return true
191 }
192 > if ident.Name == paramName && sel.Sel.Name == "Parallel" { parallelize.go
193 found = true
194 }
195 > return true parallelize.go
196 })
197 > return found parallelize.go
198 }