[DRE-commits] [librarian-puppet] 121/153: Migrate tests to use metadata.json instead of Modulefile

Stig Sandbeck Mathisen ssm at debian.org
Wed Jun 1 20:30:55 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 89cea160ab7043b0da5b93f457b32603139eb69d
Author: Carlos Sanchez <carlos at apache.org>
Date:   Wed May 20 21:10:58 2015 +0200

    Migrate tests to use metadata.json instead of Modulefile
---
 features/install.feature      |  9 ++++---
 features/install/git.feature  | 57 ++++++++++++++++++++++++++-----------------
 features/install/path.feature | 21 ++++++++++++----
 features/outdated.feature     |  2 +-
 features/update.feature       | 41 ++++++++++++++++---------------
 5 files changed, 78 insertions(+), 52 deletions(-)

diff --git a/features/install.feature b/features/install.feature
index b5d7142..97d7d73 100644
--- a/features/install.feature
+++ b/features/install.feature
@@ -21,12 +21,12 @@ Feature: cli/install
     """
     forge "http://forge.puppetlabs.com"
 
-    mod 'puppetlabs/stdlib', :git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git', :ref => '3.0.0'
+    mod 'puppetlabs/stdlib', :git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git', :ref => '4.6.0'
     mod 'librarian/test', :git => 'https://github.com/rodjek/librarian-puppet.git', :path => 'features/examples/test'
     """
     When I run `librarian-puppet install --verbose`
     Then the exit status should be 0
-    And the file "modules/stdlib/Modulefile" should match /version *'3\.0\.0'/
+    And the file "modules/stdlib/metadata.json" should match /"version": "4\.6\.0"/
     And the output should not match /Executing puppet module install for puppetlabs.stdlib/
 
   Scenario: Install duplicated dependencies from git and forge, last one wins
@@ -35,7 +35,7 @@ Feature: cli/install
     forge "http://forge.puppetlabs.com"
 
     metadata
-    mod 'puppetlabs-stdlib', :git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git', :ref => '3.0.0'
+    mod 'puppetlabs-stdlib', :git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git', :ref => '4.6.0'
     """
     And a file named "metadata.json" with:
     """
@@ -51,7 +51,7 @@ Feature: cli/install
     """
     When I run `librarian-puppet install --verbose`
     Then the exit status should be 0
-    And the file "modules/stdlib/Modulefile" should match /version *'3\.0\.0'/
+    And the file "modules/stdlib/metadata.json" should match /"version": "4\.6\.0"/
     And the output should not match /Executing puppet module install for puppetlabs.stdlib/
 
   Scenario: Installing two modules with same name and using exclusions
@@ -78,6 +78,7 @@ Feature: cli/install
     Then the exit status should be 0
     And the file "modules/concat/metadata.json" should match /"name": "puppetlabs-concat"/
 
+  @puppet2 @puppet3
   Scenario: Install a module with Modulefile without version
     Given a file named "Puppetfile" with:
     """
diff --git a/features/install/git.feature b/features/install/git.feature
index 8bc7c74..5037130 100644
--- a/features/install/git.feature
+++ b/features/install/git.feature
@@ -7,29 +7,29 @@ Feature: cli/install/git
     forge "http://forge.puppetlabs.com"
 
     mod 'puppetlabs/apache',
-        :git => 'https://github.com/puppetlabs/puppetlabs-apache.git', :ref => '0.6.0'
+        :git => 'https://github.com/puppetlabs/puppetlabs-apache.git', :ref => '1.4.0'
 
     mod 'puppetlabs/stdlib',
-        :git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git', :ref => 'v2.2.1'
+        :git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git', :ref => '4.6.0'
     """
     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 git revision of module "apache" should be "b18fad908fe7cb8fbc6604fde1962c85540095f4"
-    And the file "modules/stdlib/Modulefile" should match /name *'puppetlabs-stdlib'/
-    And the file "modules/stdlib/Modulefile" should match /version *'2\.2\.1'/
-    And the git revision of module "stdlib" should be "a70b09d5de035de5254ebe6ad6e1519a6d7cf588"
+    And the file "modules/apache/metadata.json" should match /"name": "puppetlabs-apache"/
+    And the file "modules/apache/metadata.json" should match /"version": "1\.4\.0"/
+    And the git revision of module "apache" should be "e4ec6d4985fdb23e26c809e0d5786823d0689f90"
+    And the file "modules/stdlib/metadata.json" should match /"name": "puppetlabs-stdlib"/
+    And the file "modules/stdlib/metadata.json" should match /"version": "4\.6\.0"/
+    And the git revision of module "stdlib" should be "73474b00b5ae3cbccec6cd0711311d6450139e51"
 
   @spaces
   Scenario: Installing a module in a path with spaces
     Given a file named "Puppetfile" with:
     """
