[DRE-commits] [librarian-puppet] 18/97: Issue #146 Add features from maestrodev fork

Stig Sandbeck Mathisen ssm at debian.org
Tue Mar 11 12:12:47 UTC 2014


This is an automated email from the git hooks/post-receive script.

ssm pushed a commit to branch master
in repository librarian-puppet.

commit 024ab7f4dec38a4c551e1c55f1122432e85dc379
Author: Carlos Sanchez <csanchez at maestrodev.com>
Date:   Wed Nov 27 11:18:07 2013 +0100

    Issue #146 Add features from maestrodev fork
    
    Set as pending those that don't yet pass
---
 features/install.feature | 129 +++++++++++++++++++++++++++++++++++++++++++++++
 features/support/env.rb  |  20 ++++++--
 features/update.feature  | 107 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 252 insertions(+), 4 deletions(-)

diff --git a/features/install.feature b/features/install.feature
index a261355..b576579 100644
--- a/features/install.feature
+++ b/features/install.feature
@@ -2,6 +2,7 @@ Feature: cli/install
   In order to be worth anything
   Puppet librarian needs to install modules properly
 
+  @veryslow
   Scenario: Installing a module and its dependencies
     Given a file named "Puppetfile" with:
     """
@@ -14,6 +15,7 @@ Feature: cli/install
     And the file "modules/apt/Modulefile" should match /name *'puppetlabs-apt'/
     And the file "modules/stdlib/Modulefile" should match /name *'puppetlabs-stdlib'/
 
+  @veryveryslow
   Scenario: Installing an exact version of a module
     Given a file named "Puppetfile" with:
     """
@@ -27,6 +29,96 @@ Feature: cli/install
     And the file "modules/apt/Modulefile" should match /version *'0\.0\.4'/
     And the file "modules/stdlib/Modulefile" should match /name *'puppetlabs-stdlib'/
 
+  @veryslow
+  Scenario: Installing a module with invalid versions in the forge
+    Given a file named "Puppetfile" with:
+    """
+    forge "http://forge.puppetlabs.com"
+
+    mod 'puppetlabs/apache', '0.4.0'
+    mod 'puppetlabs/postgresql', '2.0.1'
+    """
+    When I run `librarian-puppet install`
+    Then the exit status should be 0
+    And the file "modules/apache/Modulefile" should match /name *'puppetlabs-apache'/
+    And the file "modules/apache/Modulefile" should match /version *'0\.4\.0'/
+    And the file "modules/postgresql/Modulefile" should match /name *'puppetlabs-postgresql'/
+    And the file "modules/postgresql/Modulefile" should match /version *'2\.0\.1'/
+
+  @veryslow
+  Scenario: Installing a module from git 
+    Given a file named "Puppetfile" with:
+    """
+    forge "http://forge.puppetlabs.com"
+
+    mod 'puppetlabs/apache',
+        :git => 'https://github.com/puppetlabs/puppetlabs-apache.git', :ref => '0.6.0'
+
+    mod 'puppetlabs/stdlib',
+        :git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git', :ref => 'v2.2.1'
+    """
+    When I run `librarian-puppet install`
+    Then the exit status should be 0
+    And the file "modules/apache/Modulefile" should match /name *'puppetlabs-apache'/
+    And the file "modules/apache/Modulefile" should match /version *'0\.6\.0'/
+    And the file "modules/stdlib/Modulefile" should match /name *'puppetlabs-stdlib'/
+    And the file "modules/stdlib/Modulefile" should match /version *'2\.2\.1'/
+
+  @slow
+  Scenario: Installing a module with invalid versions in git
+    Given a file named "Puppetfile" with:
+    """
+    forge "http://forge.puppetlabs.com"
+
+    mod "apache",
+      :git => "https://github.com/puppetlabs/puppetlabs-apache.git", :ref => "0.5.0-rc1"
+    """
+    When I run `librarian-puppet install`
+    Then the exit status should be 0
+    And the file "modules/apache/Modulefile" should match /name *'puppetlabs-apache'/
+    And the file "modules/apache/Modulefile" should match /version *'0\.5\.0-rc1'/
+
+  @slow
+  Scenario: Installing a module with several constraints
+    Given a file named "Puppetfile" with:
+    """
+    forge "http://forge.puppetlabs.com"
+
+    mod 'puppetlabs/apt', '>=1.0.0', '<1.0.1'
+    """
+    When I run `librarian-puppet install`
+    Then the exit status should be 0
+    And the file "modules/apt/Modulefile" should match /name *'puppetlabs-apt'/
+    And the file "modules/apt/Modulefile" should match /version *'1\.0\.0'/
+    And the file "modules/stdlib/Modulefile" should match /name *'puppetlabs-stdlib'/
+
+  @veryslow
+  Scenario: Switching a module from forge to git
+    Given a file named "Puppetfile" with:
+    """
+    forge "http://forge.puppetlabs.com"
+
+    mod 'puppetlabs/postgresql', '1.0.0'
+    """
+    When I run `librarian-puppet install`
+    Then the exit status should be 0
+    And the file "modules/postgresql/Modulefile" should match /name *'puppetlabs-postgresql'/
+    And the file "modules/postgresql/Modulefile" should match /version *'1\.0\.0'/
+    And the file "modules/stdlib/Modulefile" should match /name *'puppetlabs-stdlib'/
+    When I overwrite "Puppetfile" with:
+    """
+    forge "http://forge.puppetlabs.com"
+
+    mod 'puppetlabs/postgresql',
+      :git => 'https://github.com/puppetlabs/puppet-postgresql.git', :ref => '1.0.0'
+    """
+    And I run `librarian-puppet install`
+    Then the exit status should be 0
+    And the file "modules/postgresql/Modulefile" should match /name *'puppetlabs-postgresql'/
+    And the file "modules/postgresql/Modulefile" should match /version *'1\.0\.0'/
+    And the file "modules/stdlib/Modulefile" should match /name *'puppetlabs-stdlib'/
+
+  @slow
   Scenario: Changing the path
     Given a directory named "puppet"
     And a file named "Puppetfile" with:
