opencompose icon indicating copy to clipboard operation
opencompose copied to clipboard

Issues with encoding_test.go

Open concaf opened this issue 8 years ago • 3 comments

Hi,

There are some problems which I encountered while working with encoding_test.go, let's fix them. Let's keep separate commits/PR's for each one of them.

  • [ ] No comments, so checking which tests are testing what gets a bit confusing, e.g. TestService_UnmarshalYAML and TestDecoder_Decode seem a bit overlapping at first sight

  • [ ] In most of the tests structs, the name string field is missing, and it is very unclear on what is being tested

  • [ ] The inputs and outputs are making the file crazy huge, let's put them in separate files for better readability

concaf avatar Apr 12 '17 12:04 concaf

@containscafeine @pradeepto @kadel I am picking the second task from the list.

surajnarwade avatar Apr 13 '17 10:04 surajnarwade

No comments, so checking which tests are testing what gets a bit confusing, e.g. TestService_UnmarshalYAML and TestDecoder_Decode seem a bit overlapping at first sight

They might seem like they are overlapping but that is ok they operate on different level. You can see what they are testing just from names.

TestDecoder_Decode tests Decode function on Decoder type (func (d *Decoder) Decode ...)

TestService_UnmarshalYAML tests UnmarshalYAML function on func Service type ( (s *Service) UnmarshalYAML ...)

kadel avatar Apr 13 '17 13:04 kadel

I would say add name to the tests that are big with lot of metadata and take up more than a page. One liner tests are fine without name.

surajssd avatar Apr 17 '17 08:04 surajssd