-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bugfix] Silenced should be false for the alerts API
* Force dry-run alerts to be silent to prevent false alerts * Use the unmute_monitor API call to unmute silenced alerts. The update_alerts API call will not unmute even when setting silenced to false or null. * Fix for timeout calculation * Support aliases in the filesystem group_sources. This will enable groups to have alises during renaming. * Require nokogiri to < 1.7.0 for Ruby 1.9.3 * Bump to 0.0.18
- Loading branch information
Jimmy Ngo
authored and
Jimmy Ngo
committed
Jan 3, 2017
1 parent
e56c90f
commit 8ed8cdb
Showing
7 changed files
with
106 additions
and
18 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
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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Interferon | ||
VERSION = "0.0.16" | ||
VERSION = "0.0.18" | ||
end |
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,57 @@ | ||
require 'spec_helper' | ||
require 'interferon/group_sources/filesystem' | ||
|
||
describe Interferon::GroupSources::Filesystem do | ||
let (:fs_loader) { Interferon::GroupSources::Filesystem.new({'paths' => ['/tmp']}) } | ||
|
||
describe 'list_groups' do | ||
context "with basic groups" do | ||
before do | ||
group_a = double() | ||
expect(File).to receive(:read).with('group_a.yaml').and_return('group_a_text') | ||
expect(Psych).to receive(:parse).and_return(group_a) | ||
expect(group_a).to receive(:to_ruby).and_return({'name' => 'group_a', | ||
'people' => ['Alice', 'Bob']}) | ||
|
||
group_b = double() | ||
expect(File).to receive(:read).with('group_b.yaml').and_return('group_b_text') | ||
expect(Psych).to receive(:parse).and_return(group_b) | ||
expect(group_b).to receive(:to_ruby).and_return({'name' => 'group_b', | ||
'people' => ['Carol', 'Dave']}) | ||
end | ||
|
||
it 'loads groups defined by YAML' do | ||
expect(Dir).to receive(:glob).and_return(['group_a.yaml', 'group_b.yaml'].each) | ||
|
||
groups = fs_loader.list_groups() | ||
expect(groups).to eq({'group_a' => ['Alice', 'Bob'], 'group_b' => ['Carol', 'Dave']}) | ||
end | ||
|
||
it 'allows groups to be aliased in YAML' do | ||
expect(Dir).to receive(:glob).and_return(['group_a.yaml', 'group_b.yaml', 'group_c.yaml'].each) | ||
group_c = double() | ||
expect(File).to receive(:read).with('group_c.yaml').and_return('group_c_text') | ||
expect(Psych).to receive(:parse).and_return(group_c) | ||
expect(group_c).to receive(:to_ruby).and_return({'name' => 'group_c', 'alias_for' => 'group_b'}) | ||
|
||
groups = fs_loader.list_groups() | ||
expect(groups).to eq({'group_a' => ['Alice', 'Bob'], | ||
'group_b' => ['Carol', 'Dave'], | ||
'group_c' => ['Carol', 'Dave']}) | ||
end | ||
|
||
it 'skips bad aliases in YAML' do | ||
expect(Dir).to receive(:glob).and_return(['group_a.yaml', 'group_b.yaml', 'group_c.yaml'].each) | ||
group_c = double() | ||
expect(File).to receive(:read).with('group_c.yaml').and_return('group_c_text') | ||
expect(Psych).to receive(:parse).and_return(group_c) | ||
expect(group_c).to receive(:to_ruby).and_return({'name' => 'group_c', 'alias_for' => 'group_d'}) | ||
|
||
groups = fs_loader.list_groups() | ||
expect(groups).to eq({'group_a' => ['Alice', 'Bob'], | ||
'group_b' => ['Carol', 'Dave']}) | ||
end | ||
end | ||
end | ||
|
||
end |