Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support errorf assertions for Hugo 0.62.0+ #20

Closed
manixate opened this issue Sep 23, 2021 · 3 comments
Closed

Support errorf assertions for Hugo 0.62.0+ #20

manixate opened this issue Sep 23, 2021 · 3 comments

Comments

@manixate
Copy link
Owner

manixate commented Sep 23, 2021

Hugo 0.62.0+ doesn't log errorf output in the HTML output. This makes it harder for us to assert on the output. Add support for asserting on such versions.
One approach is to get the log output and map it somehow to the test. This is not simple as we don't get any file line coordinates in the output.

@jaaufauvre
Copy link
Collaborator

Caused by gohugoio/hugo#6653

@manixate
Copy link
Owner Author

manixate commented Sep 27, 2021

The issue is compounded by the fact that Hugo suppresses repeated error/warn logs from a single file. e.g. if you want to assert on an error string "this is an error" in multiple test cases in your test file, then Hugo will only output it once. This makes it impossible to figure out what was the error output.

I had rewrote the error assertion logic (WIP) in this feature/hugo-errorf-assertion branch to read from the logs and assert on the test but the missing log lines are making it hard to make it fully reliable. This will only work if you have one file per error test which is not ideal. The only solution is to get that change reverted or submit a PR that would allow Hugo to output errors as before with a configuration.

manixate added a commit that referenced this issue Nov 24, 2021
Fix issue #20 / support for errorf assertions
@jaaufauvre
Copy link
Collaborator

Fixed in v1.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants