setTime is not supported and will throw a runtime error
But I have a Script here that uses setTime, and when I run daml test this seems to work just fine. The test output is reporting a ledger time that is equal to what I have configured via setTime.
Can anyone provide an explanation that resolves this apparent contradiction?
daml test runs against a special dummy in-memory ledger (what we used to call the scenario service but that name is a bit silly now that it runs daml scripts) which is always in static time mode. This is the same in memory ledger also used by Daml Studio so the same thing applies there. If you run it against a real ledger over gRPC (daml test-script works for this as well although it looks like it might still default to static time mode), you will get an error if your ledger is not configured in static time mode which for Sandbox means you haven’t passed --static-time.
I think what could be useful is a table that is providing an overview of all the options to run DAML code, scenarios and scripts, the specific features and constraints for each (static time, JSON API, contract IDs, etc.) , the general steps how to do that (DAML Studio, daml start, daml test, daml sandbox, deploy to Sandbox, deploy to DABL, deploy to other ledger, etc), and how those options relate to each other.
Maybe this is something for your cheat sheet, @drak?