bake-test-external 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/bake/test/external.rb +21 -13
- data/lib/bake/test/external/version.rb +5 -20
- data/license.md +22 -0
- data/readme.md +31 -0
- data.tar.gz.sig +0 -0
- metadata +5 -2
- metadata.gz.sig +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3072f589cb8fd6a99e2e45f3791eb8ff6a73cb215251e4e63171de62650cb24b
|
4
|
+
data.tar.gz: 2a80ff09debdafc85114adf98502f132b429576a4cad85de1eeb3d49df9447a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b9ab0dea33134723ae45dbf0d30d796033a0372554668d2605c715aab622cd82f00f086ea8be3d559da858e422a7a8db41d53930b779f864272b1eb53160ebd
|
7
|
+
data.tar.gz: b99804ca0aa5163d3e12110caba045667e73fe30f7466c25e293cba607305be2d259e563087307fa7be3a203e32e4e3766f6a1253c8770e8b646376ee1ddf109
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/bake/test/external.rb
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2022, by Samuel Williams.
|
5
|
+
# Copyright, 2022, by Akshay Birajdar.
|
6
|
+
|
3
7
|
DEFAULT_EXTERNALS_PATH = 'config/external.yaml'
|
4
8
|
DEFAULT_COMMAND = "bake test"
|
5
9
|
|
@@ -8,20 +12,17 @@ DEFAULT_COMMAND = "bake test"
|
|
8
12
|
def external(input: nil, gemspec: self.find_gemspec)
|
9
13
|
require 'bundler'
|
10
14
|
require 'yaml'
|
11
|
-
|
15
|
+
|
12
16
|
if input.nil? and File.exist?(DEFAULT_EXTERNALS_PATH)
|
13
17
|
# symbolize_names is unsupported on Ruby 2.7
|
14
18
|
input = YAML.load_file(DEFAULT_EXTERNALS_PATH) # , symbolize_names: true)
|
15
19
|
end
|
16
|
-
|
17
|
-
input
|
18
|
-
config.transform_keys
|
19
|
-
|
20
|
-
url = config[:url]
|
21
|
-
command = config.fetch(:command, DEFAULT_COMMAND)
|
22
|
-
|
20
|
+
|
21
|
+
input&.each do |key, config|
|
22
|
+
config = config.transform_keys(&:to_sym)
|
23
|
+
|
23
24
|
Bundler.with_unbundled_env do
|
24
|
-
clone_and_test(gemspec.name, key,
|
25
|
+
clone_and_test(gemspec.name, key, config)
|
25
26
|
end
|
26
27
|
end
|
27
28
|
end
|
@@ -40,15 +41,18 @@ def find_gemspec(glob = "*.gemspec")
|
|
40
41
|
end
|
41
42
|
end
|
42
43
|
|
43
|
-
def clone_and_test(name, key,
|
44
|
+
def clone_and_test(name, key, config)
|
44
45
|
require 'fileutils'
|
45
46
|
|
47
|
+
url = config[:url]
|
48
|
+
command = config.fetch(:command, DEFAULT_COMMAND)
|
49
|
+
|
46
50
|
path = "external/#{key}"
|
47
51
|
|
48
52
|
unless File.directory?(path)
|
49
53
|
FileUtils.mkdir_p path
|
50
54
|
system("git", "clone", "--depth", "1", url, path)
|
51
|
-
|
55
|
+
|
52
56
|
# I tried using `bundle config --local local.async ../` but it simply doesn't work.
|
53
57
|
# system("bundle", "config", "--local", "local.async", __dir__, chdir: path)
|
54
58
|
|
@@ -58,10 +62,14 @@ def clone_and_test(name, key, url, command)
|
|
58
62
|
File.open(gemfile_path, "a") do |file|
|
59
63
|
file.puts nil, "# Added by external testing:"
|
60
64
|
file.puts("gem #{name.to_s.dump}, path: '../../'")
|
65
|
+
|
66
|
+
config[:extra]&.each do |line|
|
67
|
+
file.puts(line)
|
68
|
+
end
|
61
69
|
end
|
62
|
-
|
70
|
+
|
63
71
|
system("bundle", "install", chdir: path)
|
64
72
|
end
|
65
|
-
|
73
|
+
|
66
74
|
system(*command, chdir: path) or abort("External tests #{key} failed!")
|
67
75
|
end
|
@@ -1,27 +1,12 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
8
|
-
# furnished to do so, subject to the following conditions:
|
9
|
-
#
|
10
|
-
# The above copyright notice and this permission notice shall be included in
|
11
|
-
# all copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
-
# THE SOFTWARE.
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2022, by Samuel Williams.
|
20
5
|
|
21
6
|
module Bake
|
22
7
|
module Test
|
23
8
|
module External
|
24
|
-
VERSION = "0.
|
9
|
+
VERSION = "0.2.0"
|
25
10
|
end
|
26
11
|
end
|
27
12
|
end
|
data/license.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# MIT License
|
2
|
+
|
3
|
+
Copyright, 2022, by Samuel Williams.
|
4
|
+
Copyright, 2022, by Akshay Birajdar.
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
8
|
+
in the Software without restriction, including without limitation the rights
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
11
|
+
furnished to do so, subject to the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
14
|
+
copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
SOFTWARE.
|
data/readme.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Bake Test External
|
2
|
+
|
3
|
+
A gem for executing external (downstream) tests.
|
4
|
+
|
5
|
+
[![Development Status](https://github.com/ioquatix/bake-test-external/workflows/Test/badge.svg)](https://github.com/ioquatix/bake-test-external/actions?workflow=Test)
|
6
|
+
|
7
|
+
## Usage
|
8
|
+
|
9
|
+
Add a file `config/external.yaml` to your project, and add entries like:
|
10
|
+
|
11
|
+
``` yaml
|
12
|
+
bake:
|
13
|
+
url: https://github.com/ioquatix/bake.git
|
14
|
+
command: bundle exec rspec
|
15
|
+
```
|
16
|
+
|
17
|
+
``` bash
|
18
|
+
$ bake test:external
|
19
|
+
```
|
20
|
+
|
21
|
+
It will clone the listed repositories, inject your current gem into the fetched gemfile, and run the given command. This has the effect of running their test suite with your latest code. You can use this as part of your test suite to receive feedback that a downstream dependent codebase is okay or broken because of a change you've made.
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
We welcome contributions to this project.
|
26
|
+
|
27
|
+
1. Fork it.
|
28
|
+
2. Create your feature branch (`git checkout -b my-new-feature`).
|
29
|
+
3. Commit your changes (`git commit -am 'Add some feature'`).
|
30
|
+
4. Push to the branch (`git push origin my-new-feature`).
|
31
|
+
5. Create new Pull Request.
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bake-test-external
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
|
+
- Akshay Birajdar
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain:
|
@@ -37,7 +38,7 @@ cert_chain:
|
|
37
38
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
38
39
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
39
40
|
-----END CERTIFICATE-----
|
40
|
-
date: 2022-08-
|
41
|
+
date: 2022-08-28 00:00:00.000000000 Z
|
41
42
|
dependencies:
|
42
43
|
- !ruby/object:Gem::Dependency
|
43
44
|
name: bake
|
@@ -75,6 +76,8 @@ extra_rdoc_files: []
|
|
75
76
|
files:
|
76
77
|
- bake/test/external.rb
|
77
78
|
- lib/bake/test/external/version.rb
|
79
|
+
- license.md
|
80
|
+
- readme.md
|
78
81
|
homepage: https://github.com/ioquatix/bake-test-external
|
79
82
|
licenses:
|
80
83
|
- MIT
|
metadata.gz.sig
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
8�v�f
|
2
|
+
K�$�(��cVK�����<�]V�/l�C��H�!g���\�EIJ4&3�h��B15��䕻��~\OQ���g
|
3
|
+
��.&��ȑ�-e�����
|
4
|
+
�P�s��7S�X�s9���*C+]����Y��m�sSc����`��I�܀�@�f�������n�w�t/?U�6H��g�
|
5
|
+
f����r�55��J�W G�\53��U��kƝ��b��^��,��**%����������;r�MX�qҗ�پh���fe��aHE4n�*�����\�PZ�;i�%�dl�.c��D3Ip��߂K�2Ү~�l�3���ШYBj�Q*
|
6
|
+
�-f����M��[�25'q��4��\��O q�䍍���b���
|