Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Added support for timestamps. #5
Conversation
elopio
added some commits
Sep 11, 2015
elopio
assigned
fgimenez
Sep 11, 2015
fgimenez
reviewed
Sep 11, 2015
| - testID string | ||
| - status string | ||
| +// Event is a status or a file attachment event. | ||
| +type Event struct { |
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
Sep 11, 2015
Collaborator
Scratch that, I misunderstood that this TestId is about the "client" test, not the package ones
fgimenez
reviewed
Sep 11, 2015
| - c.Check(goOutput.Bytes(), check.DeepEquals, pythonOutput) | ||
| + c.Check(goOutput.Bytes(), check.DeepEquals, pythonOutput, | ||
| + check.Commentf("Wrong stream for event %v", e)) |
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
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
Sep 11, 2015
Owner
I think that's because with Now() you get a different timezone. I pushed a cast to UTC.
elopio commentedSep 11, 2015
No description provided.