-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #213 from opus-codium/add-test-for-bump
Tests: Add tests for bump feature
- Loading branch information
Showing
3 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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,87 @@ | ||
Feature: Bump a new version after an update | ||
Scenario: Bump the module version, update changelog and tag it after an update that produces changes | ||
Given a basic setup with a puppet module "puppet-test" from "fakenamespace" | ||
And the puppet module "puppet-test" from "fakenamespace" has a file named "CHANGELOG.md" with: | ||
""" | ||
## 1965-04-14 - Release 0.4.2 | ||
""" | ||
And a file named "config_defaults.yml" with: | ||
""" | ||
--- | ||
new-file: | ||
content: aruba | ||
""" | ||
And a directory named "moduleroot" | ||
And a file named "moduleroot/new-file.erb" with: | ||
""" | ||
<%= @configs['content'] %> | ||
""" | ||
When I run `msync update --message "Add new-file" --bump --changelog --tag` | ||
Then the exit status should be 0 | ||
And the file named "modules/fakenamespace/puppet-test/new-file" should contain "aruba" | ||
And the stdout should contain: | ||
""" | ||
Bumped to version 0.4.3 | ||
""" | ||
And the stdout should contain: | ||
""" | ||
Tagging with 0.4.3 | ||
""" | ||
And the file named "modules/fakenamespace/puppet-test/CHANGELOG.md" should contain "0.4.3" | ||
And the puppet module "puppet-test" from "fakenamespace" should have 2 commits made by "Aruba" | ||
And the puppet module "puppet-test" from "fakenamespace" should have a tag named "0.4.3" | ||
|
||
Scenario: Bump the module version after an update that produces changes | ||
Given a basic setup with a puppet module "puppet-test" from "fakenamespace" | ||
And a file named "config_defaults.yml" with: | ||
""" | ||
--- | ||
new-file: | ||
content: aruba | ||
""" | ||
And a directory named "moduleroot" | ||
And a file named "moduleroot/new-file.erb" with: | ||
""" | ||
<%= @configs['content'] %> | ||
""" | ||
When I run `msync update --message "Add new-file" --bump` | ||
Then the exit status should be 0 | ||
And the file named "modules/fakenamespace/puppet-test/new-file" should contain "aruba" | ||
And the stdout should contain: | ||
""" | ||
Bumped to version 0.4.3 | ||
""" | ||
And the puppet module "puppet-test" from "fakenamespace" should have 2 commits made by "Aruba" | ||
And the puppet module "puppet-test" from "fakenamespace" should not have a tag named "0.4.3" | ||
|
||
Scenario: Bump the module version with changelog update when no CHANGELOG.md is available | ||
Given a basic setup with a puppet module "puppet-test" from "fakenamespace" | ||
And a file named "config_defaults.yml" with: | ||
""" | ||
--- | ||
new-file: | ||
content: aruba | ||
""" | ||
And a directory named "moduleroot" | ||
And a file named "moduleroot/new-file.erb" with: | ||
""" | ||
<%= @configs['content'] %> | ||
""" | ||
When I run `msync update --message "Add new-file" --bump --changelog` | ||
Then the exit status should be 0 | ||
And the file named "modules/fakenamespace/puppet-test/new-file" should contain "aruba" | ||
And the stdout should contain: | ||
""" | ||
Bumped to version 0.4.3 | ||
No CHANGELOG.md file found, not updating. | ||
""" | ||
And the file named "modules/fakenamespace/puppet-test/CHANGELOG.md" should not exist | ||
And the puppet module "puppet-test" from "fakenamespace" should have 2 commits made by "Aruba" | ||
|
||
Scenario: Dont bump the module version after an update that produces no changes | ||
Given a basic setup with a puppet module "puppet-test" from "fakenamespace" | ||
And a directory named "moduleroot" | ||
When I run `msync update --message "Add new-file" --bump --tag` | ||
Then the exit status should be 0 | ||
And the puppet module "puppet-test" from "fakenamespace" should have no commits made by "Aruba" | ||
And the puppet module "puppet-test" from "fakenamespace" should not have a tag named "0.4.3" |
This file contains 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