Skip to content

Commit

Permalink
Skip tests in our copy of yaml.v2, for now (carvel-dev#510)
Browse files Browse the repository at this point in the history
- the implementation around parsing has drifted and now some of those
  tests fail.
- long-term, we'd like to have a running suite of tests. However, we're
  currently not modifying this library right now.
- skipping these failing tests allows for _any_ tool to simply run the
  whole suite.

Co-authored-by: John Ryan <[email protected]>
  • Loading branch information
pivotaljohn and jtigger authored Oct 14, 2021
1 parent e503308 commit a4f6089
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hack/test-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ if [ -z "$GITHUB_ACTION" ]; then
go clean -testcache
fi

go test -v `go list ./...|grep -v yaml.v2` "$@"
go test ./... "$@"

echo ALL SUCCESS
9 changes: 9 additions & 0 deletions pkg/yamlmeta/internal/yaml.v2/decode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,7 @@ type inlineC struct {
}

func (s *S) TestUnmarshal(c *C) {
c.Skip("Until these tests have been updated with ytt enhancements")
for i, item := range unmarshalTests {
c.Logf("test %d: %q", i, item.data)
t := reflect.ValueOf(item.value).Type()
Expand All @@ -764,6 +765,7 @@ func (s *S) TestUnmarshalFullTimestamp(c *C) {
}

func (s *S) TestDecoderSingleDocument(c *C) {
c.Skip("Until these tests have been updated with ytt enhancements")
// Test that Decoder.Decode works as expected on
// all the unmarshal tests.
for i, item := range unmarshalTests {
Expand Down Expand Up @@ -860,6 +862,7 @@ var unmarshalErrorTests = []struct {
}

func (s *S) TestUnmarshalErrors(c *C) {
c.Skip("Until these tests have been updated with ytt enhancements")
for i, item := range unmarshalErrorTests {
c.Logf("test %d: %q", i, item.data)
var value interface{}
Expand All @@ -869,6 +872,7 @@ func (s *S) TestUnmarshalErrors(c *C) {
}

func (s *S) TestDecoderErrors(c *C) {
c.Skip("Until these tests have been updated with ytt enhancements")
for _, item := range unmarshalErrorTests {
var value interface{}
err := yaml.NewDecoder(strings.NewReader(item.data)).Decode(&value)
Expand Down Expand Up @@ -1052,6 +1056,7 @@ func (su *sliceUnmarshaler) UnmarshalYAML(unmarshal func(interface{}) error) err
}

func (s *S) TestUnmarshalerRetry(c *C) {
c.Skip("Until these tests have been updated with ytt enhancements")
var su sliceUnmarshaler
err := yaml.Unmarshal([]byte("[1, 2, 3]"), &su)
c.Assert(err, IsNil)
Expand Down Expand Up @@ -1119,6 +1124,7 @@ inlineSequenceMap:
`

func (s *S) TestMerge(c *C) {
c.Skip("Until these tests have been updated with ytt enhancements")
var want = map[interface{}]interface{}{
"x": 1,
"y": 2,
Expand All @@ -1138,6 +1144,7 @@ func (s *S) TestMerge(c *C) {
}

func (s *S) TestMergeStruct(c *C) {
c.Skip("Until these tests have been updated with ytt enhancements")
type Data struct {
X, Y, R int
Label string
Expand Down Expand Up @@ -1166,6 +1173,7 @@ var unmarshalNullTests = []func() interface{}{
}

func (s *S) TestUnmarshalNull(c *C) {
c.Skip("Until these tests have been updated with ytt enhancements")
for _, test := range unmarshalNullTests {
item := test()
zero := reflect.Zero(reflect.TypeOf(item).Elem()).Interface()
Expand All @@ -1180,6 +1188,7 @@ func (s *S) TestUnmarshalNull(c *C) {
}

func (s *S) TestUnmarshalSliceOnPreset(c *C) {
c.Skip("Until these tests have been updated with ytt enhancements")
// Issue #48.
v := struct{ A []int }{[]int{1}}
yaml.Unmarshal([]byte("a: [2]"), &v)
Expand Down

0 comments on commit a4f6089

Please sign in to comment.