Skip to content

Commit 4bf1989

Browse files
committed
NO-JIRA: Add docs about junits of a monitortest
1 parent 32a91eb commit 4bf1989

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

pkg/monitortestframework/types.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,16 @@ type MonitorTest interface {
5252

5353
// CollectData will only be called once near the end of execution, before all Intervals are inspected.
5454
// Errors reported will be indicated as junit test failure and will cause job runs to fail.
55-
// storageDir is for gathering data only, not for writing in this stage. To store data, use WriteContentToStorage
55+
// storageDir is for gathering data only, not for writing in this stage. To store data, use WriteContentToStorage.
56+
// The returned JUnitTestCases should be stable in different runs as the test pass/fail rate
57+
// is calculated in an aggregated to improve CI signal. I.e., if a JUnitTestCase shows up in
58+
// some run, then it should stay in other runs as well.
59+
// See https://docs.ci.openshift.org/docs/release-oversight/improving-ci-signal/#passfail-rates-for-running-jobs-10-times
60+
// for details.
61+
// In addition, we should avoid unnecessary renaming a JUnitTestCase, e.g., not using
62+
// any specific numbers that could be changed over time.
63+
// See https://github.com/openshift-eng/ci-test-mapping?tab=readme-ov-file#renaming-tests
64+
// for details.
5665
CollectData(ctx context.Context, storageDir string, beginning, end time.Time) (monitorapi.Intervals, []*junitapi.JUnitTestCase, error)
5766

5867
// ConstructComputedIntervals is called after all InvariantTests have produced raw Intervals.
@@ -64,6 +73,15 @@ type MonitorTest interface {
6473
// EvaluateTestsFromConstructedIntervals is called after all Intervals are known and can produce
6574
// junit tests for reporting purposes.
6675
// Errors reported will be indicated as junit test failure and will cause job runs to fail.
76+
// The returned JUnitTestCases should be stable in different runs as the test pass/fail rate
77+
// is calculated in an aggregated to improve CI signal. I.e., if a JUnitTestCase shows up in
78+
// some run, then it should stay in other runs as well.
79+
// See https://docs.ci.openshift.org/docs/release-oversight/improving-ci-signal/#passfail-rates-for-running-jobs-10-times
80+
// for details.
81+
// In addition, we should avoid unnecessary renaming a JUnitTestCase, e.g., not using
82+
// any specific numbers that could be changed over time.
83+
// See https://github.com/openshift-eng/ci-test-mapping?tab=readme-ov-file#renaming-tests
84+
// for details.
6785
EvaluateTestsFromConstructedIntervals(ctx context.Context, finalIntervals monitorapi.Intervals) ([]*junitapi.JUnitTestCase, error)
6886

6987
// WriteContentToStorage writes content to the storage directory that is collected by openshift CI.

0 commit comments

Comments
 (0)