-    mod 'puppetlabs/stdlib', '4.1.0', :git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git', :ref => '4.1.0'
+    mod 'puppetlabs/stdlib', '4.6.0', :git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git', :ref => '4.6.0'
     """
     When I run `librarian-puppet install`
     Then the exit status should be 0
-    And the file "modules/stdlib/Modulefile" should match /name *'puppetlabs-stdlib'/
+    And the file "modules/stdlib/metadata.json" should match /"name": "puppetlabs-stdlib"/
 
   Scenario: Installing a module with invalid versions in git
     Given a file named "Puppetfile" with:
@@ -37,37 +37,37 @@ Feature: cli/install/git
     forge "http://forge.puppetlabs.com"
 
     mod "apache",
-      :git => "https://github.com/puppetlabs/puppetlabs-apache.git", :ref => "0.5.0-rc1"
+      :git => "https://github.com/puppetlabs/puppetlabs-apache.git", :ref => "1.4.0"
     """
     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'/
+    And the file "modules/apache/metadata.json" should match /"name": "puppetlabs-apache"/
+    And the file "modules/apache/metadata.json" should match /"version": "1\.4\.0"/
 
   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'
+    mod 'puppetlabs/postgresql', '4.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/postgresql/metadata.json" should match /"name": "puppetlabs-postgresql"/
+    And the file "modules/postgresql/metadata.json" should match /"version": "4\.0\.0"/
     And the file "modules/stdlib/metadata.json" should match /"name": "puppetlabs-stdlib"/
     When I overwrite "Puppetfile" with:
     """
     forge "http://forge.puppetlabs.com"
 
     mod 'puppetlabs/postgresql',
-      :git => 'https://github.com/puppetlabs/puppetlabs-postgresql.git', :ref => '1.0.0'
+      :git => 'https://github.com/puppetlabs/puppetlabs-postgresql.git', :ref => '4.3.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/postgresql/.git/HEAD" should match /183d401a3ffeb2e83372dfcc05f5b6bab25034b1/
+    And the file "modules/postgresql/metadata.json" should match /"name": "puppetlabs-postgresql"/
+    And the file "modules/postgresql/metadata.json" should match /"version": "4\.3\.0"/
+    And the file "modules/postgresql/.git/HEAD" should match /9ca4b42450ea9c9ed8eec52dac48cb67187ae925/
     And the file "modules/stdlib/metadata.json" should match /"name": "puppetlabs-stdlib"/
 
   Scenario: Install a module with dependencies specified in metadata.json
@@ -90,6 +90,7 @@ Feature: cli/install/git
     And the file "modules/with_puppetfile/Modulefile" should match /name *'librarian-with_puppetfile'/
     And the file "modules/test/Modulefile" should match /name *'librarian-test'/
 
+  @puppet2 @puppet3
   Scenario: Install a module with dependencies specified in a Puppetfile and Modulefile
     Given a file named "Puppetfile" with:
     """
@@ -100,12 +101,22 @@ Feature: cli/install/git
     And the file "modules/with_puppetfile/Modulefile" should match /name *'librarian-with_puppetfile_and_modulefile'/
     And the file "modules/test/Modulefile" should match /name *'maestrodev-test'/
 
+  Scenario: Install a module with dependencies specified in a Puppetfile and metadata.json
+    Given a file named "Puppetfile" with:
+    """
+    mod 'librarian/with_puppetfile', :git => 'https://github.com/rodjek/librarian-puppet.git', :path => 'features/examples/with_puppetfile_and_metadata_json'
+    """
+    When I run `librarian-puppet install`
+    Then the exit status should be 0
+    And the file "modules/with_puppetfile/metadata.json" should match /"name": "librarian-with_puppetfile_and_metadata_json"/
+    And the file "modules/test/metadata.json" should match /"name": "maestrodev-test"/
+
   Scenario: Running install with no Modulefile nor metadata.json
     Given a file named "Puppetfile" with:
     """
     forge "http://forge.puppetlabs.com"
 
-    mod 'puppetlabs/stdlib', :git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git', :ref => '3.0.0'
+    mod 'puppetlabs/stdlib', :git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git', :ref => '4.6.0'
     """
     When I run `librarian-puppet install`
     Then the exit status should be 0
@@ -120,6 +131,7 @@ Feature: cli/install/git
     When I run `librarian-puppet install`
     Then the exit status should be 0
 
