manageiq-cross_repo 1.2.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b41a33500bc19d1787fc628f2b36526425dafe94b8176376205b3d77e6b8c56
4
- data.tar.gz: fcb915b5746293c0f0969cda70116337a5b27795ec94673fe123dfb3357460d4
3
+ metadata.gz: aabcb009709323fda3ef5fb9d7b51a14bb740382d2ae9ee07906f1f51ff7dc0b
4
+ data.tar.gz: 455362a5640b2aea638156d67a0c39495a2b4151f6242fe6f68ad92f718e1512
5
5
  SHA512:
6
- metadata.gz: f99033869bee7e81ccf5a3fa68ad5c0cbe4d775e50372cccdb79474a92385c9ea258be6754015ef1ca3deb2c4db2dfcd400115e3b571db1dfb956d0f61a84f66
7
- data.tar.gz: '082df5577e2c09309900e1782f621c05764b8de1d25b22b63a41eecfe4d71d040cc1290d5abe241d6093547419be14f09d762587dda8d3b6ac759ed6a43ef05e'
6
+ metadata.gz: 189db86dd4fb0fe6f597bb0308b9a1d06e3bf6302bfb01f05adec4f5df0c01d3c63f469d32e05c8d51caf76cce5e1baf2363bcc0260cda01838bc154d7f29437
7
+ data.tar.gz: b37fc65c86b522b03aa4673d624e0f32506f4ee3e27afc19e3751eef8e234000052c369fc6f4960d465beb1f4285feae841431f6a30b1a6d15b6fb6c5ea01d20
@@ -0,0 +1,22 @@
1
+ name: CI
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ ci:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ matrix:
10
+ ruby-version:
11
+ - '2.5'
12
+ - '2.6'
13
+ - '2.7'
14
+ steps:
15
+ - uses: actions/checkout@v2
16
+ - name: Set up Ruby
17
+ uses: ruby/setup-ruby@v1
18
+ with:
19
+ ruby-version: ${{ matrix.ruby-version }}
20
+ bundler-cache: true
21
+ - name: Run tests
22
+ run: bundle exec rake
@@ -0,0 +1,51 @@
1
+ name: ManageIQ Cross Repo Workflow
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ test-repo:
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
+ name: Run manageiq-cross_repo
19
+ runs-on: ubuntu-latest
20
+ strategy:
21
+ fail-fast: false
22
+ services:
23
+ postgres:
24
+ image: manageiq/postgresql:10
25
+ env:
26
+ POSTGRESQL_USER: root
27
+ POSTGRESQL_PASSWORD: smartvm
28
+ POSTGRESQL_DATABASE: vmdb_test
29
+ options: --health-cmd pg_isready --health-interval 2s --health-timeout 5s --health-retries 5
30
+ ports:
31
+ - 5432:5432
32
+ env:
33
+ TEST_SUITE: ${{ inputs.test-suite }}
34
+ REPOS: ${{ inputs.repos }}
35
+ TEST_REPO: ${{ inputs.test-repo }}
36
+ PGHOST: localhost
37
+ PGPASSWORD: smartvm
38
+ steps:
39
+ - uses: actions/checkout@v2
40
+ - name: Set up Ruby
41
+ uses: ruby/setup-ruby@v1
42
+ with:
43
+ ruby-version: 2.7
44
+ bundler-cache: true
45
+ - name: Set up Node
46
+ uses: actions/setup-node@v2
47
+ with:
48
+ node-version: 12
49
+ registry-url: https://npm.manageiq.org/
50
+ - name: Run tests
51
+ 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,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [2.0.0] - 2022-02-08
8
+ ### Changed
9
+ - Announce the cross repo run information (#81)
10
+ - Use Github Actions for CI (#82)
11
+ - Replace Travis with Github Actions (#83)
12
+
7
13
  ## [1.2.1] - 2022-01-11
8
14
  ### Fixed
9
15
  - Fix unpacking the hash for ruby 3 support
@@ -46,7 +52,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
46
52
  - Fix an issue extracting tgz files smaller than 10Kb
47
53
  - Fix an issue overriding gems whose repo name doesn't match
48
54
 
49
- [Unreleased]: https://github.com/ManageIQ/more_core_extensions/compare/v1.2.1...HEAD
55
+ [Unreleased]: https://github.com/ManageIQ/more_core_extensions/compare/v2.0.0...HEAD
56
+ [2.0.0]: https://github.com/ManageIQ/more_core_extensions/compare/v2.0.0...v1.2.1
50
57
  [1.2.1]: https://github.com/ManageIQ/more_core_extensions/compare/v1.2.0...v1.2.1
51
58
  [1.2.0]: https://github.com/ManageIQ/more_core_extensions/compare/v1.1.3...v1.2.0
52
59
  [1.1.3]: https://github.com/ManageIQ/more_core_extensions/compare/v1.1.2...v1.1.3
@@ -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
 
@@ -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.0.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.0.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-08 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.yml"
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