kpm 0.8.2 → 0.9.0
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 +1 -0
- data/.rubocop.yml +73 -8
- data/README.adoc +15 -0
- data/kpm.gemspec +3 -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/migrations.rb +18 -4
- data/lib/kpm/nexus_helper/actions.rb +2 -5
- 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/tasks.rb +3 -3
- 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 +1 -1
- data/spec/kpm/remote/base_artifact_spec.rb +15 -13
- data/spec/kpm/remote/base_installer_spec.rb +13 -13
- 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 +10 -14
data/lib/kpm/tasks.rb
CHANGED
@@ -483,7 +483,7 @@ module KPM
|
|
483
483
|
desc 'account', 'export/import accounts'
|
484
484
|
def account
|
485
485
|
config_file = nil
|
486
|
-
raise Interrupt, '--killbill_url, required format -> http(s)://something' if options[:killbill_url] && %r{https
|
486
|
+
raise Interrupt, '--killbill_url, required format -> http(s)://something' if options[:killbill_url] && %r{https?://\S+}.match(options[:killbill_url]).nil?
|
487
487
|
|
488
488
|
raise Interrupt, '--killbill_api_credentials, required format -> <api_key> <api_secrets>' if options[:killbill_api_credentials] && options[:killbill_api_credentials].size != 2
|
489
489
|
|
@@ -535,7 +535,7 @@ module KPM
|
|
535
535
|
desc: 'Killbill URL ex. http://127.0.0.1:8080'
|
536
536
|
desc 'tenant_config', 'export all tenant-level configs.'
|
537
537
|
def tenant_config
|
538
|
-
raise Interrupt, '--killbill_url, required format -> http(s)://something' if options[:killbill_url] && %r{https
|
538
|
+
raise Interrupt, '--killbill_url, required format -> http(s)://something' if options[:killbill_url] && %r{https?://\S+}.match(options[:killbill_url]).nil?
|
539
539
|
|
540
540
|
raise Interrupt, '--killbill_api_credentials, required format -> <api_key> <api_secrets>' if options[:killbill_api_credentials] && options[:killbill_api_credentials].size != 2
|
541
541
|
|
@@ -608,7 +608,7 @@ module KPM
|
|
608
608
|
def diagnostic
|
609
609
|
raise Interrupt, '--account_export, please provide a valid account id' if options[:account_export] && options[:account_export] == 'account_export'
|
610
610
|
|
611
|
-
raise Interrupt, '--killbill_url, required format -> http(s)://something' if options[:killbill_url] && %r{https
|
611
|
+
raise Interrupt, '--killbill_url, required format -> http(s)://something' if options[:killbill_url] && %r{https?://\S+}.match(options[:killbill_url]).nil?
|
612
612
|
|
613
613
|
raise Interrupt, '--killbill_api_credentials, required format -> <api_key> <api_secrets>' if options[:killbill_api_credentials] && options[:killbill_api_credentials].size != 2
|
614
614
|
|
data/lib/kpm/tenant_config.rb
CHANGED
@@ -81,7 +81,7 @@ module KPM
|
|
81
81
|
}
|
82
82
|
|
83
83
|
begin
|
84
|
-
|
84
|
+
KillBillClient::Model::Tenant.search_tenant_config(key_prefix, options)
|
85
85
|
rescue KillBillClient::API::Unauthorized
|
86
86
|
raise ArgumentError, "Unable to export tenant details, wrong credentials? username=#{@killbill_user}, password=#{mask(@killbill_password)}, api_key=#{@killbill_api_key}, api_secret=#{mask(@killbill_api_secret)}"
|
87
87
|
end
|
data/lib/kpm/tomcat_manager.rb
CHANGED
data/lib/kpm/version.rb
CHANGED
data/pom.xml
CHANGED
@@ -26,7 +26,7 @@
|
|
26
26
|
<groupId>org.kill-bill.billing.installer</groupId>
|
27
27
|
<artifactId>kpm</artifactId>
|
28
28
|
<packaging>pom</packaging>
|
29
|
-
<version>0.
|
29
|
+
<version>0.9.0</version>
|
30
30
|
<name>KPM</name>
|
31
31
|
<url>http://github.com/killbill/killbill-cloud</url>
|
32
32
|
<description>KPM: the Kill Bill Package Manager</description>
|
@@ -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,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
|
@@ -18,16 +18,16 @@ describe KPM::KillbillServerArtifact do
|
|
18
18
|
KPM::BaseArtifact::KILLBILL_CLASSIFIER,
|
19
19
|
'LATEST',
|
20
20
|
dir)
|
21
|
-
info[:file_name].
|
22
|
-
info[:size].
|
21
|
+
expect(info[:file_name]).to eq "killbill-profiles-killbill-#{info[:version]}.war"
|
22
|
+
expect(info[:size]).to eq File.size(info[:file_path])
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
26
|
it 'should be able to list versions' do
|
27
27
|
versions = KPM::KillbillServerArtifact.versions(KPM::BaseArtifact::KILLBILL_ARTIFACT_ID).to_a
|
28
28
|
expect(versions.size).to be >= 2
|
29
|
-
versions[0].
|
30
|
-
versions[1].
|
29
|
+
expect(versions[0]).to eq '0.11.10'
|
30
|
+
expect(versions[1]).to eq '0.11.11'
|
31
31
|
end
|
32
32
|
|
33
33
|
it 'should get dependencies information' do
|
@@ -36,23 +36,23 @@ describe KPM::KillbillServerArtifact do
|
|
36
36
|
Dir.mktmpdir do |dir|
|
37
37
|
sha1_file = "#{dir}/sha1.yml"
|
38
38
|
info = KPM::KillbillServerArtifact.info('0.15.9', sha1_file)
|
39
|
-
info['killbill'].
|
40
|
-
info['killbill-oss-parent'].
|
41
|
-
info['killbill-api'].
|
42
|
-
info['killbill-plugin-api'].
|
43
|
-
info['killbill-commons'].
|
44
|
-
info['killbill-platform'].
|
45
|
-
KPM::Sha1Checker.from_file(sha1_file).killbill_info('0.15.9').
|
39
|
+
expect(info['killbill']).to eq '0.15.9'
|
40
|
+
expect(info['killbill-oss-parent']).to eq '0.62'
|
41
|
+
expect(info['killbill-api']).to eq '0.27'
|
42
|
+
expect(info['killbill-plugin-api']).to eq '0.16'
|
43
|
+
expect(info['killbill-commons']).to eq '0.10'
|
44
|
+
expect(info['killbill-platform']).to eq '0.13'
|
45
|
+
expect(KPM::Sha1Checker.from_file(sha1_file).killbill_info('0.15.9')).to eq info
|
46
46
|
|
47
47
|
# Verify the download is skipped gracefully when Nexus isn't reachable
|
48
48
|
KPM::KillbillServerArtifact.info('0.15.9', sha1_file, false, nil, nexus_down)
|
49
49
|
|
50
50
|
# Verify the download fails when Nexus isn't reachable and force_download is set
|
51
|
-
expect { KPM::KillbillServerArtifact.info('0.15.9', sha1_file, true, nil, nexus_down) }.to
|
51
|
+
expect { KPM::KillbillServerArtifact.info('0.15.9', sha1_file, true, nil, nexus_down) }.to raise_exception(SocketError, /(Failed to open TCP connection to does.not.exist:443|getaddrinfo)/)
|
52
52
|
|
53
53
|
# Verify the download fails when Nexus isn't reachable and the Nexus cache is empty
|
54
54
|
KPM::Sha1Checker.from_file(sha1_file).cache_killbill_info('0.15.9', nil)
|
55
|
-
expect { KPM::KillbillServerArtifact.info('0.15.9', sha1_file, false, nil, nexus_down) }.to
|
55
|
+
expect { KPM::KillbillServerArtifact.info('0.15.9', sha1_file, false, nil, nexus_down) }.to raise_exception(SocketError, /(Failed to open TCP connection to does.not.exist:443|getaddrinfo)/)
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|