@@ -1935,6 +1935,53 @@ func TestBitBucketReporter(t *testing.T) {
19351935 return nil
19361936 },
19371937 },
1938+ {
1939+ description : "annotation on unmodified lines" ,
1940+ gitCmd : fakeGit ,
1941+ reports : []reporter.Report {
1942+ {
1943+ Path : discovery.Path {
1944+ SymlinkTarget : "foo.txt" ,
1945+ Name : "foo.txt" ,
1946+ },
1947+ ModifiedLines : []int {},
1948+ Rule : mockRules [1 ],
1949+ Problem : checks.Problem {
1950+ Lines : diags.LineRange {
1951+ First : 1 ,
1952+ Last : 1 ,
1953+ },
1954+ Reporter : "mock" ,
1955+ Summary : "line is not part of the diff" ,
1956+ Severity : checks .Bug ,
1957+ },
1958+ },
1959+ },
1960+ report : reporter.BitBucketReport {
1961+ Reporter : "Prometheus rule linter" ,
1962+ Title : "pint v0.0.0" ,
1963+ Details : reporter .BitBucketDescription ,
1964+ Link : "https://cloudflare.github.io/pint/" ,
1965+ Result : "FAIL" ,
1966+ Data : []reporter.BitBucketReportData {
1967+ {Title : "Number of rules parsed" , Type : reporter .NumberType , Value : float64 (0 )},
1968+ {Title : "Number of rules checked" , Type : reporter .NumberType , Value : float64 (0 )},
1969+ {Title : "Number of problems found" , Type : reporter .NumberType , Value : float64 (1 )},
1970+ {Title : "Number of offline checks" , Type : reporter .NumberType , Value : float64 (0 )},
1971+ {Title : "Number of online checks" , Type : reporter .NumberType , Value : float64 (0 )},
1972+ {Title : "Checks duration" , Type : reporter .DurationType , Value : float64 (0 )},
1973+ },
1974+ },
1975+ annotations : reporter.BitBucketAnnotations {
1976+ Annotations : []reporter.BitBucketAnnotation {},
1977+ },
1978+ errorHandler : func (err error ) error {
1979+ if err != nil {
1980+ return fmt .Errorf ("Unpexpected error: %w" , err )
1981+ }
1982+ return nil
1983+ },
1984+ },
19381985 }
19391986
19401987 for _ , tc := range testCases {
0 commit comments