You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/01/02 18:10:01 UTC

[GitHub] houshengbo closed pull request #677: lossen line # checks on go yaml parser as it keeps changing.

houshengbo closed pull request #677: lossen line # checks on go yaml parser as it keeps changing.
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/pull/677
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/parsers/deploy_parser_test.go b/parsers/deploy_parser_test.go
index 7d0bfae..1146a9c 100644
--- a/parsers/deploy_parser_test.go
+++ b/parsers/deploy_parser_test.go
@@ -54,8 +54,8 @@ func TestInvalidKeyDeploymentYaml(t *testing.T) {
 	p := NewYAMLParser()
 	_, err = p.ParseDeployment(tmpfile.Name())
 	assert.NotNil(t, err)
-	// go-yaml/yaml prints the wrong line number for mapping values. It should be 3.
-	assert.Contains(t, err.Error(), "line 2: field invalidKey not found in struct parsers.Project")
+	// NOTE: go-yaml/yaml gets the line # wrong; testing only for the invalid key message
+	assert.Contains(t, err.Error(), "field invalidKey not found in struct parsers.Project")
 }
 
 func TestMappingValueDeploymentYaml(t *testing.T) {
diff --git a/parsers/manifest_parser_test.go b/parsers/manifest_parser_test.go
index 9731630..7ec496a 100644
--- a/parsers/manifest_parser_test.go
+++ b/parsers/manifest_parser_test.go
@@ -1400,8 +1400,8 @@ func TestBadYAMLInvalidPackageKeyInManifest(t *testing.T) {
     _, err := p.ParseManifest("../tests/dat/manifest_bad_yaml_invalid_package_key.yaml")
 
     assert.NotNil(t, err)
-    // go-yaml/yaml prints the wrong line number for mapping values. It should be 4.
-    assert.Contains(t, err.Error(), "line 2: field invalidKey not found in struct parsers.Package")
+    // NOTE: go-yaml/yaml gets the line # wrong; testing only for the invalid key message
+    assert.Contains(t, err.Error(), "field invalidKey not found in struct parsers.Package")
 }
 
 func TestBadYAMLInvalidKeyMappingValueInManifest(t *testing.T) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services