Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Dumping SQL during tests #2273

Answered by sio4
preslavrachev asked this question in Q&A
May 24, 2022 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

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:

    pop.Debug = env == "development"

So basically, the pop (which handles the model/database part for the buffalo) has a variable called Debug and if the variable is true, the buffalo set logger (actually pop.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:

    pop.Debug = (env == "development" || env == "test")

to make them print those debugging informa…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@preslavrachev
Comment options

@sio4
Comment options

@preslavrachev
Comment options

@sio4
Comment options

Answer selected by preslavrachev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants