diff --git a/src/lib/persistent_data.ml b/src/lib/persistent_data.ml index fba6edea..4e9c29ae 100644 --- a/src/lib/persistent_data.ml +++ b/src/lib/persistent_data.ml @@ -1027,9 +1027,8 @@ let find_all_orphans t = end >>= fun (`Passives passives, `Actives actives)-> log_items := !log_items @ Display_markup.[ - "actives", itemize ( - List.map actives ~f:Target.(fun st -> textf "%s (%s)" (id st) (name st)) - ); + "actives", big_itemize actives + ~render:Target.(fun st -> textf "%s (%s)" (id st) (name st)); "passives", textf "%d targets" (List.length passives); ]; (* To find all the reachable-passives, we use [to_check] as a stack of @@ -1077,20 +1076,16 @@ let find_all_orphans t = >>| List.dedup ~compare:(fun a b -> compare (Target.id a) (Target.id b)) >>= fun reachable -> log_items := !log_items @ Display_markup.[ - "reachable", itemize ( - List.map reachable - ~f:Target.(fun st -> textf "%s (%s)" (id st) (name st)) - ); + "reachable", big_itemize reachable + ~render:Target.(fun st -> textf "%s (%s)" (id st) (name st)); ]; let unreachable_passives = List.filter passives ~f:(fun p -> List.for_all reachable ~f:(fun rp -> Target.id rp <> Target.id p)) in log_items := !log_items @ Display_markup.[ - "unreachable", itemize ( - List.map unreachable_passives - ~f:Target.(fun st -> textf "%s (%s)" (id st) (name st)); - ); + "unreachable", big_itemize unreachable_passives + ~render:Target.(fun st -> textf "%s (%s)" (id st) (name st)); "end", date_now (); ]; Logger.log Display_markup.(description_list !log_items); diff --git a/src/pure/internal_pervasives.ml b/src/pure/internal_pervasives.ml index 0121b229..3c45fdc1 100644 --- a/src/pure/internal_pervasives.ml +++ b/src/pure/internal_pervasives.ml @@ -277,6 +277,13 @@ module Display_markup = struct | None -> textf "%S" s | Some substr -> textf "%S... %d Bytes" substr (String.length s) + let big_itemize ?(max_display = 10) ~render l = + match List.length l with + | small when small <= max_display -> + itemize (List.map l ~f:render) + | big -> + textf "%d items" big + let rec log = function | Date f -> Time.log f diff --git a/tools/travis_ci_test.sh b/tools/travis_ci_test.sh index c0b3d6ff..0b9c5555 100644 --- a/tools/travis_ci_test.sh +++ b/tools/travis_ci_test.sh @@ -107,11 +107,10 @@ git clone git://github.com/smondet/trakeva cd trakeva make configure make -# On OSX we start our own postgresql server, on linux we use the one of the box +# On OSX we start our own postgresql server, on linux we don't run the tests case $TRAVIS_OS_NAME in osx) ./trakeva_tests ;; - linux) - POSTGRESQL_CONNECTION_INFO=postgresql://127.0.0.1/template1 ./trakeva_tests ;; + linux) echo "No trakeva tests" ;; *) echo "Unknown $TRAVIS_OS_NAME"; exit 1 esac cd ..