Skip to content

Commit

Permalink
Version 1.13.1
Browse files Browse the repository at this point in the history
More defensive after Issue #19.
  • Loading branch information
alex-harvey-z3q committed Apr 21, 2019
1 parent 8056220 commit 0a1d553
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 11 deletions.
1 change: 1 addition & 0 deletions .README.erb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ earlier|1.8.0
1.12.0|1.15.1
1.13.0|1.15.2
1.13.0|1.15.3
1.13.1|1.15.3

Note that Puppet 3 support was dropped in version 1.11.0.

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2019-04-21 - Version 1.13.1
- Fix metadata.json to specify exact required version.
- Add tests enforcing this.
- Add troubleshooting section for Issue #19.
- Stop code coverage.

2019-04-06 - Version 1.13.0
- Update to support changes in firewall 1.15.2 (which added a
new feature) and 1.15.3.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ earlier|1.8.0
1.12.0|1.15.1
1.13.0|1.15.2
1.13.0|1.15.3
1.13.1|1.15.3

Note that Puppet 3 support was dropped in version 1.11.0.

Expand Down
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "alexharvey-firewall_multi",
"version": "1.13.0",
"version": "1.13.1",
"author": "Alex Harvey",
"summary": "A multiplexer frontend for puppetlabs/firewall",
"license": "MIT",
Expand Down Expand Up @@ -78,7 +78,7 @@
"dependencies": [
{
"name": "puppetlabs/firewall",
"version_requirement": ">= 1.10.0 < 2.0.0"
"version_requirement": "== 1.15.3"
}
]
}
33 changes: 27 additions & 6 deletions spec/release_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,40 @@
require 'json'
require 'erb'

version = JSON.parse(File.read('metadata.json'))['version']
metadata = JSON.parse(File.read('metadata.json'))
fm_version = metadata['version']
fw_version = metadata['dependencies'][0]['version_requirement'].gsub(/^== */,'')

# https://unix.stackexchange.com/a/283489/231569
latest = %x{gsed -n '
/## Version compatibility/ {
N
N
N
}
/## Setup/!N
/.*\\n.*\\n.*\\n.*\\n.*## Setup.*/P # Backslash escaped to protect from Ruby.
D
' README.md}.chomp

expected_fm, expected_fw = latest.split('|')

describe 'Release-related checks' do
it 'Version in metadata.json should match a tag' do
expect(%x{git tag --sort=-creatordate | head -1}.chomp).to eq version
it 'Version in metadata.json should match a tag - are you about to tag & release? If so, ignore.' do
expect(%x{git tag --sort=-creatordate | head -1}.chomp).to eq fm_version
end

it 'metadata firewall version should match version matrix' do
expect(fm_version).to eq expected_fm
expect(fw_version).to eq expected_fw
end

it 'First line of CHANGELOG should mention the version' do
expect(%x{head -1 CHANGELOG}).to match /#{version}/
it 'First line of CHANGELOG should mention the version - did you forget to update CHANGELOG?' do
expect(%x{head -1 CHANGELOG}).to match /#{fm_version}/
end

it 'README should mention the version' do
expect(%x{grep ^#{version} README.md}).to match /#{version}\|\d+\.\d+\.\d+/
expect(%x{grep ^#{fm_version} README.md}).to match /#{fm_version}\|\d+\.\d+\.\d+/
end

it '.README.erb should generated README.md' do
Expand Down
3 changes: 0 additions & 3 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,4 @@
c.default_facts = {
:ipaddress => '1.1.1.1',
}
c.after(:suite) do
RSpec::Puppet::Coverage.report!(100)
end
end

0 comments on commit 0a1d553

Please sign in to comment.