Skip to content
Merged
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/amber/cli/templates/app/spec/spec_helper.cr
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ Micrate::DB.connection_url = Amber.settings.database_url
# Automatically run migrations on the test database
Micrate::Cli.run_up

# Disable query logger for tests
Granite.settings.logger = Logger.new nil

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can set it dynamically? Take a look here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@veelenga yeah, but I think Granite logs are very useful, you can see query time and raw sql information, these logs helped me to fix some issues on Amber itself 😅

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to leave it disabled because it generates so much noise. A verbose query log makes it hard to tell what happens when a test is failing. When tests all pass, the output of the suite should be minimal, indicating that nothing unexpected happened.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robacarp Crecto spec fails because granite dependency is missing on crecto projects. Maybe we should use a spec_helper.cr.ecr template as well, like this:

<%- if database == "granite" %>
Granite.settings.logger = Logger.new nil
<% end %>

WDYT?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@faustinoaq yes, thats a good idea.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@faustinoaq what happened here? Did the idea for the conditional get scrapped?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robacarp Yeah, let me add this conditional code 👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! 👍

module Spec
DRIVER = :chrome
PATH = "/usr/local/bin/chromedriver"
Expand Down