Added support for timestamps. #5

Merged
merged 8 commits into from Sep 11, 2015

Conversation

Projects
None yet
2 participants
Owner

elopio commented Sep 11, 2015

No description provided.

- testID string
- status string
+// Event is a status or a file attachment event.
+type Event struct {
@fgimenez

fgimenez Sep 11, 2015

Collaborator

IMO it would be better if the production code is not aware of the tests, if it doesn't have different execution paths for the different environments. Maybe an interface here could be useful, with different implementations for production and for testing, what do you think?

@fgimenez

fgimenez Sep 11, 2015

Collaborator

Scratch that, I misunderstood that this TestId is about the "client" test, not the package ones

- c.Check(goOutput.Bytes(), check.DeepEquals, pythonOutput)
+ c.Check(goOutput.Bytes(), check.DeepEquals, pythonOutput,
+ check.Commentf("Wrong stream for event %v", e))
@fgimenez

fgimenez Sep 11, 2015

Collaborator

I'm getting an error here:

fgimenez@arkham:~/workspace/gocode/src/github.com/elopio/subunit$ go test -v ./...
=== RUN Test


FAIL: reference_test.go:84: SubunitReferenceSuite.TestReference

reference_test.go:101:
c.Check(goOutput.Bytes(), check.DeepEquals, pythonOutput,
check.Commentf("Wrong stream for event %v, expected %s, actual %s", e, string(goOutput.Bytes()), string(pythonOutput)))
... obtained []uint8 = []byte{0xb3, 0x2a, 0x3, 0x24, 0x55, 0xf2, 0xe3, 0x97, 0xe0, 0xd4, 0x44, 0x30, 0x13, 0x74, 0x65, 0x73, 0x74, 0x2d, 0x77, 0x69, 0x74, 0x68, 0x2d, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x60, 0x6d, 0x3f, 0xd1}
... expected []uint8 = []byte{0xb3, 0x2a, 0x3, 0x24, 0x55, 0xf2, 0xff, 0xb7, 0xe0, 0xd4, 0x44, 0x30, 0x13, 0x74, 0x65, 0x73, 0x74, 0x2d, 0x77, 0x69, 0x74, 0x68, 0x2d, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5, 0xac, 0x91, 0x17}
... Wrong stream for event {test-with-timestamp success 2015-09-11 16:22:15.550782 +0200 CEST}, expected �_�$U�����D0�test-with-timestamp`m?�, actual �_�$U�����D0�test-with-timestamp���

OOPS: 11 passed, 1 FAILED
--- FAIL: Test (0.65s)
FAIL
exit status 1
FAIL github.com/elopio/subunit 0.656s

I see that travis is happy with it, my go version:

fgimenez@arkham:~/workspace/gocode/src/github.com/elopio/subunit$ go version
go version go1.5 linux/amd64

@fgimenez

fgimenez Sep 11, 2015

Collaborator

Sorry, that output included debugging info from my side, the actual output:

fgimenez@arkham:~/workspace/gocode/src/github.com/elopio/subunit$ go test -v ./...
=== RUN Test


FAIL: reference_test.go:84: SubunitReferenceSuite.TestReference

reference_test.go:101:
c.Check(goOutput.Bytes(), check.DeepEquals, pythonOutput,
check.Commentf("Wrong stream for event %v", e))
... obtained []uint8 = []byte{0xb3, 0x2a, 0x3, 0x24, 0x55, 0xf2, 0xe6, 0x6f, 0xe4, 0x92, 0xea, 0x40, 0x13, 0x74, 0x65, 0x73, 0x74, 0x2d, 0x77, 0x69, 0x74, 0x68, 0x2d, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0xda, 0xda, 0x7f, 0x8b}
... expected []uint8 = []byte{0xb3, 0x2a, 0x3, 0x24, 0x55, 0xf3, 0x2, 0x8f, 0xe4, 0x92, 0xea, 0x40, 0x13, 0x74, 0x65, 0x73, 0x74, 0x2d, 0x77, 0x69, 0x74, 0x68, 0x2d, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x21, 0x21, 0x9, 0x17}
... Wrong stream for event {test-with-timestamp success 2015-09-11 16:34:23.613608 +0200 CEST}

OOPS: 11 passed, 1 FAILED
--- FAIL: Test (0.65s)
FAIL
exit status 1
FAIL github.com/elopio/subunit 0.650s

@elopio

elopio Sep 11, 2015

Owner

I think that's because with Now() you get a different timezone. I pushed a cast to UTC.

elopio added a commit that referenced this pull request Sep 11, 2015

Merge pull request #5 from elopio/timestamp
Added support for timestamps.

@elopio elopio merged commit efe876e into master Sep 11, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@elopio elopio deleted the timestamp branch Sep 11, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment