Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Commit

Permalink
Add el-cheapo reload loop
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Oct 14, 2018
1 parent 3e83c63 commit a40e35d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/CallPolly.Acceptance/Scenarios.fs
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,18 @@ type Scenarios(output : Xunit.Abstractions.ITestOutputHelper) =

let readDefinitions () = policy
// Uncomment to read from, or debug using a custom policy
//let readDefinitions () = System.Environment.GetEnvironmentVariable "CALL_POLICY" |> System.IO.File.ReadAllText

let readDefinitions () = System.Environment.GetEnvironmentVariable "CALL_POLICY" |> System.IO.File.ReadAllText
let renderAsPrettyJson x = Parser.Newtonsoft.Serialize(x, Parser.Newtonsoft.indentSettings)

let [<Fact>] ``DumpState - Pretty print internal state dump for diagnostics using existing converters``() =
let res = Context.Create(log, readDefinitions)
// This should not result in any processing, but we keep it as a sanity check
// This should not result in any processing, but we run it as a sanity check
// the normal use is to periodically trigger a check for new policies by running it
res.CheckForChanges()
for x in 1..1(*Int32.MaxValue*) do // Poor person's demo / REPL rig for watching what real changes get logged as
if x > 1 then System.Threading.Thread.Sleep 1000
res.CheckForChanges()
//let w = Parser.parse(readDefinitions()).Warnings
//if w.Length > 0 then log.Information("Warnings... {msgs}", w |> renderAsPrettyJson)
res.DumpInternalState() |> renderAsPrettyJson |> output.WriteLine

let [<Fact>] ``DumpWarnings - Pretty print internal state dump for diagnostics using existing converters``() =
Expand Down

0 comments on commit a40e35d

Please sign in to comment.