+  @puppet2 @puppet3
   Scenario: Install a module using modulefile syntax
     Given a file named "Puppetfile" with:
     """
@@ -138,7 +150,7 @@ Feature: cli/install/git
     When I run `librarian-puppet install`
     Then the exit status should be 0
     And the file "modules/metadata_syntax/metadata.json" should match /"name": "librarian-metadata_syntax"/
-    And the file "modules/test/Modulefile" should match /name *'maestrodev-test'/
+    And the file "modules/test/metadata.json" should match /"name": "maestrodev-test"/
 
   Scenario: Install a module from git and using path
     Given a file named "Puppetfile" with:
@@ -164,6 +176,7 @@ Feature: cli/install/git
     And the file "modules/test/Modulefile" should match /version *'0\.0\.1'/
     And a file named "modules/stdlib/metadata.json" should exist
 
+  @puppet2 @puppet3
   Scenario: Install a module with mismatching Puppetfile and Modulefile
     Given a file named "Puppetfile" with:
     """
diff --git a/features/install/path.feature b/features/install/path.feature
index a31de6c..f0b4dda 100644
--- a/features/install/path.feature
+++ b/features/install/path.feature
@@ -8,8 +8,8 @@ Feature: cli/install/path
     """
     When I run `librarian-puppet install`
     Then the exit status should be 0
-    And the file "modules/with_puppetfile/Modulefile" should match /name *'librarian-with_puppetfile'/
-    And the file "modules/test/Modulefile" should match /name *'librarian-test'/
+    And the file "modules/with_puppetfile/metadata.json" should match /"name": "librarian-with_puppetfile"/
+    And the file "modules/test/metadata.json" should match /"name": "librarian-test"/
 
   Scenario: Install a module with recursive path dependencies
     Given a file named "Puppetfile" with:
@@ -19,9 +19,10 @@ Feature: cli/install/path
     When I run `librarian-puppet install`
     Then the exit status should be 0
     And the file "modules/path_dependencies/metadata.json" should match /"name": "librarian-path_dependencies"/
-    And the file "modules/test/Modulefile" should match /name *'librarian-test'/
+    And the file "modules/test/metadata.json" should match /"name": "librarian-test"/
     And a file named "modules/stdlib/metadata.json" should exist
 
+  @puppet2 @puppet3
   Scenario: Install a module with dependencies specified in a Puppetfile and Modulefile
     Given a file named "Puppetfile" with:
     """
@@ -32,6 +33,16 @@ Feature: cli/install/path
     And the file "modules/with_puppetfile/Modulefile" should match /name *'librarian-with_puppetfile_and_modulefile'/
     And the file "modules/test/Modulefile" should match /name *'maestrodev-test'/
 
+  Scenario: Install a module with dependencies specified in a Puppetfile and metadata.json
+    Given a file named "Puppetfile" with:
+    """
+    mod 'librarian/with_puppetfile', :path => '../../features/examples/with_puppetfile_and_metadata_json'
+    """
+    When I run `librarian-puppet install`
+    Then the exit status should be 0
+    And the file "modules/with_puppetfile/metadata.json" should match /"name": "librarian-with_puppetfile_and_metadata_json"/
+    And the file "modules/test/metadata.json" should match /"name": "maestrodev-test"/
+
   Scenario: Install a module from path without version
     Given a file named "Puppetfile" with:
     """
@@ -41,7 +52,7 @@ Feature: cli/install/path
     """
     When I run `librarian-puppet install`
     Then the exit status should be 0
-    And the file "modules/test/Modulefile" should match /version *'0\.0\.1'/
+    And the file "modules/test/metadata.json" should match /"version": "0\.0\.1"/
     And a file named "modules/stdlib/metadata.json" should exist
 
   @spaces
@@ -53,4 +64,4 @@ Feature: cli/install/path
     """
     When I run `librarian-puppet install`
     Then the exit status should be 0
-    And the file "modules/test/Modulefile" should match /name *'librarian-test'/
+    And the file "modules/test/metadata.json" should match /"name": "librarian-test"/
diff --git a/features/outdated.feature b/features/outdated.feature
index 2db9db8..6a9dc8e 100644
--- a/features/outdated.feature
+++ b/features/outdated.feature
@@ -43,7 +43,7 @@ Feature: cli/outdated
       remote: https://github.com/rodjek/librarian-puppet.git
       path: features/examples/test
       ref: master
-      sha: 517beed403cfe3b2b61598975d8cecd27c665add
+      sha: 10fdf98190a7a22e479628b3616f17f48a857e81
       specs:
         test (0.0.1)
           puppetlabs/stdlib (>= 0)
diff --git a/features/update.feature b/features/update.feature
index ef209c0..cd26d82 100644
--- a/features/update.feature
+++ b/features/update.feature
@@ -105,28 +105,29 @@ Feature: cli/update
     """
     forge "http://forge.puppetlabs.com"
 
