fluent-plugin-obsolete-plugins 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50b50f43386e9dcb8aec6b15127b1668429fc78eb56e497e0af46aec844e822f
|
4
|
+
data.tar.gz: ceb7b18fb122429a2d54a90250665a8e56e2a3f10d05b798b8382232fde16b4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz: '
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0299c8d42343ab0215ff8f08007d54c736380bc3a83c4a4ac8a4d7009d0e61924cf23c55913e1b28d5c9e5305a45eed5bbdb65fcd24b01ccba7051111c3d7515'
|
7
|
+
data.tar.gz: 7e36f322f52ee97c08c5f88eab26d765695fae89e8bf9e754ab4012f48dd5ff6edc3161d01728d1c2043c00f04d20db517db6495ea25985879edc78e057a6a1c
|
@@ -28,8 +28,12 @@ class Fluent::Plugin::ObsoletePluginsUtils
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
+
def self.installed_plugins
|
32
|
+
Gem::Specification.find_all.select { |x| x.name =~ /^fluent(d|-(plugin|mixin)-.*)$/ }.map(&:name)
|
33
|
+
end
|
34
|
+
|
31
35
|
def self.notify(logger, obsolete_plugins, raise_error: false)
|
32
|
-
plugins =
|
36
|
+
plugins = Fluent::Plugin::ObsoletePluginsUtils.installed_plugins & obsolete_plugins.keys
|
33
37
|
plugins.each do |name|
|
34
38
|
logger.warn("#{name} is obsolete: #{obsolete_plugins[name].chomp}")
|
35
39
|
end
|
@@ -20,6 +20,10 @@ class ObsoletePluginsFilterTest < Test::Unit::TestCase
|
|
20
20
|
]
|
21
21
|
|
22
22
|
test "no obsolete plugins" do
|
23
|
+
stub(Fluent::Plugin::ObsoletePluginsUtils).installed_plugins do
|
24
|
+
[]
|
25
|
+
end
|
26
|
+
|
23
27
|
d = create_driver(CONFIG_YAML)
|
24
28
|
d.run(default_tag: "test") do
|
25
29
|
d.feed({ message: "This is test message." })
|
@@ -32,12 +36,10 @@ class ObsoletePluginsFilterTest < Test::Unit::TestCase
|
|
32
36
|
end
|
33
37
|
|
34
38
|
test "obsolete plugins" do
|
35
|
-
|
36
|
-
|
37
|
-
"fluent-plugin-tail-multiline" => nil,
|
38
|
-
"fluent-plugin-hostname" => nil
|
39
|
-
}
|
39
|
+
stub(Fluent::Plugin::ObsoletePluginsUtils).installed_plugins do
|
40
|
+
["fluent-plugin-tail-multiline", "fluent-plugin-hostname"]
|
40
41
|
end
|
42
|
+
|
41
43
|
d = create_driver(CONFIG_YAML)
|
42
44
|
d.run(default_tag: "test") do
|
43
45
|
d.feed({ message: "This is test message." })
|
@@ -52,11 +54,8 @@ class ObsoletePluginsFilterTest < Test::Unit::TestCase
|
|
52
54
|
end
|
53
55
|
|
54
56
|
test "raise error when detect obsolete plugins" do
|
55
|
-
|
56
|
-
|
57
|
-
"fluent-plugin-tail-multiline" => nil,
|
58
|
-
"fluent-plugin-hostname" => nil
|
59
|
-
}
|
57
|
+
stub(Fluent::Plugin::ObsoletePluginsUtils).installed_plugins do
|
58
|
+
["fluent-plugin-tail-multiline", "fluent-plugin-hostname"]
|
60
59
|
end
|
61
60
|
|
62
61
|
ex = assert_raise(Fluent::ConfigError) do
|
@@ -72,6 +71,10 @@ class ObsoletePluginsFilterTest < Test::Unit::TestCase
|
|
72
71
|
]
|
73
72
|
|
74
73
|
test "no obsolete plugins" do
|
74
|
+
stub(Fluent::Plugin::ObsoletePluginsUtils).installed_plugins do
|
75
|
+
[]
|
76
|
+
end
|
77
|
+
|
75
78
|
d = create_driver(CONFIG_JSON)
|
76
79
|
d.run(default_tag: "test") do
|
77
80
|
d.feed({ message: "This is test message." })
|
@@ -81,12 +84,10 @@ class ObsoletePluginsFilterTest < Test::Unit::TestCase
|
|
81
84
|
end
|
82
85
|
|
83
86
|
test "obsolete plugins" do
|
84
|
-
|
85
|
-
|
86
|
-
"fluent-plugin-tail-multiline" => nil,
|
87
|
-
"fluent-plugin-hostname" => nil
|
88
|
-
}
|
87
|
+
stub(Fluent::Plugin::ObsoletePluginsUtils).installed_plugins do
|
88
|
+
["fluent-plugin-tail-multiline", "fluent-plugin-hostname"]
|
89
89
|
end
|
90
|
+
|
90
91
|
d = create_driver(CONFIG_JSON)
|
91
92
|
d.run(default_tag: "test") do
|
92
93
|
d.feed({ message: "This is test message." })
|
@@ -100,11 +101,8 @@ class ObsoletePluginsFilterTest < Test::Unit::TestCase
|
|
100
101
|
end
|
101
102
|
|
102
103
|
test "raise error when detect obsolete plugins" do
|
103
|
-
|
104
|
-
|
105
|
-
"fluent-plugin-tail-multiline" => nil,
|
106
|
-
"fluent-plugin-hostname" => nil
|
107
|
-
}
|
104
|
+
stub(Fluent::Plugin::ObsoletePluginsUtils).installed_plugins do
|
105
|
+
["fluent-plugin-tail-multiline", "fluent-plugin-hostname"]
|
108
106
|
end
|
109
107
|
|
110
108
|
ex = assert_raise(Fluent::ConfigError) do
|
@@ -21,6 +21,10 @@ class ObsoletePluginsInputTest < Test::Unit::TestCase
|
|
21
21
|
]
|
22
22
|
|
23
23
|
test "no obsolete plugins" do
|
24
|
+
stub(Fluent::Plugin::ObsoletePluginsUtils).installed_plugins do
|
25
|
+
[]
|
26
|
+
end
|
27
|
+
|
24
28
|
d = create_driver(CONFIG_JSON)
|
25
29
|
d.run
|
26
30
|
assert_equal([], d.events)
|
@@ -28,12 +32,10 @@ class ObsoletePluginsInputTest < Test::Unit::TestCase
|
|
28
32
|
end
|
29
33
|
|
30
34
|
test "obsolete plugins" do
|
31
|
-
stub(
|
32
|
-
|
33
|
-
"fluent-plugin-tail-multiline" => nil,
|
34
|
-
"fluent-plugin-hostname" => nil
|
35
|
-
}
|
35
|
+
stub(Fluent::Plugin::ObsoletePluginsUtils).installed_plugins do
|
36
|
+
["fluent-plugin-tail-multiline", "fluent-plugin-hostname"]
|
36
37
|
end
|
38
|
+
|
37
39
|
d = create_driver(CONFIG_JSON)
|
38
40
|
d.run
|
39
41
|
assert_equal([], d.events)
|
@@ -45,11 +47,8 @@ class ObsoletePluginsInputTest < Test::Unit::TestCase
|
|
45
47
|
end
|
46
48
|
|
47
49
|
test "raise error when detect obsolete plugins" do
|
48
|
-
stub(
|
49
|
-
|
50
|
-
"fluent-plugin-tail-multiline" => nil,
|
51
|
-
"fluent-plugin-hostname" => nil
|
52
|
-
}
|
50
|
+
stub(Fluent::Plugin::ObsoletePluginsUtils).installed_plugins do
|
51
|
+
["fluent-plugin-tail-multiline", "fluent-plugin-hostname"]
|
53
52
|
end
|
54
53
|
|
55
54
|
ex = assert_raise(Fluent::ConfigError) do
|