manageiq-cross_repo 1.2.1 → 2.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
  SHA256:
3
- metadata.gz: 8b41a33500bc19d1787fc628f2b36526425dafe94b8176376205b3d77e6b8c56
4
- data.tar.gz: fcb915b5746293c0f0969cda70116337a5b27795ec94673fe123dfb3357460d4
3
+ metadata.gz: a6ab5c65ef2a6fd67148e518d9b46155f53e76efa5438f07fc7a59699380088f
4
+ data.tar.gz: 12d54a2c5a55f818a9d63a4cacc20c55a6c9c64848f41d8d8d3ea100f08808f0
5
5
  SHA512:
6
- metadata.gz: f99033869bee7e81ccf5a3fa68ad5c0cbe4d775e50372cccdb79474a92385c9ea258be6754015ef1ca3deb2c4db2dfcd400115e3b571db1dfb956d0f61a84f66
7
- data.tar.gz: '082df5577e2c09309900e1782f621c05764b8de1d25b22b63a41eecfe4d71d040cc1290d5abe241d6093547419be14f09d762587dda8d3b6ac759ed6a43ef05e'
6
+ metadata.gz: 0bf529b534de116f2eed3b516ba4cfc6598913d9a31df1ff114ee64d749b5bfd6369a42d15810eed9c204d9ec6b0ca6667477ceaa29fe47690a2e815656bedb8
7
+ data.tar.gz: 63d8108addd7a4b06cc51844f52ef76014785b3cc69ec0feec2f7aec49edccdccaec727f6afb69be845029bb01c72db7dd83a0043c06b2b2297ddaf97aec9b41
@@ -0,0 +1,26 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ schedule:
7
+ - cron: '0 0 * * 0'
8
+
9
+ jobs:
10
+ ci:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ ruby-version:
15
+ - '2.5'
16
+ - '2.6'
17
+ - '2.7'
18
+ steps:
19
+ - uses: actions/checkout@v2
20
+ - name: Set up Ruby
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: ${{ matrix.ruby-version }}
24
+ bundler-cache: true
25
+ - name: Run tests
26
+ run: bundle exec rake
@@ -0,0 +1,52 @@
1
+ name: ManageIQ Cross Repo Workflow
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ test-repos:
7
+ required: true
8
+ type: string
9
+ repos:
10
+ required: true
11
+ type: string
12
+ test-suite:
13
+ required: false
14
+ type: string
15
+
16
+ jobs:
17
+ ci:
18
+ runs-on: ubuntu-latest
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ test-repo: ${{ fromJson(inputs.test-repos) }}
23
+ services:
24
+ postgres:
25
+ image: manageiq/postgresql:10
26
+ env:
27
+ POSTGRESQL_USER: root
28
+ POSTGRESQL_PASSWORD: smartvm
29
+ POSTGRESQL_DATABASE: vmdb_test
30
+ options: --health-cmd pg_isready --health-interval 2s --health-timeout 5s --health-retries 5
31
+ ports:
32
+ - 5432:5432
33
+ env:
34
+ TEST_SUITE: ${{ inputs.test-suite }}
35
+ REPOS: ${{ inputs.repos }}
36
+ TEST_REPO: ${{ matrix.test-repo }}
37
+ PGHOST: localhost
38
+ PGPASSWORD: smartvm
39
+ steps:
40
+ - uses: actions/checkout@v2
41
+ - name: Set up Ruby
42
+ uses: ruby/setup-ruby@v1
43
+ with:
44
+ ruby-version: 2.7
45
+ bundler-cache: true
46
+ - name: Set up Node
47
+ uses: actions/setup-node@v2
48
+ with:
49
+ node-version: 12
50
+ registry-url: https://npm.manageiq.org/
51
+ - name: Run tests
52
+ run: bundle exec manageiq-cross_repo
data/.whitesource ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "settingsInheritedFrom": "ManageIQ/whitesource-config@master"
3
+ }
data/CHANGELOG.md CHANGED
@@ -4,6 +4,16 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [2.1.0] - 2022-02-21
8
+ ### Changed
9
+ - Update nodejs version to v16 (#79)
10
+
11
+ ## [2.0.0] - 2022-02-08
12
+ ### Changed
13
+ - Announce the cross repo run information (#81)
14
+ - Use Github Actions for CI (#82)
15
+ - Replace Travis with Github Actions (#83)
16
+
7
17
  ## [1.2.1] - 2022-01-11
8
18
  ### Fixed
9
19
  - Fix unpacking the hash for ruby 3 support
@@ -46,13 +56,15 @@ This project adheres to [Semantic Versioning](http://semver.org/).
46
56
  - Fix an issue extracting tgz files smaller than 10Kb
47
57
  - Fix an issue overriding gems whose repo name doesn't match
48
58
 
49
- [Unreleased]: https://github.com/ManageIQ/more_core_extensions/compare/v1.2.1...HEAD
50
- [1.2.1]: https://github.com/ManageIQ/more_core_extensions/compare/v1.2.0...v1.2.1
51
- [1.2.0]: https://github.com/ManageIQ/more_core_extensions/compare/v1.1.3...v1.2.0
52
- [1.1.3]: https://github.com/ManageIQ/more_core_extensions/compare/v1.1.2...v1.1.3
53
- [1.1.2]: https://github.com/ManageIQ/more_core_extensions/compare/v1.1.1...v1.1.2
54
- [1.1.1]: https://github.com/ManageIQ/more_core_extensions/compare/v1.1.0...v1.1.1
55
- [1.1.0]: https://github.com/ManageIQ/more_core_extensions/compare/v1.0.4...v1.1.0
56
- [1.0.4]: https://github.com/ManageIQ/more_core_extensions/compare/v1.0.3...v1.0.4
57
- [1.0.3]: https://github.com/ManageIQ/more_core_extensions/compare/v1.0.2...v1.0.3
58
- [1.0.2]: https://github.com/ManageIQ/more_core_extensions/compare/v1.0.1...v1.0.2
59
+ [Unreleased]: https://github.com/ManageIQ/manageiq-cross_repo/compare/v2.1.0...HEAD
60
+ [2.1.0]: https://github.com/ManageIQ/manageiq-cross_repo/compare/v2.1.0..v2.0.0
61
+ [2.0.0]: https://github.com/ManageIQ/manageiq-cross_repo/compare/v2.0.0...v1.2.1
62
+ [1.2.1]: https://github.com/ManageIQ/manageiq-cross_repo/compare/v1.2.0...v1.2.1
63
+ [1.2.0]: https://github.com/ManageIQ/manageiq-cross_repo/compare/v1.1.3...v1.2.0
64
+ [1.1.3]: https://github.com/ManageIQ/manageiq-cross_repo/compare/v1.1.2...v1.1.3
65
+ [1.1.2]: https://github.com/ManageIQ/manageiq-cross_repo/compare/v1.1.1...v1.1.2
66
+ [1.1.1]: https://github.com/ManageIQ/manageiq-cross_repo/compare/v1.1.0...v1.1.1
67
+ [1.1.0]: https://github.com/ManageIQ/manageiq-cross_repo/compare/v1.0.4...v1.1.0
68
+ [1.0.4]: https://github.com/ManageIQ/manageiq-cross_repo/compare/v1.0.3...v1.0.4
69
+ [1.0.3]: https://github.com/ManageIQ/manageiq-cross_repo/compare/v1.0.2...v1.0.3
70
+ [1.0.2]: https://github.com/ManageIQ/manageiq-cross_repo/compare/v1.0.1...v1.0.2
@@ -4,10 +4,11 @@ require "yaml"
4
4
  module ManageIQ::CrossRepo
5
5
  class Runner
6
6
  class Base
7
- attr_accessor :script_cmd
7
+ attr_accessor :script_cmd, :config
8
8
 
9
9
  def initialize(script_cmd = nil)
10
10
  @script_cmd = script_cmd.presence
11
+ @config = load_config!
11
12
  end
12
13
 
13
14
  def build_test_script
@@ -49,9 +50,9 @@ module ManageIQ::CrossRepo
49
50
 
50
51
  def build_section(section, *commands)
51
52
  [
52
- "echo 'travis_fold:start:#{section}'",
53
+ "echo '::group::#{section}'",
53
54
  *commands,
54
- "echo 'travis_fold:end:#{section}'"
55
+ "echo '::endgroup::'"
55
56
  ]
56
57
  end
57
58
 
@@ -64,11 +65,7 @@ module ManageIQ::CrossRepo
64
65
  end
65
66
 
66
67
  def load_config!
67
- config
68
- end
69
-
70
- def config
71
- @config ||= travis_config.tap do |config|
68
+ ci_config.tap do |config|
72
69
  # Set missing sections to the proper defaults
73
70
  config["install"] ||= defaults[config["language"]]["install"]
74
71
 
@@ -77,7 +74,7 @@ module ManageIQ::CrossRepo
77
74
  end
78
75
  end
79
76
 
80
- def travis_config
77
+ def ci_config
81
78
  raise NotImplementedError, "must be implemented in a subclass"
82
79
  end
83
80
 
@@ -85,7 +82,7 @@ module ManageIQ::CrossRepo
85
82
  @defaults ||= {
86
83
  "node_js" => {
87
84
  "language" => "node_js",
88
- "node_js" => ["12"],
85
+ "node_js" => ["14"],
89
86
  "install" => "npm install",
90
87
  "script" => "npm test"
91
88
  },
@@ -1,5 +1,6 @@
1
1
  require_relative "./base"
2
2
  require "yaml"
3
+ require "active_support/core_ext/enumerable"
3
4
 
4
5
  module ManageIQ::CrossRepo
5
6
  class Runner
@@ -12,18 +13,21 @@ module ManageIQ::CrossRepo
12
13
 
13
14
  private
14
15
 
15
- def travis_config
16
+ def ci_config
17
+ github_config = YAML.load_file(CONFIG_FILE)
18
+
16
19
  steps = github_config["jobs"]["ci"]["steps"]
20
+ steps_by_name = steps.index_by { |step| step["name"] }
21
+
17
22
  language = steps.any? { |s| s["uses"] == "ruby/setup-ruby@v1" } ? "ruby" : "node_js"
18
23
 
19
- defaults[language].clone.tap do |config|
20
- script_step = steps.detect { |s| s["name"] == "Run tests" }
21
- config["script"] = script_step["run"] if script_step
22
- end
23
- end
24
+ result = {"language" => language}
25
+
26
+ result["before_install"] = steps_by_name["Set up system"]["run"] if steps_by_name["Set up system"]
27
+ result["before_script"] = steps_by_name["Prepare tests"]["run"] if steps_by_name["Prepare tests"]
28
+ result["script"] = steps_by_name["Run tests"]["run"] if steps_by_name["Run tests"]
24
29
 
25
- def github_config
26
- YAML.load_file(CONFIG_FILE)
30
+ result
27
31
  end
28
32
  end
29
33
  end
@@ -12,7 +12,7 @@ module ManageIQ::CrossRepo
12
12
 
13
13
  private
14
14
 
15
- def travis_config
15
+ def ci_config
16
16
  YAML.load_file(CONFIG_FILE)
17
17
  end
18
18
  end
@@ -26,6 +26,7 @@ module ManageIQ::CrossRepo
26
26
  end
27
27
 
28
28
  def run
29
+ announce_run
29
30
  test_repo.ensure_clone
30
31
  core_repo.ensure_clone unless test_repo.core?
31
32
  prepare_gem_repos
@@ -34,6 +35,15 @@ module ManageIQ::CrossRepo
34
35
 
35
36
  private
36
37
 
38
+ def announce_run
39
+ puts "\e[36m Starting cross repo for:\e[0m"
40
+ puts " \e[36mtest repo: #{test_repo.identifier}\e[0m"
41
+ puts " \e[36mcore repo: #{core_repo.identifier}\e[0m"
42
+ gem_repos.each do |gr|
43
+ puts " \e[36mgem repo: #{gr.identifier}\e[0m"
44
+ end
45
+ end
46
+
37
47
  def bundle_path
38
48
  app_path = Pathname.new(ENV["TRAVIS_BUILD_DIR"].presence || Pathname.pwd)
39
49
  app_path.join("vendor", "bundle")
@@ -47,7 +57,7 @@ module ManageIQ::CrossRepo
47
57
  end
48
58
 
49
59
  def env_vars
50
- {"MANAGEIQ_REPO" => core_repo.path.to_s, "TRAVIS_BUILD_DIR" => test_repo.path.to_s, "BUNDLE_PATH" => bundle_path.to_s, "TEST_SUITE" => test_suite}
60
+ {"MANAGEIQ_REPO" => core_repo.path.to_s, "BUNDLE_PATH" => bundle_path.to_s, "TEST_SUITE" => test_suite}
51
61
  end
52
62
 
53
63
  def with_test_env
@@ -1,5 +1,5 @@
1
1
  module ManageIQ
2
2
  module CrossRepo
3
- VERSION = "1.2.1"
3
+ VERSION = "2.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manageiq-cross_repo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ManageIQ Authors
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-11 00:00:00.000000000 Z
11
+ date: 2022-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: manageiq-style
@@ -123,19 +123,21 @@ dependencies:
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  description: ManageIQ CrossRepo testing library
126
- email:
126
+ email:
127
127
  executables:
128
128
  - manageiq-cross_repo
129
129
  extensions: []
130
130
  extra_rdoc_files: []
131
131
  files:
132
132
  - ".codeclimate.yml"
133
+ - ".github/workflows/ci.yaml"
134
+ - ".github/workflows/manageiq_cross_repo.yaml"
133
135
  - ".gitignore"
134
136
  - ".rspec"
135
137
  - ".rubocop.yml"
136
138
  - ".rubocop_cc.yml"
137
139
  - ".rubocop_local.yml"
138
- - ".travis.yml"
140
+ - ".whitesource"
139
141
  - CHANGELOG.md
140
142
  - Gemfile
141
143
  - LICENSE.txt
@@ -160,7 +162,7 @@ licenses:
160
162
  metadata:
161
163
  homepage_uri: https://github.com/ManageIQ/manageiq-cross_repo
162
164
  source_code_uri: https://github.com/ManageIQ/manageiq-cross_repo
163
- post_install_message:
165
+ post_install_message:
164
166
  rdoc_options: []
165
167
  require_paths:
166
168
  - lib
@@ -175,8 +177,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
177
  - !ruby/object:Gem::Version
176
178
  version: '0'
177
179
  requirements: []
178
- rubygems_version: 3.1.6
179
- signing_key:
180
+ rubygems_version: 3.3.5
181
+ signing_key:
180
182
  specification_version: 4
181
183
  summary: ManageIQ CrossRepo testing library
182
184
  test_files: []
data/.travis.yml DELETED
@@ -1,11 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.5.5
4
- cache: bundler
5
- addons:
6
- postgresql: '10'
7
- apt:
8
- packages:
9
- - libarchive-dev
10
- matrix:
11
- fast_finish: true