kitchen-sharedtests 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6f44bf8f720fd635b7b08bc29b52c51846b99eb9
4
- data.tar.gz: 6ca5c12d1bf4904b1d3847e87f42524ef66620fa
3
+ metadata.gz: ca3adbd039dbd146863b3b3d02df13f5cd094b49
4
+ data.tar.gz: 6bf101c12aba395ab4add8c4f70aeecde33112d0
5
5
  SHA512:
6
- metadata.gz: 995d6b40c37772341a1d6ca02607c2e2acdf7bc660dc9e04be6a1511ca54539e3ce28eb861309865fe6531289ff619a2738b9a1b6518c0aa703a2eb95005e758
7
- data.tar.gz: 5418d1196ab8cf761ec6729d8f93574358be38063150940e55794824222e6dbd75c8dfcbbea8e3a1c8d8e89574b725aa1f325dd4af1e5bd37a5730408d29ec91
6
+ metadata.gz: ff29bd83099e3f230825c941c24489503a2a8d96b47c8192c7cd08c2f2e4f77e8f72dc47bdb6ea9d1a8a25250d938d3281da13704129b8d4106fd670cd9fd6aa
7
+ data.tar.gz: 64f981e9113b7b298d76342e767d344bf1e5e7a8fcd232db352e67399a4e995266af23ef682231faa6c1ba0202457fe4a044e5c670d5a16d1321f32d4abf6eb2
@@ -0,0 +1,11 @@
1
+
2
+ ## 0.2.0
3
+
4
+ - create the test folder if it is missing and clone into a folder named integration [view commit](http://github.com///commit/39308349c6c5d68e0cf07815f5c6ddcf1c86f6f4)
5
+ - prefix commands with sharedtests so that it is clear we are using a different path here [view commit](http://github.com///commit/6f18a5a901b99351eb378c7be3d22ddf57265b3e)
6
+ - shared repo is for integration tests only [view commit](http://github.com///commit/1fb1441ccffe98ab2194fa4a50f362d79f8f0556)
7
+ - update the read me to be more useful and explain things [view commit](http://github.com///commit/d03ae01f4be83469831b441ef53bd2f5958a894e)
8
+
9
+ ## 0.1.0
10
+
11
+ - bump minor as we have a breaking change [view commit](http://github.com///commit/1719bf4e86b16516eacf15b5bc24e3059812251e)
data/README.md CHANGED
@@ -8,7 +8,7 @@ This gem allows you to use an external git repo for your tests. This comes in ha
8
8
 
9
9
  Add this line to your application's Gemfile:
10
10
 
11
- gem 'kitchen-shared-tests'
11
+ gem 'kitchen-sharedtests'
12
12
 
13
13
  And then execute:
14
14
 
@@ -16,7 +16,7 @@ And then execute:
16
16
 
17
17
  Or install it yourself as:
18
18
 
19
- $ gem install kitchen-shared-tests
19
+ $ gem install kitchen-sharedtests
20
20
 
21
21
  ## Usage
22
22
 
@@ -40,6 +40,43 @@ provisioner:
40
40
  test_repo_uri: "https://github.com/ehaselwanter/tests-kitchen-example.git"
41
41
  ```
42
42
 
43
+ Then you can either overwrite your local integration folder or run from a new integration test folder.
44
+
45
+ ```
46
+ thor kitchen:fetch-remote-tests
47
+
48
+ ± kitchen diagnose |grep test_base_path
49
+ test_base_path: /....../puppet-kitchen-example/test/integration
50
+ test_base_path: /....../puppet-kitchen-example/test/integration
51
+ test_base_path: /....../puppet-kitchen-example/test/integration
52
+ ```
53
+
54
+ will clone the in the `provisioner.test_repo_uri` to `test/integration`
55
+
56
+ ```
57
+ thor kitchen:all-sharedtests
58
+ ```
59
+
60
+ and the other `kitchen:*-sharedtests*` tasks will create a folder `./shared_test_repo` and point `test_base_path` to this folder
61
+
62
+ ```
63
+ ± thor kitchen:diagnose-sharedtests-default-ubuntu-1204|grep test_base_path
64
+ !ruby/sym test_base_path: /....../puppet-kitchen-example/shared_test_repo
65
+ !ruby/sym test_base_path: /....../puppet-kitchen-example/shared_test_repo
66
+ !ruby/sym test_base_path: /....../puppet-kitchen-example/shared_test_repo
67
+ ```
68
+
69
+ ```
70
+ ± thor -T
71
+ kitchen
72
+ -------
73
+ thor kitchen:all-sharedtests # Run all test instances
74
+ thor kitchen:diagnose-sharedtests-default-ubuntu-1204 # Diagnose default-ubuntu-1204 test instance
75
+ thor kitchen:fetch-remote-tests # Fetch remote tests from provider.test_repo_uri
76
+ thor kitchen:run-sharedtests-default-ubuntu-1204 # Run run-sharedtests-default-ubuntu-1204 test instance
77
+ thor kitchen:verify-sharedtests-default-ubuntu-1204 # Run default-ubuntu-1204 to verify instance
78
+ ```
79
+
43
80
  ## Contributing
44
81
 
45
82
  1. Fork it ( http://github.com/<my-github-username>/kitchen-shared-tests/fork )
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Kitchen
3
3
  module Sharedtests
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
6
6
  end
@@ -46,37 +46,41 @@ module Kitchen
46
46
 
47
47
  def define
48
48
  config.instances.each do |instance|
49
- self.class.desc instance.name, "Run #{instance.name} test instance"
50
- self.class.send(:define_method, instance.name.gsub(/-/, '_')) do
49
+ command = "run-sharedtests-#{instance.name}"
50
+ self.class.desc command, "Run #{command} test instance"
51
+ self.class.send(:define_method, command.gsub(/-/, '_')) do
51
52
  create_or_update_test_repo(instance.provisioner[:test_repo_uri], Kitchen::Sharedtests::TEST_REPO_NAME, config.kitchen_root)
52
53
  instance.test(:always)
53
54
  end
54
55
  end
55
56
 
56
57
  config.instances.each do |instance|
57
- command = "verify-#{instance.name}"
58
- self.class.desc command, "Run #{command} to verify instance"
58
+ command = "verify-sharedtests-#{instance.name}"
59
+ self.class.desc command, "Run #{instance.name} to verify instance"
59
60
  self.class.send(:define_method, command.gsub(/-/, '_')) do
60
61
  create_or_update_test_repo(instance.provisioner[:test_repo_uri], Kitchen::Sharedtests::TEST_REPO_NAME, config.kitchen_root)
61
62
  instance.verify
62
63
  end
63
64
  end
64
65
 
65
- self.class.desc "all", "Run all test instances"
66
- self.class.send(:define_method, :all) do
66
+ self.class.desc "all-sharedtests", "Run all test instances"
67
+ self.class.send(:define_method, :all_sharedtests) do
67
68
  config.instances.each { |i| invoke i.name.gsub(/-/, '_') }
68
69
  end
69
70
 
70
71
  config.instances.each do |instance|
71
- self.class.desc "diagnose-#{instance.name}", "Diagnose #{instance.name} test instance"
72
- self.class.send(:define_method, "diagnose_#{instance.name.gsub(/-/, '_')}") do
73
- puts instance.diagnose
72
+ command = "diagnose-sharedtests-#{instance.name}"
73
+ self.class.desc command, "Diagnose #{instance.name} test instance"
74
+ self.class.send(:define_method, command.gsub(/-/, '_')) do
75
+ puts instance.diagnose.to_yaml
74
76
  end
75
77
  end
76
78
 
77
79
  self.class.desc "fetch-remote-tests", "Fetch remote tests from provider.test_repo_uri"
78
80
  self.class.send(:define_method, "fetch_remote_tests") do
79
- create_or_update_test_repo(config.instances.first.provisioner[:test_repo_uri], "test", config.kitchen_root)
81
+ test_root = File.join(config.kitchen_root,'test')
82
+ Dir.mkdir(test_root) unless File.directory?(test_root)
83
+ create_or_update_test_repo(config.instances.first.provisioner[:test_repo_uri], "integration", test_root)
80
84
  end
81
85
  end
82
86
 
@@ -4,6 +4,7 @@ module Kitchen
4
4
  module Sharedtests
5
5
  TEST_REPO_NAME = "shared_test_repo"
6
6
  TEST_REPO_BASE_PATH = File.join(Dir.pwd, TEST_REPO_NAME)
7
- TEST_BASE_PATH = File.join(TEST_REPO_BASE_PATH, "/integration")
7
+ # this is the path to the directory containing the integration test suites
8
+ TEST_BASE_PATH = TEST_REPO_BASE_PATH
8
9
  end
9
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-sharedtests
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edmund Haselwanter
@@ -61,6 +61,7 @@ extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
63
  - ".gitignore"
64
+ - Changelog.md
64
65
  - Gemfile
65
66
  - LICENSE.txt
66
67
  - README.md