(#307) Fix plan parsing in JSON spec tests#311
Closed
danielparks wants to merge 3 commits intopuppetlabs:mainfrom
Closed
(#307) Fix plan parsing in JSON spec tests#311danielparks wants to merge 3 commits intopuppetlabs:mainfrom
danielparks wants to merge 3 commits intopuppetlabs:mainfrom
Conversation
This was referenced Sep 26, 2022
Contributor
Author
|
I’m inclined to close this in favor of #312, but I figured I’d let somebody else make the call. Sorry for the noise! |
5f3ed3d to
1d7c08c
Compare
1d7c08c to
7a6cc97
Compare
Previously, the tests for `PuppetStrings::Json` (in json_spec.rb) parsed a variety of code samples and then queried YARD to test the results. If a sample failed to parse, an error might be outputted (see [issue puppetlabs#307][puppetlabs#307]), but no failure was registered by the testing harness. This adds simple checks to verify that the parses actually succeed. Unfortunately, one of the samples currently fails to parse, so this commit introduces a testing error. The subbsequent commit will fix it. [puppetlabs#307]: puppetlabs#307
Previously, parsing of Puppet plan code failed in json_spec.rb because it didn’t provide a file name to the parser, which prevented the parser from enabling task support in Puppet, which prevented the parser from recognizing a plan. This turns on task support in Puppet before trying to parse a plan in json_spec.rb.
Previously, none of the examples in parser_spec.rb included a Puppet plan. This adds a plan and verifies that it parses correctly.
7a6cc97 to
b05099b
Compare
Contributor
Author
|
Closing in favor of #312. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is 3 closely related commits. I’m not totally satisfied with this solution — I would be inclined to set
Puppet[:tasks] = trueregardless of the file name, but I’m not really sure what all the implications would be.Catch parse failures in
PuppetStrings::JsontestsPreviously, the tests for
PuppetStrings::Json(in json_spec.rb) parsed a variety of code samples and then queried YARD to test the results. If a sample failed to parse, an error might be outputted (see issue #307), but no failure was registered by the testing harness.This adds simple checks to verify that the parses actually succeed.
Unfortunately, one of the samples currently fails to parse, so this commit introduces a testing error. The subbsequent commit will fix it.
(#307) Fix plan parsing in JSON spec tests
Previously, parsing of Puppet plan code failed in json_spec.rb because it didn’t provide a file name to the parser, which prevented the parser from enabling task support in Puppet, which prevented the parser from recognizing a plan.
This turns on task support in Puppet before trying to parse a plan in json_spec.rb.
Add a plan test to parser_spec.rb
Previously, none of the examples in parser_spec.rb included a Puppet plan. This adds a plan and verifies that it parses correctly.