kpm 0.8.2 → 0.10.2
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 +4 -4
- data/.gitignore +2 -0
- data/.rubocop.yml +73 -8
- data/README.adoc +37 -2
- data/docker/docker-compose.ci.mysql.yml +21 -0
- data/kpm.gemspec +4 -3
- data/lib/kpm/account.rb +3 -2
- data/lib/kpm/coordinates.rb +4 -3
- data/lib/kpm/database.rb +3 -2
- data/lib/kpm/formatter.rb +2 -2
- data/lib/kpm/inspector.rb +2 -2
- data/lib/kpm/killbill_server_artifact.rb +19 -10
- data/lib/kpm/migrations.rb +18 -4
- data/lib/kpm/nexus_helper/actions.rb +9 -5
- data/lib/kpm/nexus_helper/cloudsmith_api_calls.rb +85 -0
- data/lib/kpm/nexus_helper/github_api_calls.rb +70 -0
- data/lib/kpm/nexus_helper/nexus_api_calls_v2.rb +79 -50
- data/lib/kpm/plugins_directory.yml +8 -4
- data/lib/kpm/plugins_manager.rb +12 -5
- data/lib/kpm/tasks.rb +23 -7
- data/lib/kpm/tenant_config.rb +1 -1
- data/lib/kpm/tomcat_manager.rb +1 -0
- data/lib/kpm/version.rb +1 -1
- data/pom.xml +211 -40
- data/spec/kpm/remote/base_artifact_spec.rb +15 -13
- data/spec/kpm/remote/base_installer_spec.rb +13 -13
- data/spec/kpm/remote/cloudsmith_api_calls_spec.rb +109 -0
- data/spec/kpm/remote/github_api_calls_spec.rb +40 -0
- data/spec/kpm/remote/installer_spec.rb +30 -30
- data/spec/kpm/remote/kaui_artifact_spec.rb +4 -4
- data/spec/kpm/remote/killbill_plugin_artifact_spec.rb +19 -19
- data/spec/kpm/remote/killbill_server_artifact_spec.rb +13 -13
- data/spec/kpm/remote/migrations_spec.rb +9 -9
- data/spec/kpm/remote/nexus_facade_spec.rb +2 -2
- data/spec/kpm/remote/tenant_config_spec.rb +3 -3
- data/spec/kpm/remote/tomcat_manager_spec.rb +2 -2
- data/spec/kpm/unit/actions_spec.rb +2 -2
- data/spec/kpm/unit/base_artifact_spec.rb +14 -14
- data/spec/kpm/unit/inspector_spec.rb +28 -28
- data/spec/kpm/unit/installer_spec.rb +4 -4
- data/spec/kpm/unit/plugins_directory_spec.rb +31 -31
- data/spec/kpm/unit/plugins_manager_spec.rb +54 -54
- data/spec/kpm/unit/sha1_checker_spec.rb +2 -2
- data/spec/kpm/unit/uninstaller_spec.rb +21 -21
- data/spec/kpm/unit_mysql/account_spec.rb +13 -13
- data/spec/spec_helper.rb +1 -1
- metadata +27 -14
@@ -36,10 +36,12 @@ describe KPM::BaseArtifact do
|
|
36
36
|
# Verify the download is skipped gracefully when Nexus isn't reachable
|
37
37
|
test_download dir, 'foo-oss.pom.xml', true, false, sha1_file, nexus_down
|
38
38
|
# Verify the download fails when Nexus isn't reachable and force_download is set
|
39
|
-
expect { test_download dir, 'foo-oss.pom.xml', nil, true, sha1_file, nexus_down }.to
|
39
|
+
expect { test_download dir, 'foo-oss.pom.xml', nil, true, sha1_file, nexus_down }.to raise_exception(SocketError, /(Failed to open TCP connection to does.not.exist:443|getaddrinfo)/)
|
40
40
|
# Verify the download fails when Nexus isn't reachable and the Nexus cache is empty
|
41
|
-
KPM::Sha1Checker.from_file(sha1_file).
|
42
|
-
|
41
|
+
expect(KPM::Sha1Checker.from_file(sha1_file).artifact_info('org.kill-bill.billing:killbill-oss-parent:pom:0.143.33')).to_not be_nil
|
42
|
+
KPM::Sha1Checker.from_file(sha1_file).remove_entry!('org.kill-bill.billing:killbill-oss-parent:pom:0.143.33')
|
43
|
+
expect(KPM::Sha1Checker.from_file(sha1_file).artifact_info('org.kill-bill.billing:killbill-oss-parent:pom:0.143.33')).to be_nil
|
44
|
+
expect { test_download dir, 'foo-oss.pom.xml', nil, false, sha1_file, nexus_down }.to raise_exception(SocketError, /(Failed to open TCP connection to does.not.exist:443|getaddrinfo)/)
|
43
45
|
end
|
44
46
|
end
|
45
47
|
|
@@ -53,14 +55,14 @@ describe KPM::BaseArtifact do
|
|
53
55
|
|
54
56
|
Dir.mktmpdir do |dir|
|
55
57
|
info = KPM::BaseArtifact.pull(@logger, group_id, artifact_id, packaging, classifier, version, dir)
|
56
|
-
info[:file_name].
|
58
|
+
expect(info[:file_name]).to be_nil
|
57
59
|
|
58
60
|
files_in_dir = Dir[info[:file_path] + '/*']
|
59
|
-
files_in_dir.size.
|
61
|
+
expect(files_in_dir.size).to eq 20
|
60
62
|
|
61
|
-
File.file?(info[:file_path] + '/killbill-osgi-bundles-jruby-0.11.3.jar').
|
63
|
+
expect(File.file?(info[:file_path] + '/killbill-osgi-bundles-jruby-0.11.3.jar')).to be_truthy
|
62
64
|
|
63
|
-
info[:bundle_dir].
|
65
|
+
expect(info[:bundle_dir]).to eq info[:file_path]
|
64
66
|
end
|
65
67
|
end
|
66
68
|
|
@@ -75,11 +77,11 @@ describe KPM::BaseArtifact do
|
|
75
77
|
|
76
78
|
Dir.mktmpdir do |dir|
|
77
79
|
first_take = KPM::BaseArtifact.pull(@logger, group_id, artifact_id, packaging, classifier, version, dir)
|
78
|
-
File.file?(first_take[:file_path] + '/killbill-platform-osgi-bundles-jruby-0.36.2.jar').
|
80
|
+
expect(File.file?(first_take[:file_path] + '/killbill-platform-osgi-bundles-jruby-0.36.2.jar')).to be_truthy
|
79
81
|
|
80
82
|
second_take = KPM::BaseArtifact.pull(@logger, group_id, artifact_id, packaging, classifier, second_bundle_version, dir)
|
81
|
-
File.file?(first_take[:file_path] + '/killbill-platform-osgi-bundles-jruby-0.36.2.jar').
|
82
|
-
File.file?(second_take[:file_path] + '/killbill-platform-osgi-bundles-jruby-0.36.10.jar').
|
83
|
+
expect(File.file?(first_take[:file_path] + '/killbill-platform-osgi-bundles-jruby-0.36.2.jar')).to be_falsey
|
84
|
+
expect(File.file?(second_take[:file_path] + '/killbill-platform-osgi-bundles-jruby-0.36.10.jar')).to be_truthy
|
83
85
|
end
|
84
86
|
end
|
85
87
|
|
@@ -87,8 +89,8 @@ describe KPM::BaseArtifact do
|
|
87
89
|
path = filename.nil? ? dir : dir + '/' + filename
|
88
90
|
|
89
91
|
info = KPM::BaseArtifact.pull(@logger, 'org.kill-bill.billing', 'killbill-oss-parent', 'pom', nil, '0.143.33', path, sha1_file, force_download, true, overrides, true)
|
90
|
-
info[:file_name].
|
91
|
-
info[:skipped].
|
92
|
-
info[:size].
|
92
|
+
expect(info[:file_name]).to eq(filename.nil? ? "killbill-oss-parent-#{info[:version]}.pom" : filename)
|
93
|
+
expect(info[:skipped]).to eq verify_is_skipped
|
94
|
+
expect(info[:size]).to eq File.size(info[:file_path]) unless info[:skipped]
|
93
95
|
end
|
94
96
|
end
|
@@ -65,7 +65,7 @@ describe KPM::BaseInstaller do
|
|
65
65
|
{ file_path: '/Somewhere/xxx-foo/target/xxx-foo-abc-SNAPSHOT.jar', expected: 'xxx-foo' },
|
66
66
|
{ file_path: '/Somewhere/xxx-foo/target/xxx-foo-abc.jar', expected: 'xxx-foo' }
|
67
67
|
].each do |test|
|
68
|
-
KPM::Utils.get_plugin_name_from_file_path(test[:file_path]).
|
68
|
+
expect(KPM::Utils.get_plugin_name_from_file_path(test[:file_path])).to eq test[:expected]
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
@@ -76,16 +76,16 @@ describe KPM::BaseInstaller do
|
|
76
76
|
|
77
77
|
plugin_identifiers = read_plugin_identifiers(plugins_dir)
|
78
78
|
|
79
|
-
plugin_identifiers.size.
|
79
|
+
expect(plugin_identifiers.size).to eq 1
|
80
80
|
|
81
|
-
plugin_identifiers['analytics']['plugin_name'].
|
82
|
-
plugin_identifiers['analytics']['group_id'].
|
83
|
-
plugin_identifiers['analytics']['artifact_id'].
|
84
|
-
plugin_identifiers['analytics']['packaging'].
|
85
|
-
plugin_identifiers['analytics']['version'].
|
86
|
-
plugin_identifiers['analytics']['language'].
|
81
|
+
expect(plugin_identifiers['analytics']['plugin_name']).to eq 'analytics-plugin'
|
82
|
+
expect(plugin_identifiers['analytics']['group_id']).to eq 'org.kill-bill.billing.plugin.java'
|
83
|
+
expect(plugin_identifiers['analytics']['artifact_id']).to eq 'analytics-plugin'
|
84
|
+
expect(plugin_identifiers['analytics']['packaging']).to eq 'jar'
|
85
|
+
expect(plugin_identifiers['analytics']['version']).to eq '0.7.1'
|
86
|
+
expect(plugin_identifiers['analytics']['language']).to eq 'java'
|
87
87
|
|
88
|
-
File.file?(plugins_dir + '/plugins/java/analytics-plugin/0.7.1/tmp/disabled.txt').
|
88
|
+
expect(File.file?(plugins_dir + '/plugins/java/analytics-plugin/0.7.1/tmp/disabled.txt')).to be_falsey
|
89
89
|
end
|
90
90
|
|
91
91
|
def check_uninstallation(plugins_dir)
|
@@ -93,9 +93,9 @@ describe KPM::BaseInstaller do
|
|
93
93
|
|
94
94
|
plugin_identifiers = read_plugin_identifiers(plugins_dir)
|
95
95
|
|
96
|
-
plugin_identifiers.size.
|
96
|
+
expect(plugin_identifiers.size).to eq 0
|
97
97
|
|
98
|
-
File.file?(plugins_dir + '/plugins/java/analytics-plugin/0.7.1/tmp/disabled.txt').
|
98
|
+
expect(File.file?(plugins_dir + '/plugins/java/analytics-plugin/0.7.1/tmp/disabled.txt')).to be_truthy
|
99
99
|
end
|
100
100
|
|
101
101
|
def common_checks(plugins_dir)
|
@@ -107,14 +107,14 @@ describe KPM::BaseInstaller do
|
|
107
107
|
plugins_dir + '/plugins/java/analytics-plugin/0.7.1',
|
108
108
|
plugins_dir + '/plugins/java/analytics-plugin/0.7.1/tmp'
|
109
109
|
].each do |dir|
|
110
|
-
File.directory?(dir).
|
110
|
+
expect(File.directory?(dir)).to be_truthy
|
111
111
|
end
|
112
112
|
|
113
113
|
[
|
114
114
|
plugins_dir + '/plugins/plugin_identifiers.json',
|
115
115
|
plugins_dir + '/plugins/java/analytics-plugin/0.7.1/analytics-plugin-0.7.1.jar'
|
116
116
|
].each do |file|
|
117
|
-
File.file?(file).
|
117
|
+
expect(File.file?(file)).to be_truthy
|
118
118
|
end
|
119
119
|
end
|
120
120
|
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
require 'rexml/document'
|
5
|
+
|
6
|
+
describe KPM::NexusFacade, skip_me_if_nil: ENV['CLOUDSMITH_TOKEN'].nil? do
|
7
|
+
let(:logger) do
|
8
|
+
logger = ::Logger.new(STDOUT)
|
9
|
+
logger.level = Logger::INFO
|
10
|
+
logger
|
11
|
+
end
|
12
|
+
let(:coordinates_map) do
|
13
|
+
{ version: '0.22.21-20210319.010242-1',
|
14
|
+
group_id: 'org.kill-bill.billing',
|
15
|
+
artifact_id: 'killbill',
|
16
|
+
packaging: 'pom',
|
17
|
+
classifier: nil }
|
18
|
+
end
|
19
|
+
let(:coordinates) { KPM::Coordinates.build_coordinates(coordinates_map) }
|
20
|
+
let(:nexus_remote) { described_class::CloudsmithApiCalls.new({ :url => "https://dl.cloudsmith.io/#{ENV['CLOUDSMITH_TOKEN']}/#{ENV['CLOUDSMITH_ORG']}/#{ENV['CLOUDSMITH_REPO']}/maven" }, true, logger) }
|
21
|
+
|
22
|
+
it {
|
23
|
+
# Not implemented
|
24
|
+
expect { nexus_remote.search_for_artifacts(coordinates) }.to raise_exception(NoMethodError, 'Cloudsmith has no search support')
|
25
|
+
}
|
26
|
+
|
27
|
+
# Upload as: cloudsmith push maven -v --group-id com.mycompany.app --artifact-id my-app --packaging pom --version 1.2.3 org/repo my-app-1.2.3.pom
|
28
|
+
# <project>
|
29
|
+
# <modelVersion>4.0.0</modelVersion>
|
30
|
+
# <groupId>com.mycompany.app</groupId>
|
31
|
+
# <artifactId>my-app</artifactId>
|
32
|
+
# <version>1.2.3</version>
|
33
|
+
# <packaging>pom</packaging>
|
34
|
+
# </project>
|
35
|
+
context 'when pulling release artifact' do
|
36
|
+
let(:coordinates_map) do
|
37
|
+
{ version: '1.2.3',
|
38
|
+
group_id: 'com.mycompany.app',
|
39
|
+
artifact_id: 'my-app',
|
40
|
+
packaging: 'pom',
|
41
|
+
classifier: nil }
|
42
|
+
end
|
43
|
+
let(:coordinates) { KPM::Coordinates.build_coordinates(coordinates_map) }
|
44
|
+
|
45
|
+
it {
|
46
|
+
response = nil
|
47
|
+
expect { response = nexus_remote.get_artifact_info(coordinates) }.not_to raise_exception
|
48
|
+
parsed_doc = REXML::Document.new(response)
|
49
|
+
expect(parsed_doc.elements['//version'].text).to eq('1.2.3')
|
50
|
+
expect(parsed_doc.elements['//repositoryPath'].text).to eq('/com/mycompany/app/1.2.3/my-app-1.2.3.pom')
|
51
|
+
expect(parsed_doc.elements['//snapshot'].text).to eq('false')
|
52
|
+
}
|
53
|
+
|
54
|
+
it {
|
55
|
+
response = nil
|
56
|
+
destination = Dir.mktmpdir('artifact')
|
57
|
+
expect { response = nexus_remote.pull_artifact(coordinates, destination) }.not_to raise_exception
|
58
|
+
destination = File.join(File.expand_path(destination), response[:file_name])
|
59
|
+
parsed_pom = REXML::Document.new(File.read(destination))
|
60
|
+
expect(parsed_pom.elements['//groupId'].text).to eq('com.mycompany.app')
|
61
|
+
expect(parsed_pom.elements['//artifactId'].text).to eq('my-app')
|
62
|
+
expect(parsed_pom.elements['//version'].text).to eq('1.2.3')
|
63
|
+
}
|
64
|
+
end
|
65
|
+
|
66
|
+
# File uploaded twice (the first doesn't have any <properties>)
|
67
|
+
# <project>
|
68
|
+
# <modelVersion>4.0.0</modelVersion>
|
69
|
+
# <groupId>com.mycompany.app</groupId>
|
70
|
+
# <artifactId>my-app</artifactId>
|
71
|
+
# <version>1.2.4-SNAPSHOT</version>
|
72
|
+
# <packaging>pom</packaging>
|
73
|
+
# <properties>
|
74
|
+
# <for-kpm>true</for-kpm>
|
75
|
+
# </properties>
|
76
|
+
# </project>
|
77
|
+
context 'when pulling SNAPSHOT artifact' do
|
78
|
+
let(:coordinates_map) do
|
79
|
+
{ version: '1.2.4-SNAPSHOT',
|
80
|
+
group_id: 'com.mycompany.app',
|
81
|
+
artifact_id: 'my-app',
|
82
|
+
packaging: 'pom',
|
83
|
+
classifier: nil }
|
84
|
+
end
|
85
|
+
let(:coordinates) { KPM::Coordinates.build_coordinates(coordinates_map) }
|
86
|
+
|
87
|
+
it {
|
88
|
+
response = nil
|
89
|
+
expect { response = nexus_remote.get_artifact_info(coordinates) }.not_to raise_exception
|
90
|
+
parsed_doc = REXML::Document.new(response)
|
91
|
+
expect(parsed_doc.elements['//version'].text).to eq('1.2.4-SNAPSHOT')
|
92
|
+
expect(parsed_doc.elements['//repositoryPath'].text).to eq('/com/mycompany/app/1.2.4-SNAPSHOT/my-app-1.2.4-SNAPSHOT.pom')
|
93
|
+
expect(parsed_doc.elements['//snapshot'].text).to eq('true')
|
94
|
+
}
|
95
|
+
|
96
|
+
it {
|
97
|
+
response = nil
|
98
|
+
destination = Dir.mktmpdir('artifact')
|
99
|
+
expect { response = nexus_remote.pull_artifact(coordinates, destination) }.not_to raise_exception
|
100
|
+
destination = File.join(File.expand_path(destination), response[:file_name])
|
101
|
+
parsed_pom = REXML::Document.new(File.read(destination))
|
102
|
+
expect(parsed_pom.elements['//groupId'].text).to eq('com.mycompany.app')
|
103
|
+
expect(parsed_pom.elements['//artifactId'].text).to eq('my-app')
|
104
|
+
expect(parsed_pom.elements['//version'].text).to eq('1.2.4-SNAPSHOT')
|
105
|
+
# Verify that if multiple SNAPSHOTs are uploaded, the last one is downloaded (the first one doesn't have <properties>)
|
106
|
+
expect(parsed_pom.elements['//properties/for-kpm'].text).to eq('true')
|
107
|
+
}
|
108
|
+
end
|
109
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
require 'rexml/document'
|
5
|
+
|
6
|
+
describe KPM::NexusFacade, skip_me_if_nil: ENV['TOKEN'].nil? do
|
7
|
+
let(:logger) do
|
8
|
+
logger = ::Logger.new(STDOUT)
|
9
|
+
logger.level = Logger::INFO
|
10
|
+
logger
|
11
|
+
end
|
12
|
+
let(:coordinates_map) do
|
13
|
+
{ version: '1.1.9',
|
14
|
+
group_id: 'org.kill-bill.billing.thirdparty',
|
15
|
+
artifact_id: 'qualpay-java-client',
|
16
|
+
packaging: 'pom',
|
17
|
+
classifier: nil }
|
18
|
+
end
|
19
|
+
let(:coordinates) { KPM::Coordinates.build_coordinates(coordinates_map) }
|
20
|
+
let(:nexus_remote) { described_class::GithubApiCalls.new({ :url => 'https://maven.pkg.github.com/killbill/qualpay-java-client', :token => ENV['TOKEN'] }, true, logger) }
|
21
|
+
|
22
|
+
it {
|
23
|
+
# Not implemented
|
24
|
+
expect { nexus_remote.search_for_artifacts(coordinates) }.to raise_exception(NoMethodError, 'GitHub Packages has no search support')
|
25
|
+
}
|
26
|
+
|
27
|
+
it {
|
28
|
+
response = nil
|
29
|
+
expect { response = nexus_remote.get_artifact_info(coordinates) }.not_to raise_exception
|
30
|
+
expect(REXML::Document.new(response).elements['//version'].text).to eq(coordinates_map[:version])
|
31
|
+
}
|
32
|
+
|
33
|
+
it {
|
34
|
+
response = nil
|
35
|
+
destination = Dir.mktmpdir('artifact')
|
36
|
+
expect { response = nexus_remote.pull_artifact(coordinates, destination) }.not_to raise_exception
|
37
|
+
destination = File.join(File.expand_path(destination), response[:file_name])
|
38
|
+
expect(File.read(destination)).to match(/qualpay-java-client/)
|
39
|
+
}
|
40
|
+
end
|
@@ -23,8 +23,8 @@ describe KPM::Installer do
|
|
23
23
|
response = nil
|
24
24
|
expect { response = installer.install }.to_not raise_exception
|
25
25
|
response = JSON[response]
|
26
|
-
response['help'].
|
27
|
-
response['killbill']['status'].
|
26
|
+
expect(response['help']).to be_nil
|
27
|
+
expect(response['killbill']['status']).to eq 'INSTALLED'
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
@@ -42,8 +42,8 @@ describe KPM::Installer do
|
|
42
42
|
response = nil
|
43
43
|
expect { response = installer.install }.to_not raise_exception
|
44
44
|
response = JSON[response]
|
45
|
-
response['help'].
|
46
|
-
response['kaui']['status'].
|
45
|
+
expect(response['help']).to be_nil
|
46
|
+
expect(response['kaui']['status']).to eq 'INSTALLED'
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
@@ -87,10 +87,10 @@ describe KPM::Installer do
|
|
87
87
|
|
88
88
|
# Finally verify that for both (well behaved) ruby and java plugin, skipping the install will still correctly return the `:bundle_dir`
|
89
89
|
info = installer.install_plugin('payment-test-plugin', nil, 'org.kill-bill.billing.plugin.ruby', 'payment-test-plugin', nil, nil, '1.8.7', plugins_dir)
|
90
|
-
info[:bundle_dir].
|
90
|
+
expect(info[:bundle_dir]).to eq plugins_dir + '/plugins/ruby/killbill-payment-test/1.8.7'
|
91
91
|
|
92
92
|
info = installer.install_plugin('analytics', nil, nil, nil, nil, nil, '0.7.1', plugins_dir)
|
93
|
-
info[:bundle_dir].
|
93
|
+
expect(info[:bundle_dir]).to eq plugins_dir + '/plugins/java/analytics-plugin/0.7.1'
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
@@ -110,7 +110,7 @@ describe KPM::Installer do
|
|
110
110
|
plugins_dir + '/plugins/ruby/killbill-payment-test',
|
111
111
|
plugins_dir + '/plugins/ruby/killbill-payment-test/1.8.7'
|
112
112
|
].each do |dir|
|
113
|
-
File.directory?(dir).
|
113
|
+
expect(File.directory?(dir)).to be_truthy
|
114
114
|
end
|
115
115
|
|
116
116
|
[
|
@@ -122,34 +122,34 @@ describe KPM::Installer do
|
|
122
122
|
plugins_dir + '/plugins/java/stripe-plugin/7.0.0/stripe-plugin-7.0.0.jar',
|
123
123
|
plugins_dir + '/plugins/ruby/killbill-payment-test/1.8.7/killbill.properties'
|
124
124
|
].each do |file|
|
125
|
-
File.file?(file).
|
125
|
+
expect(File.file?(file)).to be_truthy
|
126
126
|
end
|
127
127
|
|
128
128
|
plugin_identifiers = File.open(plugins_dir + '/plugins/plugin_identifiers.json', 'r') do |f|
|
129
129
|
JSON.parse(f.read)
|
130
130
|
end
|
131
131
|
|
132
|
-
plugin_identifiers.size.
|
133
|
-
|
134
|
-
plugin_identifiers['analytics']['plugin_name'].
|
135
|
-
plugin_identifiers['analytics']['group_id'].
|
136
|
-
plugin_identifiers['analytics']['artifact_id'].
|
137
|
-
plugin_identifiers['analytics']['packaging'].
|
138
|
-
plugin_identifiers['analytics']['version'].
|
139
|
-
plugin_identifiers['analytics']['language'].
|
140
|
-
|
141
|
-
plugin_identifiers['stripe']['plugin_name'].
|
142
|
-
plugin_identifiers['stripe']['group_id'].
|
143
|
-
plugin_identifiers['stripe']['artifact_id'].
|
144
|
-
plugin_identifiers['stripe']['packaging'].
|
145
|
-
plugin_identifiers['stripe']['version'].
|
146
|
-
plugin_identifiers['stripe']['language'].
|
147
|
-
|
148
|
-
plugin_identifiers['payment-test-plugin']['plugin_name'].
|
149
|
-
plugin_identifiers['payment-test-plugin']['group_id'].
|
150
|
-
plugin_identifiers['payment-test-plugin']['artifact_id'].
|
151
|
-
plugin_identifiers['payment-test-plugin']['packaging'].
|
152
|
-
plugin_identifiers['payment-test-plugin']['version'].
|
153
|
-
plugin_identifiers['payment-test-plugin']['language'].
|
132
|
+
expect(plugin_identifiers.size).to eq 3
|
133
|
+
|
134
|
+
expect(plugin_identifiers['analytics']['plugin_name']).to eq 'analytics-plugin'
|
135
|
+
expect(plugin_identifiers['analytics']['group_id']).to eq 'org.kill-bill.billing.plugin.java'
|
136
|
+
expect(plugin_identifiers['analytics']['artifact_id']).to eq 'analytics-plugin'
|
137
|
+
expect(plugin_identifiers['analytics']['packaging']).to eq 'jar'
|
138
|
+
expect(plugin_identifiers['analytics']['version']).to eq '0.7.1'
|
139
|
+
expect(plugin_identifiers['analytics']['language']).to eq 'java'
|
140
|
+
|
141
|
+
expect(plugin_identifiers['stripe']['plugin_name']).to eq 'stripe-plugin'
|
142
|
+
expect(plugin_identifiers['stripe']['group_id']).to eq 'org.kill-bill.billing.plugin.java'
|
143
|
+
expect(plugin_identifiers['stripe']['artifact_id']).to eq 'stripe-plugin'
|
144
|
+
expect(plugin_identifiers['stripe']['packaging']).to eq 'jar'
|
145
|
+
expect(plugin_identifiers['stripe']['version']).to eq '7.0.0'
|
146
|
+
expect(plugin_identifiers['stripe']['language']).to eq 'java'
|
147
|
+
|
148
|
+
expect(plugin_identifiers['payment-test-plugin']['plugin_name']).to eq 'killbill-payment-test'
|
149
|
+
expect(plugin_identifiers['payment-test-plugin']['group_id']).to eq 'org.kill-bill.billing.plugin.ruby'
|
150
|
+
expect(plugin_identifiers['payment-test-plugin']['artifact_id']).to eq 'payment-test-plugin'
|
151
|
+
expect(plugin_identifiers['payment-test-plugin']['packaging']).to eq 'tar.gz'
|
152
|
+
expect(plugin_identifiers['payment-test-plugin']['version']).to eq '1.8.7'
|
153
|
+
expect(plugin_identifiers['payment-test-plugin']['language']).to eq 'ruby'
|
154
154
|
end
|
155
155
|
end
|
@@ -17,15 +17,15 @@ describe KPM::KillbillPluginArtifact do
|
|
17
17
|
KPM::BaseArtifact::KAUI_CLASSIFIER,
|
18
18
|
'LATEST',
|
19
19
|
dir)
|
20
|
-
info[:file_name].
|
21
|
-
info[:size].
|
20
|
+
expect(info[:file_name]).to eq "kaui-standalone-#{info[:version]}.war"
|
21
|
+
expect(info[:size]).to eq File.size(info[:file_path])
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
it 'should be able to list versions' do
|
26
26
|
versions = KPM::KauiArtifact.versions.to_a
|
27
27
|
expect(versions.size).to be >= 2
|
28
|
-
versions[0].
|
29
|
-
versions[1].
|
28
|
+
expect(versions[0]).to eq '0.0.1'
|
29
|
+
expect(versions[1]).to eq '0.0.2'
|
30
30
|
end
|
31
31
|
end
|
@@ -20,15 +20,15 @@ describe KPM::KillbillPluginArtifact do
|
|
20
20
|
|
21
21
|
Dir.mktmpdir do |dir|
|
22
22
|
info = KPM::KillbillPluginArtifact.pull(@logger, group_id, artifact_id, packaging, classifier, version, plugin_name, dir)
|
23
|
-
info[:file_name].
|
23
|
+
expect(info[:file_name]).to be_nil
|
24
24
|
|
25
25
|
files_in_dir = Dir[info[:file_path] + '/*']
|
26
|
-
files_in_dir.size.
|
27
|
-
files_in_dir[0].
|
26
|
+
expect(files_in_dir.size).to eq 1
|
27
|
+
expect(files_in_dir[0]).to eq info[:file_path] + '/killbill-payment-test'
|
28
28
|
|
29
|
-
File.read(info[:file_path] + '/killbill-payment-test/1.8.7/killbill.properties').
|
29
|
+
expect(File.read(info[:file_path] + '/killbill-payment-test/1.8.7/killbill.properties')).to eq "mainClass=PaymentTest::PaymentPlugin\nrequire=payment_test\npluginType=PAYMENT\n"
|
30
30
|
|
31
|
-
info[:bundle_dir].
|
31
|
+
expect(info[:bundle_dir]).to eq info[:file_path] + '/killbill-payment-test/1.8.7'
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -44,8 +44,8 @@ describe KPM::KillbillPluginArtifact do
|
|
44
44
|
'killbill-analytics',
|
45
45
|
dir,
|
46
46
|
sha1_file)
|
47
|
-
info[:file_name].
|
48
|
-
info[:size].
|
47
|
+
expect(info[:file_name]).to eq "analytics-plugin-#{info[:version]}.jar"
|
48
|
+
expect(info[:size]).to eq File.size(info[:file_path])
|
49
49
|
|
50
50
|
check_yaml_for_resolved_latest_version(sha1_file, 'org.kill-bill.billing.plugin.java:analytics-plugin:jar', '3.0.0')
|
51
51
|
end
|
@@ -63,7 +63,7 @@ describe KPM::KillbillPluginArtifact do
|
|
63
63
|
sha1_file)
|
64
64
|
|
65
65
|
# No file name - since we untar'ed it
|
66
|
-
info[:file_name].
|
66
|
+
expect(info[:file_name]).to be_nil
|
67
67
|
|
68
68
|
check_yaml_for_resolved_latest_version(sha1_file, 'org.kill-bill.billing.plugin.ruby:logging-plugin:tar.gz', '3.0.0')
|
69
69
|
end
|
@@ -72,19 +72,19 @@ describe KPM::KillbillPluginArtifact do
|
|
72
72
|
it 'should be able to list versions' do
|
73
73
|
versions = KPM::KillbillPluginArtifact.versions
|
74
74
|
|
75
|
-
versions[:java].
|
76
|
-
versions[:java]['analytics-plugin'].
|
75
|
+
expect(versions[:java]).not_to be_nil
|
76
|
+
expect(versions[:java]['analytics-plugin']).not_to be_nil
|
77
77
|
logging_plugin_versions = versions[:java]['analytics-plugin'].to_a
|
78
78
|
expect(logging_plugin_versions.size).to be >= 3
|
79
|
-
logging_plugin_versions[0].
|
80
|
-
logging_plugin_versions[1].
|
81
|
-
logging_plugin_versions[2].
|
79
|
+
expect(logging_plugin_versions[0]).to eq '0.6.0'
|
80
|
+
expect(logging_plugin_versions[1]).to eq '0.7.0'
|
81
|
+
expect(logging_plugin_versions[2]).to eq '0.7.1'
|
82
82
|
|
83
|
-
versions[:ruby].
|
84
|
-
versions[:ruby]['logging-plugin'].
|
83
|
+
expect(versions[:ruby]).not_to be_nil
|
84
|
+
expect(versions[:ruby]['logging-plugin']).not_to be_nil
|
85
85
|
logging_plugin_versions = versions[:ruby]['logging-plugin'].to_a
|
86
86
|
expect(logging_plugin_versions.size).to be >= 1
|
87
|
-
logging_plugin_versions[0].
|
87
|
+
expect(logging_plugin_versions[0]).to eq '1.7.0'
|
88
88
|
end
|
89
89
|
|
90
90
|
private
|
@@ -96,11 +96,11 @@ describe KPM::KillbillPluginArtifact do
|
|
96
96
|
sha1_checker = KPM::Sha1Checker.from_file(sha1_file)
|
97
97
|
|
98
98
|
keys = sha1_checker.all_sha1.keys.select { |k| k.start_with? key_prefix }
|
99
|
-
keys.size.
|
99
|
+
expect(keys.size).to eq 1
|
100
100
|
|
101
101
|
parts = keys[0].split(':')
|
102
|
-
parts.size.
|
103
|
-
parts[3].
|
102
|
+
expect(parts.size).to eq 4
|
103
|
+
expect(parts[3]).not_to eq 'LATEST'
|
104
104
|
expect(parts[3]).to be >= minimum_version
|
105
105
|
end
|
106
106
|
end
|