From 8f74e4a3d8416ff0e13d94835a959dc81b1011c1 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Tue, 14 Apr 2020 06:48:38 -0700 Subject: [PATCH] [infer-out][8/9] kill --test-determinator-output Summary: This is another entry in infer-out/, we want these to be predictable, not user-defined. Reviewed By: dulmarod Differential Revision: D20894302 fbshipit-source-id: ee60ddbcf --- infer/man/man1/infer-full.txt | 3 --- infer/src/base/Config.ml | 7 ------- infer/src/base/Config.mli | 2 -- infer/src/base/ResultsDir.ml | 3 ++- infer/src/base/ResultsDirEntryName.ml | 8 +++++++- infer/src/base/ResultsDirEntryName.mli | 1 + infer/src/test_determinator/testDeterminator.ml | 5 ++--- 7 files changed, 12 insertions(+), 17 deletions(-) diff --git a/infer/man/man1/infer-full.txt b/infer/man/man1/infer-full.txt index 0b904d9ec..82121a873 100644 --- a/infer/man/man1/infer-full.txt +++ b/infer/man/man1/infer-full.txt @@ -1751,9 +1751,6 @@ INTERNAL OPTIONS which specify the relevant arguments. (Conversely: --no-test-determinator) - --test-determinator-output path - Name of file for test-determinator results - --test-filtering Activates: List all the files Infer can report on (should be called from the root of the project) (Conversely: diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index dee1da0ea..bd2b04d2f 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -2167,11 +2167,6 @@ and test_determinator = $(b,--profiler-samples) flags, which specify the relevant arguments." -and test_determinator_output = - CLOpt.mk_path ~long:"test-determinator-output" ~default:"test_determinator.json" - "Name of file for test-determinator results" - - and export_changed_functions = CLOpt.mk_bool ~deprecated:["test-determinator-clang"] ~long:"export-changed-functions" ~default:false @@ -3023,8 +3018,6 @@ and keep_going = !keep_going and test_determinator = !test_determinator -and test_determinator_output = !test_determinator_output - and export_changed_functions = !export_changed_functions and test_filtering = !test_filtering diff --git a/infer/src/base/Config.mli b/infer/src/base/Config.mli index 5d0a90ff8..81d51290f 100644 --- a/infer/src/base/Config.mli +++ b/infer/src/base/Config.mli @@ -596,8 +596,6 @@ val symops_per_iteration : int option val test_determinator : bool -val test_determinator_output : string - val export_changed_functions : bool val test_filtering : bool diff --git a/infer/src/base/ResultsDir.ml b/infer/src/base/ResultsDir.ml index d10296a44..a0309d278 100644 --- a/infer/src/base/ResultsDir.ml +++ b/infer/src/base/ResultsDir.ml @@ -200,7 +200,8 @@ let scrub_for_caching () = Config. [ report_json ; costs_report_json - ; test_determinator_output + ; (* TestDeterminatorReport; TODO: delete, see next entry *) + "test_determinator.json" ; (* ChangedFunctions; TODO: this hard-coded string will be deleted in a next diff when the logic for scrubbing will be entirely in {!ResultsDirEntryName}. *) "changed_functions.json" ])) diff --git a/infer/src/base/ResultsDirEntryName.ml b/infer/src/base/ResultsDirEntryName.ml index 02ac04c7d..42cb07d84 100644 --- a/infer/src/base/ResultsDirEntryName.ml +++ b/infer/src/base/ResultsDirEntryName.ml @@ -6,7 +6,8 @@ *) open! IStd -type id = ChangedFunctions | Logs | Specs | Temporary [@@deriving enumerate] +type id = ChangedFunctions | Logs | Specs | Temporary | TestDeterminatorReport +[@@deriving enumerate] type cleanup_action = Delete | Keep [@@deriving equal] @@ -42,6 +43,11 @@ let of_id = function ; kind= Directory ; before_incremental_analysis= Keep ; before_caching_capture= Delete } + | TestDeterminatorReport -> + { rel_path= "test_determinator.json" + ; kind= File + ; before_incremental_analysis= Delete + ; before_caching_capture= Keep } let path_of_entry ~results_dir {rel_path; _} = results_dir ^/ rel_path diff --git a/infer/src/base/ResultsDirEntryName.mli b/infer/src/base/ResultsDirEntryName.mli index b15be65a7..a127c550e 100644 --- a/infer/src/base/ResultsDirEntryName.mli +++ b/infer/src/base/ResultsDirEntryName.mli @@ -14,6 +14,7 @@ type id = | Logs (** log file *) | Specs (** directory containing summaries as .specs files *) | Temporary (** directory containing temp files *) + | TestDeterminatorReport (** the report produced by the test determinator capture mode *) val get_path : results_dir:string -> id -> string (** the absolute path for the given entry *) diff --git a/infer/src/test_determinator/testDeterminator.ml b/infer/src/test_determinator/testDeterminator.ml index 6ca12e60b..8136c0b3b 100644 --- a/infer/src/test_determinator/testDeterminator.ml +++ b/infer/src/test_determinator/testDeterminator.ml @@ -310,8 +310,7 @@ let clang_test_to_run ~clang_range_map ~source_file () = let emit_tests_to_run_java relevant_tests = let json = `List (List.map ~f:(fun t -> `String t) relevant_tests) in - let outpath = Config.results_dir ^/ Config.test_determinator_output in - YB.to_file outpath json + YB.to_file (ResultsDir.get_path TestDeterminatorReport) json let emit_tests_to_run_clang source_file relevant_tests = @@ -343,7 +342,6 @@ let merge_test_determinator_results () = main_results_list := List.append changed_json !main_results_list in let test_determinator_results_path = Config.results_dir ^/ Config.test_determinator_results in - let main_results_file = Config.results_dir ^/ Config.test_determinator_output in Utils.directory_iter merge_json_results test_determinator_results_path ; let main_results_list_sorted = List.dedup_and_sort @@ -351,6 +349,7 @@ let merge_test_determinator_results () = match (s1, s2) with `String s1, `String s2 -> String.compare s1 s2 | _ -> 0 ) !main_results_list in + let main_results_file = ResultsDir.get_path TestDeterminatorReport in YB.to_file main_results_file (`List main_results_list_sorted) ; Logging.progress "Finished executing Test Determinator successfully, results are in %s@." main_results_file