[DRE-commits] [librarian-puppet] 95/153: Add tests for new exclusion syntax in librarian
Stig Sandbeck Mathisen
ssm at debian.org
Wed Jun 1 20:30:49 UTC 2016
This is an automated email from the git hooks/post-receive script.
ssm pushed a commit to branch master
in repository librarian-puppet.
commit 1f3903e635d3041198e09b2b4922c12a660baa85
Author: Carlos Sanchez <carlos at apache.org>
Date: Thu Feb 26 21:03:30 2015 +0100
Add tests for new exclusion syntax in librarian
---
README.md | 6 ++++++
.../examples/duplicated_dependencies/Puppetfile | 3 +++
.../duplicated_dependencies/manifests/init.pp | 1 +
.../examples/duplicated_dependencies/metadata.json | 15 ++++++++++++++
.../duplicated_dependencies_transitive/Puppetfile | 5 +++++
.../manifests/init.pp | 1 +
.../metadata.json | 6 ++++++
features/install.feature | 24 ++++++++++++++++++++++
librarian-puppet.gemspec | 2 +-
9 files changed, 62 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index aea0b9c..23e7c0e 100644
--- a/README.md
+++ b/README.md
@@ -72,6 +72,8 @@ as if the Puppetfile contained
mod 'acme-mymodule', :path => './some_folder'
+ exclusion 'acme-bad_module'
+
### Recursive module dependency resolution
@@ -148,6 +150,10 @@ to be downloaded from GitHub tarball.
Our puppet infrastructure repository depends on the `acme-mymodule` module,
which is already in the filesystem.
+ exclusion 'acme-bad_module'
+
+Exclude the module `acme-bad_module` from resolution and installation.
+
## How to Use
Install librarian-puppet:
diff --git a/features/examples/duplicated_dependencies/Puppetfile b/features/examples/duplicated_dependencies/Puppetfile
new file mode 100644
index 0000000..2303f7e
--- /dev/null
+++ b/features/examples/duplicated_dependencies/Puppetfile
@@ -0,0 +1,3 @@
+forge 'http://forge.puppetlabs.com'
+
+metadata
diff --git a/features/examples/duplicated_dependencies/manifests/init.pp b/features/examples/duplicated_dependencies/manifests/init.pp
new file mode 100644
index 0000000..e2be432
--- /dev/null
+++ b/features/examples/duplicated_dependencies/manifests/init.pp
@@ -0,0 +1 @@
+class test {}
diff --git a/features/examples/duplicated_dependencies/metadata.json b/features/examples/duplicated_dependencies/metadata.json
new file mode 100644
index 0000000..e60e3da
--- /dev/null
+++ b/features/examples/duplicated_dependencies/metadata.json
@@ -0,0 +1,15 @@
+{
+ "name": "librarian-duplicated_dependencies",
+ "version": "0.0.1",
+ "license": "Apache 2.0",
+ "dependencies": [
+ {
+ "name": "ripienaar-concat",
+ "version_requirement": ">= 0"
+ },
+ {
+ "name": "puppetlabs-concat",
+ "version_requirement": "1.2.0"
+ }
+ ]
+}
diff --git a/features/examples/duplicated_dependencies_transitive/Puppetfile b/features/examples/duplicated_dependencies_transitive/Puppetfile
new file mode 100644
index 0000000..24a51ab
--- /dev/null
+++ b/features/examples/duplicated_dependencies_transitive/Puppetfile
@@ -0,0 +1,5 @@
+forge 'http://forge.puppetlabs.com'
+
+metadata
+
+mod 'librarian-duplicated_dependencies', :git => 'https://github.com/rodjek/librarian-puppet.git', :path => 'features/examples/duplicated_dependencies'
diff --git a/features/examples/duplicated_dependencies_transitive/manifests/init.pp b/features/examples/duplicated_dependencies_transitive/manifests/init.pp
new file mode 100644
index 0000000..e2be432
--- /dev/null
+++ b/features/examples/duplicated_dependencies_transitive/manifests/init.pp
@@ -0,0 +1 @@
+class test {}
diff --git a/features/examples/duplicated_dependencies_transitive/metadata.json b/features/examples/duplicated_dependencies_transitive/metadata.json
new file mode 100644
index 0000000..b0e0293
--- /dev/null
+++ b/features/examples/duplicated_dependencies_transitive/metadata.json
@@ -0,0 +1,6 @@
+{
+ "name": "librarian-duplicated_dependencies_transitive",
+ "version": "0.0.1",
+ "license": "Apache 2.0",
+ "dependencies": []
+}
diff --git a/features/install.feature b/features/install.feature
index fced039..f7a70d6 100644
--- a/features/install.feature
+++ b/features/install.feature
@@ -30,6 +30,30 @@ Feature: cli/install
And the output should not contain "Executing puppet module install for puppetlabs/stdlib"
And the output should not contain "Executing puppet module install for puppetlabs-stdlib"
+ Scenario: Installing two modules with same name and using exclusions
+ Given a file named "Puppetfile" with:
+ """
+ forge "https://forgeapi.puppetlabs.com"
+
+ mod 'librarian-duplicated_dependencies', :path => '../../features/examples/duplicated_dependencies'
+ exclusion 'ripienaar-concat'
+ """
+ When I run `librarian-puppet install --verbose`
+ Then the exit status should be 0
+ And the file "modules/concat/metadata.json" should match /"name": "puppetlabs-concat"/
+ And the output should contain "Excluding dependency ripienaar-concat from"
+
+ Scenario: Installing two modules with same name and using exclusions, apply transitively
+ Given a file named "Puppetfile" with:
+ """
+ forge "https://forgeapi.puppetlabs.com"
+
+ mod 'librarian-duplicated_dependencies_transitive', :path => '../../features/examples/duplicated_dependencies_transitive'
+ """
+ When PENDING I run `librarian-puppet install --verbose`
+ Then the exit status should be 0
+ And the file "modules/concat/metadata.json" should match /"name": "puppetlabs-concat"/
+
Scenario: Install a module with Modulefile without version
Given a file named "Puppetfile" with:
"""
diff --git a/librarian-puppet.gemspec b/librarian-puppet.gemspec
index 41d1b7d..3d3adee 100644
--- a/librarian-puppet.gemspec
+++ b/librarian-puppet.gemspec
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
s.executables = ['librarian-puppet']
- s.add_dependency "librarianp", ">=0.4.0"
+ s.add_dependency "librarianp", ">=0.5.0"
s.add_dependency "rsync"
s.add_dependency "puppet_forge"
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/librarian-puppet.git
More information about the Pkg-ruby-extras-commits
mailing list