-    mod "stdlib",
-      :git => "https://github.com/puppetlabs/puppetlabs-stdlib.git", :ref => "3.1.x"
+    mod "puppetlabs-stdlib",
+      :git => "https://github.com/puppetlabs/puppetlabs-stdlib.git", :ref => "3.2.x"
     """
     And a file named "Puppetfile.lock" with:
     """
     GIT
       remote: https://github.com/puppetlabs/puppetlabs-stdlib.git
-      ref: 3.1.x
-      sha: 614b3fbf6c15893e89ed8654fb85596223b5b7c5
+      ref: 3.2.x
+      sha: 326a8fd801ecba11005189c10ca8749872ef6577
       specs:
-        stdlib (3.1.1)
+        puppetlabs-stdlib (3.2.1)
 
     DEPENDENCIES
-      stdlib (>= 0)
+      puppetlabs-stdlib (>= 0)
     """
     When I run `librarian-puppet install`
     Then the exit status should be 0
-    And the git revision of module "stdlib" should be "614b3fbf6c15893e89ed8654fb85596223b5b7c5"
+    And the git revision of module "stdlib" should be "326a8fd801ecba11005189c10ca8749872ef6577"
     When I run `librarian-puppet update`
     Then the exit status should be 0
-    And the git revision of module "stdlib" should be "a3c600d5f277f0c9d91c98ef67daf7efc9eed3c5"
+    And the git revision of module "stdlib" should be "c0b5ce3b015db9f50d486040c16d8de56c6b4991"
 
+  @puppet2 @puppet3
   Scenario: Updating a module with invalid versions in git
     Given a file named "Puppetfile" with:
     """
@@ -245,20 +246,20 @@ Feature: cli/update
     """
     forge "http://forge.puppetlabs.com"
 
-    mod "stdlib",
-      :git => "https://github.com/puppetlabs/puppetlabs-stdlib.git", :ref => "3.1.x"
+    mod "puppetlabs-stdlib",
+      :git => "https://github.com/puppetlabs/puppetlabs-stdlib.git", :ref => "3.2.x"
     """
     And a file named "Puppetfile.lock" with:
     """
     GIT
       remote: https://github.com/puppetlabs/puppetlabs-stdlib.git
-      ref: 3.1.x
-      sha: 614b3fbf6c15893e89ed8654fb85596223b5b7c5
+      ref: 3.2.x
+      sha: 326a8fd801ecba11005189c10ca8749872ef6577
       specs:
-        stdlib (3.1.1)
+        puppetlabs-stdlib (3.2.1)
 
     DEPENDENCIES
-      stdlib (>= 0)
+      puppetlabs-stdlib (>= 0)
     """
     And a file named ".librarian/puppet/config" with:
     """
@@ -270,18 +271,18 @@ Feature: cli/update
     And the output should contain "rsync: true"
     When I run `librarian-puppet install`
     Then the exit status should be 0
-    And the file "Puppetfile.lock" should contain "614b3fbf6c15893e89ed8654fb85596223b5b7c5"
-    And the git revision of module "stdlib" should be "614b3fbf6c15893e89ed8654fb85596223b5b7c5"
+    And the file "Puppetfile.lock" should contain "326a8fd801ecba11005189c10ca8749872ef6577"
+    And the git revision of module "stdlib" should be "326a8fd801ecba11005189c10ca8749872ef6577"
     And a directory named "modules/stdlib" should exist
     When I run `librarian-puppet update --verbose`
     Then the exit status should be 0
     And a directory named "modules/stdlib" should exist
     And the file "modules/stdlib" should have an inode and ctime
-    And the file "Puppetfile.lock" should contain "a3c600d5f277f0c9d91c98ef67daf7efc9eed3c5"
-    And the git revision of module "stdlib" should be "a3c600d5f277f0c9d91c98ef67daf7efc9eed3c5"
+    And the file "Puppetfile.lock" should contain "c0b5ce3b015db9f50d486040c16d8de56c6b4991"
+    And the git revision of module "stdlib" should be "c0b5ce3b015db9f50d486040c16d8de56c6b4991"
     When I run `librarian-puppet update --verbose`
     Then the exit status should be 0
     And a directory named "modules/stdlib" should exist
     And the file "modules/stdlib" should have the same inode and ctime as before
-    And the file "Puppetfile.lock" should contain "a3c600d5f277f0c9d91c98ef67daf7efc9eed3c5"
-    And the git revision of module "stdlib" should be "a3c600d5f277f0c9d91c98ef67daf7efc9eed3c5"
+    And the file "Puppetfile.lock" should contain "c0b5ce3b015db9f50d486040c16d8de56c6b4991"
+    And the git revision of module "stdlib" should be "c0b5ce3b015db9f50d486040c16d8de56c6b4991"

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