forked from puppetlabs/puppet-editor-services
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(puppetlabsGH-121) Add tests for Puppet API 3 and 4 loading
This commit adds test fixtures for Puppet 4 API style functions and modifies the integration tests to expect these new fixtures.
- Loading branch information
1 parent
514e9c0
commit a6653a6
Showing
14 changed files
with
165 additions
and
1 deletion.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
...ageserver-sidecar/fixtures/real_agent/cache/lib/puppet/functions/default_pup4_function.rb
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,8 @@ | ||
# Example function using the Puppet 4 API | ||
# This should be loaded | ||
Puppet::Functions.create_function(:default_pup4_function) do | ||
# @return [Array<String>] | ||
def default_pup4_function | ||
'default_pup4_function result' | ||
end | ||
end |
8 changes: 8 additions & 0 deletions
8
...r/fixtures/real_agent/cache/lib/puppet/functions/environment/default_env_pup4_function.rb
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,8 @@ | ||
# Example function using the Puppet 4 API | ||
# This should be loaded in the environment namespace | ||
Puppet::Functions.create_function(:'environment::default_env_pup4_function') do | ||
# @return [Array<String>] | ||
def default_env_pup4_function | ||
'default_env_pup4_function result' | ||
end | ||
end |
8 changes: 8 additions & 0 deletions
8
...decar/fixtures/real_agent/cache/lib/puppet/functions/modname/default_mod_pup4_function.rb
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,8 @@ | ||
# Example function using the Puppet 4 API | ||
# This should be loaded in the module called 'modname' namespace | ||
Puppet::Functions.create_function(:'modname::default_mod_pup4_function') do | ||
# @return [Array<String>] | ||
def default_mod_pup4_function | ||
'default_env_pup4_function result' | ||
end | ||
end |
8 changes: 8 additions & 0 deletions
8
...es/valid_environment_workspace/site/profile/lib/puppet/functions/badname/pup4_function.rb
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,8 @@ | ||
# Example function using the Puppet 4 API in a module | ||
# This should not be loaded in the environment namespace | ||
Puppet::Functions.create_function(:'badname::pup4_function') do | ||
# @return [Array<String>] | ||
def pup4_function | ||
'pup4_function result' | ||
end | ||
end |
8 changes: 8 additions & 0 deletions
8
...vironment_workspace/site/profile/lib/puppet/functions/profile/pup4_envprofile_function.rb
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,8 @@ | ||
# Example function using the Puppet 4 API in a module | ||
# This should be loaded in the module namespace | ||
Puppet::Functions.create_function(:'profile::pup4_envprofile_function') do | ||
# @return [Array<String>] | ||
def pup4_envprofile_function | ||
'pup4_envprofile_function result' | ||
end | ||
end |
10 changes: 10 additions & 0 deletions
10
...ixtures/valid_environment_workspace/site/profile/lib/puppet/functions/pup4_env_badfile.rb
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,10 @@ | ||
require 'a_bad_gem_that_does_not_exist' | ||
|
||
# Example function using the Puppet 4 API in a module | ||
# This should not be loaded | ||
Puppet::Functions.create_function(:pup4_env_badfile) do | ||
# @return [Array<String>] | ||
def pup4_env_badfile | ||
'pup4_env_badfile result' | ||
end | ||
end |
9 changes: 9 additions & 0 deletions
9
...res/valid_environment_workspace/site/profile/lib/puppet/functions/pup4_env_badfunction.rb
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,9 @@ | ||
# Example function using the Puppet 4 API in a module | ||
# This should be loaded but never actually successfully invoke | ||
Puppet::Functions.create_function(:pup4_env_badfunction) do | ||
# @return [Array<String>] | ||
def pup4_env_badfunction | ||
require 'a_bad_gem_that_does_not_exist' | ||
'pup4_env_badfunction result' | ||
end | ||
end |
8 changes: 8 additions & 0 deletions
8
...xtures/valid_environment_workspace/site/profile/lib/puppet/functions/pup4_env_function.rb
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,8 @@ | ||
# Example function using the Puppet 4 API in a module | ||
# ??? This should be loaded as global namespace function | ||
Puppet::Functions.create_function(:pup4_env_function) do | ||
# @return [Array<String>] | ||
def pup4_env_function | ||
'pup4_env_function result' | ||
end | ||
end |
8 changes: 8 additions & 0 deletions
8
...fixtures/valid_module_workspace/lib/puppet/functions/badname/fixture_pup4_env_function.rb
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,8 @@ | ||
# Example function using the Puppet 4 API in a module | ||
# This should not be loaded in the module namespace | ||
Puppet::Functions.create_function(:'badname::fixture_pup4_badname_function') do | ||
# @return [Array<String>] | ||
def fixture_pup4_badname_function | ||
'fixture_pup4_badname_function result' | ||
end | ||
end |
10 changes: 10 additions & 0 deletions
10
...rver-sidecar/fixtures/valid_module_workspace/lib/puppet/functions/fixture_pup4_badfile.rb
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,10 @@ | ||
require 'a_bad_gem_that_does_not_exist' | ||
|
||
# Example function using the Puppet 4 API in a module | ||
# This should not be loaded | ||
Puppet::Functions.create_function(:fixture_pup4_badfile) do | ||
# @return [Array<String>] | ||
def fixture_pup4_badfile | ||
'fixture_pup4_badfile result' | ||
end | ||
end |
9 changes: 9 additions & 0 deletions
9
...-sidecar/fixtures/valid_module_workspace/lib/puppet/functions/fixture_pup4_badfunction.rb
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,9 @@ | ||
# Example function using the Puppet 4 API in a module | ||
# This should be loaded but never actually successfully invoke | ||
Puppet::Functions.create_function(:fixture_pup4_badfunction) do | ||
# @return [Array<String>] | ||
def fixture_pup4_badfunction | ||
require 'a_bad_gem_that_does_not_exist' | ||
'fixture_pup4_badfunction result' | ||
end | ||
end |
8 changes: 8 additions & 0 deletions
8
...ver-sidecar/fixtures/valid_module_workspace/lib/puppet/functions/fixture_pup4_function.rb
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,8 @@ | ||
# Example function using the Puppet 4 API in a module | ||
# This should be loaded as global namespace function | ||
Puppet::Functions.create_function(:fixture_pup4_function) do | ||
# @return [Array<String>] | ||
def fixture_pup4_function | ||
'fixture_pup4_function result' | ||
end | ||
end |
8 changes: 8 additions & 0 deletions
8
...r/fixtures/valid_module_workspace/lib/puppet/functions/valid/fixture_pup4_mod_function.rb
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,8 @@ | ||
# Example function using the Puppet 4 API in a module | ||
# This should be loaded in the module namespace | ||
Puppet::Functions.create_function(:'valid::fixture_pup4_mod_function') do | ||
# @return [Array<String>] | ||
def fixture_pup4_mod_function | ||
'fixture_pup4_mod_function result' | ||
end | ||
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