@@ -83,7 +83,8 @@ func (r *monitorTestRegistry) PrepareCollection(ctx context.Context, adminRESTCo
8383 errs := []error {}
8484
8585 for _ , invariant := range r .monitorTests {
86- testName := fmt .Sprintf ("[Jira:%q] monitor test %v preparation" , invariant .jiraComponent , invariant .name )
86+ monitorAnnotation := fmt .Sprintf ("[Monitor:%s]" , invariant .name )
87+ testName := fmt .Sprintf ("%s[Jira:%q] monitor test %v preparation" , monitorAnnotation , invariant .jiraComponent , invariant .name )
8788 logrus .Infof (" Preparing %v for %v" , invariant .name , invariant .jiraComponent )
8889
8990 start := time .Now ()
@@ -135,7 +136,8 @@ func (r *monitorTestRegistry) StartCollection(ctx context.Context, adminRESTConf
135136 go func (ctx context.Context , invariant * monitorTesttItem ) {
136137 defer wg .Done ()
137138
138- testName := fmt .Sprintf ("[Jira:%q] monitor test %v setup" , invariant .jiraComponent , invariant .name )
139+ monitorAnnotation := fmt .Sprintf ("[Monitor:%s]" , invariant .name )
140+ testName := fmt .Sprintf ("%s[Jira:%q] monitor test %v setup" , monitorAnnotation , invariant .jiraComponent , invariant .name )
139141 logrus .Infof (" Starting %v for %v" , invariant .name , invariant .jiraComponent )
140142
141143 start := time .Now ()
@@ -204,11 +206,20 @@ func (r *monitorTestRegistry) CollectData(ctx context.Context, storageDir string
204206 wg .Add (1 )
205207 go func (ctx context.Context , monitorTest * monitorTesttItem ) {
206208 defer wg .Done ()
207- testName := fmt .Sprintf ("[Jira:%q] monitor test %v collection" , monitorTest .jiraComponent , monitorTest .name )
209+ monitorAnnotation := fmt .Sprintf ("[Monitor:%s]" , monitorTest .name )
210+ testName := fmt .Sprintf ("%s[Jira:%q] monitor test %v collection" , monitorAnnotation , monitorTest .jiraComponent , monitorTest .name )
208211
209212 start := time .Now ()
210213 logrus .Infof (" Starting CollectData for %s" , testName )
211214 localIntervals , localJunits , err := collectDataWithPanicProtection (ctx , monitorTest .monitorTest , storageDir , beginning , end )
215+
216+ // make sure we have the annotation
217+ for i := range localJunits {
218+ if localJunits [i ] != nil && ! strings .Contains (localJunits [i ].Name , monitorAnnotation ) {
219+ localJunits [i ].Name = fmt .Sprintf ("%s%s" , monitorAnnotation , localJunits [i ].Name )
220+ }
221+ }
222+
212223 intervalsCh <- localIntervals
213224 junitCh <- localJunits
214225 end := time .Now ()
@@ -283,7 +294,8 @@ func (r *monitorTestRegistry) ConstructComputedIntervals(ctx context.Context, st
283294 errs := []error {}
284295
285296 for _ , monitorTest := range r .monitorTests {
286- testName := fmt .Sprintf ("[Jira:%q] monitor test %v interval construction" , monitorTest .jiraComponent , monitorTest .name )
297+ monitorAnnotation := fmt .Sprintf ("[Monitor:%s]" , monitorTest .name )
298+ testName := fmt .Sprintf ("%s[Jira:%q] monitor test %v interval construction" , monitorAnnotation , monitorTest .jiraComponent , monitorTest .name )
287299
288300 start := time .Now ()
289301 localIntervals , err := constructComputedIntervalsWithPanicProtection (ctx , monitorTest .monitorTest , startingIntervals , recordedResources , beginning , end )
@@ -332,10 +344,19 @@ func (r *monitorTestRegistry) EvaluateTestsFromConstructedIntervals(ctx context.
332344 errs := []error {}
333345
334346 for _ , monitorTest := range r .monitorTests {
335- testName := fmt .Sprintf ("[Jira:%q] monitor test %v test evaluation" , monitorTest .jiraComponent , monitorTest .name )
347+ monitorAnnotation := fmt .Sprintf ("[Monitor:%s]" , monitorTest .name )
348+ testName := fmt .Sprintf ("%s[Jira:%q] monitor test %v test evaluation" , monitorAnnotation , monitorTest .jiraComponent , monitorTest .name )
336349
337350 start := time .Now ()
338351 localJunits , err := evaluateTestsFromConstructedIntervalsWithPanicProtection (ctx , monitorTest .monitorTest , finalIntervals )
352+
353+ // make sure we have the annotation
354+ for i := range localJunits {
355+ if localJunits [i ] != nil && ! strings .Contains (localJunits [i ].Name , monitorAnnotation ) {
356+ localJunits [i ].Name = fmt .Sprintf ("%s%s" , monitorAnnotation , localJunits [i ].Name )
357+ }
358+ }
359+
339360 junits = append (junits , localJunits ... )
340361 end := time .Now ()
341362 duration := end .Sub (start )
@@ -381,7 +402,8 @@ func (r *monitorTestRegistry) WriteContentToStorage(ctx context.Context, storage
381402 errs := []error {}
382403
383404 for _ , monitorTest := range r .monitorTests {
384- testName := fmt .Sprintf ("[Jira:%q] monitor test %v writing to storage" , monitorTest .jiraComponent , monitorTest .name )
405+ monitorAnnotation := fmt .Sprintf ("[Monitor:%s]" , monitorTest .name )
406+ testName := fmt .Sprintf ("%s[Jira:%q] monitor test %v writing to storage" , monitorAnnotation , monitorTest .jiraComponent , monitorTest .name )
385407
386408 start := time .Now ()
387409
@@ -438,7 +460,8 @@ func (r *monitorTestRegistry) Cleanup(ctx context.Context) ([]*junitapi.JUnitTes
438460 errs := []error {}
439461
440462 for _ , monitorTest := range r .monitorTests {
441- testName := fmt .Sprintf ("[Jira:%q] monitor test %v cleanup" , monitorTest .jiraComponent , monitorTest .name )
463+ monitorAnnotation := fmt .Sprintf ("[Monitor:%s]" , monitorTest .name )
464+ testName := fmt .Sprintf ("%s[Jira:%q] monitor test %v cleanup" , monitorAnnotation , monitorTest .jiraComponent , monitorTest .name )
442465 log := logrus .WithField ("monitorTest" , monitorTest .name )
443466
444467 start := time .Now ()
0 commit comments