Dumping SQL during tests #2273
-
This may be a stupid question, but I spent a considerable amount of time and could not find an answer for it: Is it possible to see the generated SQL during the execution of the tests ( |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Do you mean when running It is not directly related to the Please check your pop.Debug = env == "development" So basically, the pop (which handles the model/database part for the buffalo) has a variable called The default configuration of the newly generated app may have the above line but you can modify it as: pop.Debug = (env == "development" || env == "test") to make them print those debugging information during tests too. |
Beta Was this translation helpful? Give feedback.
Do you mean when running
buffalo test
?It is not directly related to the
buffalo test
command but you can configure your application to print out SQL logs when it runs ins test mode.Please check your
app/models/models.go
. I found the following line:So basically, the pop (which handles the model/database part for the buffalo) has a variable called
Debug
and if the variable istrue
, the buffalo setlogger
(actuallypop.log
) for pop to print out its logs.The default configuration of the newly generated app may have the above line but you can modify it as:
to make them print those debugging informa…