-
Notifications
You must be signed in to change notification settings - Fork 104
bundle edit_line converge fixups, converge_prepend addition/master #1855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nickanderson
merged 5 commits into
cfengine:master
from
nickanderson:converge_prepend/master
Oct 29, 2020
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8d2a63e
Added converge_prepend
tzz c4159eb
Added test for converge_prepend
nickanderson ca39f9b
Fixed converge edit_line bundle not deleting lines containing marker
tzz 70cf0fa
Added test for bundle edit_line converge
nickanderson 845bcc9
Added src block to make it easy to run tests from org-mode
nickanderson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| body common control | ||
| { | ||
| inputs => { '../../default.cf.sub' }; | ||
| bundlesequence => { default("$(this.promise_filename)") }; | ||
| version => "1.0"; | ||
| } | ||
| ####################################################### | ||
|
|
||
| bundle common classes | ||
| { | ||
| classes: | ||
| "testing_masterfiles_policy_framework" | ||
| scope => "namespace", | ||
| comment => "This class is needed so that dcs.cf.sub includes the stdlib instead of using plucked.cf.sub from core which might get out of date and cause us to not test current code from the MPF."; | ||
| } | ||
| bundle agent init | ||
| { | ||
|
|
||
|
|
||
| files: | ||
| # The tested file "actual" is copied from our seeded starting position. | ||
| "$(G.testfile)" | ||
| copy_from => local_cp("$(this.promise_filename).start"); | ||
| } | ||
|
|
||
| ####################################################### | ||
|
|
||
| bundle agent test | ||
| { | ||
| meta: | ||
| "description" -> { "CFE-3482" } | ||
| string => "Test that converge edit_line bundle works as expected"; | ||
|
|
||
| files: | ||
| "$(G.testfile)" | ||
| edit_line => converge( "covfefe", "Despite the constant negative press covfefe" ); | ||
|
|
||
| } | ||
|
|
||
| ####################################################### | ||
|
|
||
| bundle agent check | ||
| { | ||
| methods: | ||
| "Pass/FAIL" | ||
| usebundle => dcs_check_diff($(G.testfile), "$(this.promise_filename).expected", $(this.promise_filename)); | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| It has nothing to do with the oranges of the investigation, global waming, or hamberders | ||
| Despite the constant negative press covfefe |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| hashtag #covfefe | ||
| What is covfefe? | ||
| It has nothing to do with the oranges of the investigation, global waming, or hamberders | ||
| However, covfefe is bigger than the 2015 paris climate agreement. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| body common control | ||
| { | ||
| inputs => { '../../default.cf.sub' }; | ||
| bundlesequence => { default("$(this.promise_filename)") }; | ||
| version => "1.0"; | ||
| } | ||
| ####################################################### | ||
|
|
||
| bundle common classes | ||
| { | ||
| classes: | ||
|
|
||
| "testing_masterfiles_policy_framework" | ||
| scope => "namespace", | ||
| comment => "This class is needed so that dcs.cf.sub includes the stdlib instead of using plucked.cf.sub from core which might get out of date and cause us to not test current code from the MPF."; | ||
| } | ||
|
|
||
| bundle agent init | ||
| { | ||
| files: | ||
| # The tested file "actual" is copied from our seeded starting position. | ||
| "$(G.testfile)" | ||
| copy_from => local_cp("$(this.promise_filename).start"); | ||
|
|
||
| } | ||
|
|
||
| ####################################################### | ||
|
|
||
| bundle agent test | ||
| { | ||
| meta: | ||
| "description" -> { "CFE-3483" } | ||
| string => "Test that converge_prepend works as expected"; | ||
|
|
||
| files: | ||
| "$(G.testfile)" | ||
| edit_line => converge_prepend( "covfefe", "Despite the constant negative press covfefe" ); | ||
|
|
||
| } | ||
|
|
||
| ####################################################### | ||
|
|
||
| bundle agent check | ||
| { | ||
| methods: | ||
| "Pass/FAIL" | ||
| usebundle => dcs_check_diff($(G.testfile), "$(this.promise_filename).expected", $(this.promise_filename)); | ||
| } |
2 changes: 2 additions & 0 deletions
2
tests/acceptance/lib/files/edit_line_converge_prepend.cf.expected
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Despite the constant negative press covfefe | ||
| It has nothing to do with the oranges of the investigation, global waming, or hamberders |
4 changes: 4 additions & 0 deletions
4
tests/acceptance/lib/files/edit_line_converge_prepend.cf.start
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| hashtag #covfefe | ||
| What is covfefe? | ||
| It has nothing to do with the oranges of the investigation, global waming, or hamberders | ||
| However, covfefe is bigger than the 2015 paris climate agreement. |
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.
Uh oh!
There was an error while loading. Please reload this page.