tierpod / dmarc-report-converter

Convert dmarc reports from xml to human-readable formats
MIT License
237 stars 25 forks source link

Add tests for template variables #52

Closed moorereason closed 5 months ago

moorereason commented 5 months ago

Tests to go with PR #47.

tierpod commented 5 months ago

Hi @moorereason !

I'm sorry to bother you again, but could you please update this PR against master? I merged #48 and now test fails because dmarc.Parse signature changed.

tierpod commented 5 months ago

Thanks for fixes!

I've faced with another unexpected problem - the tests on my PC failed because I have a different time zone than you.

As a quick fix, I can suggest to change timezone in Makefile https://github.com/tierpod/dmarc-report-converter/blob/b9e6a843776107b11ee00afcf9c9795ac260afc2/Makefile#L19

I believe, there is a better way to deal with such test cases, but we (or I) can investigate this later.

I tested with

TZ=America/Chicago go test -mod=vendor ./cmd/... ./pkg/...

and tests passed

moorereason commented 5 months ago
TZ=America/Chicago go test -mod=vendor ./cmd/... ./pkg/...

Good catch. I should be able to fix this within the test in the next day or two.