Skip to content
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.

Send logs from zap to t.Log() #261

Merged
merged 1 commit into from
Mar 19, 2018
Merged

Send logs from zap to t.Log() #261

merged 1 commit into from
Mar 19, 2018

Conversation

ash2k
Copy link
Contributor

@ash2k ash2k commented Mar 19, 2018

Hey, guys, check this out. Quite nice to see logs only for the failing test even if tests are run concurrently. Should use this everywhere.
Example output from another project:

--- FAIL: TestCredsForUnknownRole (0.01s)
    --- FAIL: TestCredsForUnknownRole/role_added_and_removed_after_creds_fetched (0.00s)
        utils_for_tests.go:35: 2018-03-19T10:54:41.530Z debug   Starting worker
        utils_for_tests.go:35: 2018-03-19T10:54:41.530Z debug   Starting worker
        utils_for_tests.go:35: 2018-03-19T10:54:41.530Z debug   Attempting to fetch credentials for IAM role    {"role_arn": "arn:aws:iam::123456789012:role/this/is/a/path/roleName", "session_name": "default/serviceaccounts/accountname"}
        utils_for_tests.go:35: 2018-03-19T10:54:41.530Z debug   Successfully fetched credentials for IAM role   {"role_arn": "arn:aws:iam::123456789012:role/this/is/a/path/roleName", "session_name": "default/serviceaccounts/accountname"}
        assertions.go:238: 
                        Error Trace:    prefetcher_test.go:229
                        Error:          Not equal: 
                                        expected: context.deadlineExceededError(context.deadlineExceededError{})
                                        actual  : <nil>(<nil>)
                        Test:           TestCredsForUnknownRole/role_added_and_removed_after_creds_fetched
        utils_for_tests.go:35: 2018-03-19T10:54:41.531Z debug   Stopping worker
        utils_for_tests.go:35: 2018-03-19T10:54:41.531Z debug   Stopping worker
FAIL

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

Successfully merging this pull request may close these issues.

1 participant