Skip to content

Commit 3f0e88d

Browse files
committed
Merge pull request #2504 from pvande/feature/master/pup2093_migrate_pmt_to_v3_api
Migrate PMT to the /v3 API.
2 parents 0f1120f + 8732b5f commit 3f0e88d

File tree

105 files changed

+5715
-1473
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+5715
-1473
lines changed

acceptance/tests/modules/backwards_compatibility/13682_do_not_monkey_patch_old_pmt.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ module Tool
1010
end
1111
end
1212
end
13-
require "rubygems"
1413
require "puppet"
1514
puts Puppet.version
1615
'

acceptance/tests/modules/build/build_basic.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
summary "Nginx Module"
1818
description "Nginx"
1919
project_page "http://github.com/puppetlabs/puppetlabs-ntp"
20-
dependency "puppetlabs/stdlib", ">= 1.0.0"
20+
dependency "puppetlabs/stdlub", ">= 1.0.0"
2121
';
2222
}
2323
PP

acceptance/tests/modules/install/already_installed.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
end
2727

2828
step "Try to install a module that is already installed" do
29-
on master, puppet("module install #{module_reference}"), :acceptable_exit_codes => [1] do
30-
assert_match(/#{module_reference}.*is already installed/, stderr,
29+
on master, puppet("module install #{module_reference}"), :acceptable_exit_codes => [0] do
30+
assert_match(/#{module_reference}.*is already installed/, stdout,
3131
"Error that module was already installed was not displayed")
3232
end
3333
assert_module_installed_on_disk(master, master['distmoduledir'], module_name)

acceptance/tests/modules/install/already_installed_elsewhere.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
module_author = "pmtacceptance"
66
module_name = "nginx"
7+
module_reference = "#{module_author}-#{module_name}"
78
module_dependencies = []
89

910
orig_installed_modules = get_installed_modules_for_hosts hosts
@@ -35,8 +36,8 @@
3536
PP
3637

3738
step "Try to install a module that is already installed"
38-
on master, puppet("module install #{module_author}-#{module_name}"), :acceptable_exit_codes => [1] do
39-
assert_match(/#{module_author}-#{module_name}.*is already installed/, stderr,
39+
on master, puppet("module install #{module_author}-#{module_name}"), :acceptable_exit_codes => [0] do
40+
assert_match(/#{module_reference}.*is already installed/, stdout,
4041
"Error that module was already installed was not displayed")
4142
end
4243
assert_module_not_installed_on_disk(master, master['distmoduledir'], module_name)
@@ -50,6 +51,12 @@
5051
end
5152
assert_module_not_installed_on_disk(master, master['distmoduledir'], module_name)
5253

54+
step "Install a specifc module version that is already installed (with --force)"
55+
on master, puppet("module install #{module_author}-#{module_name} --force --version 0.0.1") do
56+
assert_module_installed_ui(stdout, module_author, module_name, '0.0.1', '==')
57+
end
58+
assert_module_installed_on_disk(master, master['distmoduledir'], module_name)
59+
5360
step "Install a module that is already installed (with --force)"
5461
on master, puppet("module install #{module_author}-#{module_name} --force") do
5562
assert_module_installed_ui(stdout, module_author, module_name)

acceptance/tests/modules/install/already_installed_with_local_changes.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,6 @@
3030
on master, "echo 'changed' >> #{module_path}/README"
3131
end
3232

33-
step "Try to install a module that is already installed" do
34-
on master, puppet("module install #{module_reference}"), :acceptable_exit_codes => [1] do
35-
assert_match(/#{module_reference}.*is already installed/, stderr,
36-
"Error that module was already installed was not displayed")
37-
assert_match(/changes made locally/, stderr,
38-
"Error that module has local changes was not displayed")
39-
end
40-
assert_module_installed_on_disk(master, master['distmoduledir'], module_name)
41-
end
42-
4333
step "Try to install a specific version of a module that is already installed" do
4434
on master, puppet("module install #{module_reference} --version 1.x"), :acceptable_exit_codes => [1] do
4535
assert_match(/Could not install module '#{module_reference}' \(v1.x\)/, stderr,

acceptance/tests/modules/install/force_ignores_dependencies.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
extend Puppet::Acceptance::ModuleUtils
44

55
module_author = "pmtacceptance"
6-
module_name = "php"
6+
module_name = "git"
77
module_dependencies = ["apache"]
88

99
orig_installed_modules = get_installed_modules_for_hosts hosts
@@ -17,8 +17,8 @@
1717

1818
step "Try to install an unsatisfiable module"
1919
on master, puppet("module install #{module_author}-#{module_name}"), :acceptable_exit_codes => [1] do
20-
assert_match(/No version of '#{module_author}-#{module_name}' will satisfy dependencies/, stderr,
21-
"Error that module dependencies could not be met was not displayed")
20+
assert_match(/No version of '#{module_author}-#{module_name}' can satisfy all dependencies/, stderr,
21+
"Error that module dependencies could not be met was not displayed")
2222
end
2323
assert_module_not_installed_on_disk(master, master['distmoduledir'], module_name)
2424
module_dependencies.each do |dependency|

acceptance/tests/modules/install/ignoring_dependencies.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
module_author = "pmtacceptance"
66
module_name = "java"
7-
module_dependencies = ["stdlib"]
7+
module_dependencies = ["stdlub"]
88

99
orig_installed_modules = get_installed_modules_for_hosts hosts
1010
teardown do

acceptance/tests/modules/install/nonexistent_module.rb

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717

1818
step "Try to install a non-existent module"
1919
on master, puppet("module install #{module_author}-#{module_name}"), :acceptable_exit_codes => [1] do
20-
assert_match(/#{module_author}\/#{module_name} not found/, stderr,
21-
"Error that module was not found was not displayed")
20+
assert_match(/could not install '#{module_author}-#{module_name}'/i, stderr,
21+
"Error that module could not be installed was not displayed")
22+
23+
assert_match(/no releases are available from/i, stderr,
24+
"Error that no releases were found was not displayed")
2225
end
2326

2427
step "Try to install a non-existent module (JSON rendering)"
@@ -27,21 +30,13 @@
2730
str = stdout.lines.to_a.last
2831
json = JSON.parse(str)
2932

30-
oneline_expectation = %[Could not execute operation for '#{module_author}/#{module_name}'. Detail: Module #{module_author}/#{module_name} not found / 410 Gone.]
31-
multiline_expectation = <<-OUTPUT.chomp
32-
Could not execute operation for '#{module_author}/#{module_name}'
33-
The server being queried was https://forge.puppetlabs.com
34-
The HTTP response we received was '410 Gone'
35-
The message we received said 'Module #{module_author}/#{module_name} not found'
36-
Check the author and module names are correct.
37-
OUTPUT
38-
33+
oneline_expectation = /could not install '#{module_author}-#{module_name}'; no releases are available from/i
34+
multiline_expectation = /could not install '#{module_author}-#{module_name}'.*no releases are available from.*have at least one published release.*\z/im
3935

40-
assert_equal nil, json['module_version']
36+
assert_equal 'failure', json['result']
4137
assert_equal "#{module_author}-#{module_name}", json['module_name']
42-
assert_equal 'failure', json['result']
43-
assert_equal master['distmoduledir'], json['install_dir']
44-
assert_equal multiline_expectation, json['error']['multiline']
45-
assert_equal oneline_expectation, json['error']['oneline']
38+
assert_equal '>= 0.0.0', json['module_version']
39+
assert_equal master['distmoduledir'], json['install_dir']
40+
assert_match oneline_expectation, json['error']['oneline']
41+
assert_match multiline_expectation, json['error']['multiline']
4642
end
47-

acceptance/tests/modules/install/with_cycles.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
on master, puppet("module install #{module_author}-#{module_name} --version 0.0.1") do
2121
assert_equal <<-OUTPUT, stdout
2222
\e[mNotice: Preparing to install into #{master['distmoduledir']} ...\e[0m
23-
\e[mNotice: Downloading from https://forge.puppetlabs.com ...\e[0m
23+
\e[mNotice: Downloading from https://forgeapi.puppetlabs.com ...\e[0m
2424
\e[mNotice: Installing -- do not interrupt ...\e[0m
2525
#{master['distmoduledir']}
2626
└─┬ #{module_author}-#{module_name} (\e[0;36mv0.0.1\e[0m)

acceptance/tests/modules/install/with_dependencies.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
module_author = "pmtacceptance"
66
module_name = "java"
7-
module_dependencies = ["stdlib"]
7+
module_dependencies = ["stdlub"]
88

99
orig_installed_modules = get_installed_modules_for_hosts hosts
1010
teardown do

0 commit comments

Comments
 (0)