File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 2424sonar-housekeeper tests
2525"""
2626
27+ from collections .abc import Generator
28+ import pytest
29+
2730import utilities as tutil
2831from sonar import errcodes
2932from cli import housekeeper , options
@@ -36,3 +39,14 @@ def test_housekeeper() -> None:
3639 """test_housekeeper"""
3740 for opts in __GOOD_OPTS :
3841 assert tutil .run_cmd (housekeeper .main , f"{ CMD } { tutil .SQS_OPTS } { opts } " ) == errcodes .OK
42+
43+ def test_keep_branches_override (csv_file : Generator [str ]) -> None :
44+ """test_keep_branches_override"""
45+ if tutil .SQ .version () == "community" :
46+ pytest .skip ("No branches in Community" )
47+ assert tutil .run_cmd (housekeeper .main , f"{ CMD } { tutil .SQS_OPTS } -P 730 -T 730 -R 730 -B 90 -f { csv_file } " ) == errcodes .OK
48+ nbr_br = tutil .csv_col_count_values (csv_file , 1 , "BRANCH_LAST_ANALYSIS" )
49+ assert tutil .run_cmd (housekeeper .main , f"{ CMD } { tutil .SQS_OPTS } -P 730 -T 730 -R 730 -B 90 -f { csv_file } --keepWhenInactive 'dontkeepanything'" ) == errcodes .OK
50+ # With 'dontkeepanything' as branch regexp, more branches to delete should be found
51+ assert tutil .csv_col_count_values (csv_file , 1 , "BRANCH_LAST_ANALYSIS" ) > nbr_br
52+
You can’t perform that action at this time.
0 commit comments