Skip to content

Commit

Permalink
added test case for dbg opt pred_has_facts
Browse files Browse the repository at this point in the history
Summary: Added a test case for prev diffs in stack, to ensure we get warnings in ``` userQueryResults_diagnostics``` when ``` queryDebugOptions_pred_has_facts = True``` , if db has no facts of the predicate

Reviewed By: josefs

Differential Revision: D65818386

fbshipit-source-id: deed56aada2e77fbf0a38152b7605f8d3125090e
  • Loading branch information
Julia Molin authored and facebook-github-bot committed Nov 18, 2024
1 parent af51d9b commit 62e04b0
Show file tree
Hide file tree
Showing 4 changed files with 1,466 additions and 1,427 deletions.
7 changes: 7 additions & 0 deletions glean/hs/Glean/Query/Thrift/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module Glean.Query.Thrift.Internal
, displayQuery
, decodeResults
, justCheck
, dbgPredHasFacts
) where

import Control.Exception
Expand Down Expand Up @@ -222,6 +223,12 @@ justCheck (Query q) = Query q'
q' = q { userQuery_options = Just (fromMaybe def (userQuery_options q))
{ userQueryOptions_just_check = True } }

dbgPredHasFacts :: Query a -> Query a
dbgPredHasFacts (Query q) = Query q'
where
q' = q { userQuery_options = Just (fromMaybe def (userQuery_options q))
{ userQueryOptions_debug = def {queryDebugOptions_pred_has_facts = True}}}

reportUserQueryStats :: Thrift.UserQueryStats -> IO ()
reportUserQueryStats stats =
vlog 1 $ showUserQueryStats stats
Expand Down
Loading

0 comments on commit 62e04b0

Please sign in to comment.