@@ -42,6 +134,7 @@ Feature: cli/install
     And the file "puppet/modules/apt/Modulefile" should match /name *'puppetlabs-apt'/
     And the file "puppet/modules/stdlib/Modulefile" should match /name *'puppetlabs-stdlib'/
 
+  @veryslow
   Scenario: Handle range version numbers
     Given a file named "Puppetfile" with:
     """
@@ -62,3 +155,39 @@ Feature: cli/install
     When I run `librarian-puppet install`
     Then the exit status should be 0
     And the file "modules/postgresql/Modulefile" should match /name *'puppetlabs-postgresql'/
+
+  Scenario: Installing a module that does not exist
+    Given a file named "Puppetfile" with:
+    """
+    forge "http://forge.puppetlabs.com"
+
+    mod 'puppetlabs/xxxxx'
+    """
+    When I run `librarian-puppet install`
+    Then the exit status should be 1
+    And the output should contain "Unable to find module 'puppetlabs/xxxxx' on http://forge.puppetlabs.com"
+
+  @pending
+  Scenario: Install a module with dependencies specified in a Puppetfile
+    Given PENDING a file named "Puppetfile" with:
+    """
+    mod 'super', :git => 'git://github.com/mpalmer/puppet-super'
+    
+    """
+    When I run `librarian-puppet install`
+    Then the exit status should be 0
+    And the file "modules/super/Puppetfile" should match /mod *'sub'/
+    And the file "Puppetfile.lock" should match /remote: git:..github\.com.mpalmer.puppet-sub/
+
+  @pending
+  Scenario: Install a module with conflicts
+    Given PENDING a file named "Puppetfile" with:
+    """
+    forge "http://forge.puppetlabs.com"
+
+    mod 'puppetlabs/apache', '0.6.0'
+    mod 'puppetlabs/stdlib', '<2.2.1'
+    """
+    When I run `librarian-puppet install`
+    Then the exit status should be 1
+    And the output should contain "Could not resolve the dependencies"
diff --git a/features/support/env.rb b/features/support/env.rb
index 49ab028..3739c0e 100644
--- a/features/support/env.rb
+++ b/features/support/env.rb
@@ -1,9 +1,21 @@
 require 'aruba/cucumber'
 
 Before do
-  slow_boot = true
-  slow_boot ||= RUBY_PLATFORM == "java"
-  slow_boot ||= defined?(::Rubinius)
+  @aruba_timeout_seconds = 15
+end
+
+Before('@slow') do
+  @aruba_timeout_seconds = 25
+end
+
+Before('@veryslow') do
+  @aruba_timeout_seconds = 50
+end
+
+Before('@veryveryslow') do
+  @aruba_timeout_seconds = 90
+end
 
-  @aruba_timeout_seconds = slow_boot ? 90 : 60
+Given /^PENDING/ do |x|
+  pending
 end
diff --git a/features/update.feature b/features/update.feature
new file mode 100644
index 0000000..339dee5
--- /dev/null
+++ b/features/update.feature
@@ -0,0 +1,107 @@
+Feature: cli/update
+  Puppet librarian needs to update modules properly
+
+  @pending
+  Scenario: Updating a module
+    Given PENDING a file named "Puppetfile" with:
+    """
+    forge "http://forge.puppetlabs.com"
+
+    mod 'puppetlabs/stdlib', '3.1.x'
+    """
+    And a file named "Puppetfile.lock" with:
+    """
+    FORGE
+      remote: http://forge.puppetlabs.com
+      specs:
+        puppetlabs/stdlib (3.1.0)
+
+    DEPENDENCIES
+      puppetlabs/stdlib (~> 3.0)
+    """
+    When I run `librarian-puppet update puppetlabs/stdlib`
+    Then the exit status should be 0
+    And the file "Puppetfile.lock" should match /puppetlabs.stdlib \(3\.1\.1\)/
+    And the file "modules/stdlib/Modulefile" should match /name *'puppetlabs-stdlib'/
+    And the file "modules/stdlib/Modulefile" should match /version *'3\.1\.1'/
+
+  @slow
+  Scenario: Updating a module with invalid versions in git
+    Given a file named "Puppetfile" with:
+    """
+    forge "http://forge.puppetlabs.com"
+
+    mod "apache",
+      :git => "https://github.com/puppetlabs/puppetlabs-apache.git", :ref => "0.5.0-rc1"
+    """
+    And a file named "Puppetfile.lock" with:
+    """
+    FORGE
+      remote: http://forge.puppetlabs.com
+      specs:
+        puppetlabs/firewall (0.0.4)
+        puppetlabs/stdlib (3.2.0)
+
+    GIT
+      remote: https://github.com/puppetlabs/puppetlabs-apache.git
+      ref: 0.5.0-rc1
+      sha: 94ebca3aaaf2144a7b9ce7ca6a13837ec48a7e2a
+      specs:
+        apache ()
+          puppetlabs/firewall (>= 0.0.4)
+          puppetlabs/stdlib (>= 2.2.1)
+
+    DEPENDENCIES
+      apache (>= 0)
+    """
+    When I run `librarian-puppet update apache`
+    Then the exit status should be 0
+    And the file "Puppetfile.lock" should match /sha: d81999533af54a6fe510575d3b143308184a5005/
+    And the file "modules/apache/Modulefile" should match /name *'puppetlabs-apache'/
+    And the file "modules/apache/Modulefile" should match /version *'0\.5\.0-rc1'/
+
+  @pending
+  Scenario: Updating a module that is not in the Puppetfile
+    Given PENDING a file named "Puppetfile" with:
+    """
+    forge "http://forge.puppetlabs.com"
+
+    mod 'puppetlabs/stdlib', '3.1.x'
+    """
+    And a file named "Puppetfile.lock" with:
+    """
+    FORGE
+      remote: http://forge.puppetlabs.com
+      specs:
+        puppetlabs/stdlib (3.1.0)
+
+    DEPENDENCIES
+      puppetlabs/stdlib (~> 3.0)
+    """
+    When I run `librarian-puppet update stdlib`
+    Then the exit status should be 1
+    And the output should contain "Unable to find module stdlib"
+
+  @pending
+  Scenario: Updating a module to a .10 release to ensure versions are correctly ordered
+    Given PENDING a file named "Puppetfile" with:
+    """
+    forge "http://forge.puppetlabs.com"
+
+    mod 'maestrodev/test'
+    """
+    And a file named "Puppetfile.lock" with:
+    """
+    FORGE
+      remote: http://forge.puppetlabs.com
+      specs:
+        maestrodev/test (1.0.2)
+
+    DEPENDENCIES
+      maestrodev/test (>= 0)
+    """
+    When I run `librarian-puppet update --verbose`
+    Then the exit status should be 0
+    And the file "Puppetfile.lock" should match /maestrodev.test \(1\.0\.[1-9][0-9]\)/
+    And the file "modules/test/Modulefile" should contain "name 'maestrodev-test'"
+    And the file "modules/test/Modulefile" should match /version '1\.0\.[1-9][0-9]'/

-- 
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