junit.go ×7

Frontier kind: Code frontier

unlabeled · c_6009888f5d51

4 tests · 62 LOC · 2 files · introduces 0 tests · 42 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges42 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
14 ranges62 lines · 2 files · 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 specializationreport_with_alerts, report_with_special_characters · 0 introduced LOCreport_with_alerts, repo…TestAppendAlertsSuite · 0 introduced LOCTestAppendAlertsSuitejunit.go ×1 · 2 introduced LOCjunit.go ×1junit.go ×1 · 2 introduced LOCjunit.go ×1junit.go ×3 · 13 introduced LOCjunit.go ×3junit.go ×1 · 7 introduced LOCjunit.go ×1TestOperatorServiceMetadata, TestWorkflowServiceMetadata · 0 introduced LOCTestOperatorServiceMetad…go.temporal.io/server/tools/testrunner/junit.go · 369 LOCtestrunner/junit.gogo.temporal.io/server/tools/testrunner/log.go · 444 LOCtestrunner/log.goTestOperatorServiceMetadata · introduced test · go.temporal.io/server/common/api/TestOperatorServiceMetadataTestOperatorServiceMetad…TestWorkflowServiceMetadata · introduced test · go.temporal.io/server/common/api/TestWorkflowServiceMetadataTestWorkflowServiceMetad…TestAppendAlertsSuite · introduced test · go.temporal.io/server/tools/testrunner/TestAppendAlertsSuiteTestAppendAlertsSuiteTestAppendAlertsSuite_TruncatesLargeDetails · introduced test · go.temporal.io/server/tools/testrunner/TestAppendAlertsSuite_TruncatesLargeDetailsTestAppendAlertsSuite_Tr…report_with_alerts · introduced test · go.temporal.io/server/tools/testrunner/TestJUnitXMLWellFormed/report_with_alertsreport_with_alertsreport_with_special_characters · introduced test · go.temporal.io/server/tools/testrunner/TestJUnitXMLWellFormed/report_with_special_charactersreport_with_special_char…Focused concept · junit.go ×7 · 42 introduced LOCjunit.go ×7

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.

2 files ranked by introduced lines: 42 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/tools/testrunner/junit.go 41 introduced LOC · 7 ranges

Open complete file

130 // appendAlertsSuite adds a synthetic JUnit suite summarizing high-priority alerts
131 // (data races, panics, fatals) so that CI surfaces them prominently.
132 > func (j *junitReport) appendAlertsSuite(alerts []alert) { junit.go
133 > // Deduplicate by type+details to avoid noisy repeats across retries.
134 > alerts = dedupeAlerts(alerts)
135 > if len(alerts) == 0 {
136 return
137 }
138
139 // Convert alerts to JUnit test cases.
140 > var cases []junit.Testcase junit.go
141 > for _, a := range alerts {
142 > name := fmt.Sprintf("%s: %s", a.Type, a.Summary)
143 > if p := primaryTestName(a.Tests); p != "" {
144 > name = fmt.Sprintf("%s — in %s", name, p)
145 > }
146 > var sb strings.Builder
147 > if a.Details != "" {
148 > sb.WriteString(truncateAlertDetails(sanitizeXML(a.Details)))
149 > sb.WriteByte('\n')
150 > }
151 > if len(a.Tests) > 0 {
152 > fmt.Fprintf(&sb, "Detected in tests:\n\t%s", strings.Join(a.Tests, "\n\t"))
153 > }
154 > f := generateFailure(a.Type, strings.TrimRight(sb.String(), "\n"))
155 > cases = append(cases, junit.Testcase{
156 > Name: name,
157 > Failure: f,
158 > })
159 }
160
161 // Append the alerts suite to the report.
162 > suite := junit.Testsuite{ junit.go
163 > Name: alertsSuiteName,
164 > Failures: len(cases),
165 > Tests: len(cases),
166 > Testcases: cases,
167 > }
168 > j.Suites = append(j.Suites, suite)
169 > j.Failures += suite.Failures
170 > j.Tests += suite.Tests
171 }
172
174 // escapes <, >, & etc., but control characters other than \t, \n, \r are not
175 // legal XML and cause parsers to reject the document.
176 > func sanitizeXML(s string) string { junit.go
177 > return strings.Map(func(r rune) rune {
178 > switch r {
179 > case '\t', '\n', '\r':
180 > return r
181 case 0xFFFE, 0xFFFF:
182 return -1 // Reserved Unicode noncharacters; disallowed in XML 1.0.
183 }
184 > if r < 0x20 { junit.go
185 // 0x20 is space; lower code points are ASCII control characters.
186 return -1
187 }
188 > return r junit.go
189 }, s)
190 }
191
192 // truncateAlertDetails keeps alert payloads from bloating the JUnit artifact.
193 > func truncateAlertDetails(s string) string { junit.go
194 > if len(s) <= junitAlertDetailsMaxBytes {
195 return s
196 }
go.temporal.io/server/tools/testrunner/log.go 1 introduced LOC · 1 range

Open complete file

95 }
96 }
97 > return tests[0] log.go
98 }
99