diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000000..6dbeb4005bb --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,41 @@ +name: CI + +on: [push, pull_request] + +jobs: + ci: + runs-on: ubuntu-latest + strategy: + matrix: + ruby-version: + - '2.6' + test-suite: + - vmdb + - security + services: + postgres: + image: manageiq/postgresql:10 + env: + POSTGRESQL_USER: root + POSTGRESQL_PASSWORD: smartvm + POSTGRESQL_DATABASE: vmdb_test + options: --health-cmd pg_isready --health-interval 2s --health-timeout 5s --health-retries 5 + ports: + - 5432:5432 + env: + TEST_SUITE: ${{ matrix.test-suite }} + PGHOST: localhost + PGPASSWORD: smartvm + steps: + - uses: actions/checkout@v2 + - name: Set up system + run: bin/before_install + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true + - name: Prepare tests + run: bin/setup + - name: Run tests + run: bundle exec rake diff --git a/.gitignore b/.gitignore index 0e6e1288b63..9157f0f6492 100644 --- a/.gitignore +++ b/.gitignore @@ -38,9 +38,6 @@ xfer_*.xml Thumbs.db Procfile -# bin/ -bin/* - # config/ config/apache config/cable.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a2b89c0fc6a..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -language: ruby -dist: bionic -rvm: -- 2.6.6 -cache: bundler -env: - global: - - RUBY_GC_HEAP_GROWTH_MAX_SLOTS=300000 - - RUBY_GC_HEAP_INIT_SLOTS=600000 - - RUBY_GC_HEAP_GROWTH_FACTOR=1.25 - - PARALLEL_TEST_PROCESSORS=2 - matrix: - - TEST_SUITE=vmdb PARALLEL=true - - TEST_SUITE=brakeman -matrix: - fast_finish: true - jobs: - - group: edge - virt: lxd - arch: arm64-graviton2 - rvm: 2.6.6 - env: - - RUBY_GC_HEAP_GROWTH_MAX_SLOTS=300000 - - RUBY_GC_HEAP_INIT_SLOTS=600000 - - RUBY_GC_HEAP_GROWTH_FACTOR=1.25 - - PARALLEL_TEST_PROCESSORS=2 - - TEST_SUITE=vmdb PARALLEL=true -addons: - postgresql: '10' -before_install: source ${TRAVIS_BUILD_DIR}/bin/ci/before_install.sh -before_script: source ${TRAVIS_BUILD_DIR}/bin/ci/before_script.sh -after_failure: source ${TRAVIS_BUILD_DIR}/bin/ci/after_failure.sh -notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/7af45001fe6b7a4039f2 - on_success: change - on_failure: always - on_start: never diff --git a/Gemfile b/Gemfile index e282d09d083..32d46a377a4 100644 --- a/Gemfile +++ b/Gemfile @@ -256,37 +256,39 @@ group :web_socket, :manageiq_default do gem "websocket-driver", "~>0.6.3", :require => false end +group :appliance, :optional => true do + gem "manageiq-appliance_console", "~>6.0", :require => false +end + ### Start of gems excluded from the appliances. # The gems listed below do not need to be packaged until we find it necessary or useful. # Only add gems here that we do not need on an appliance. # -unless ENV["APPLIANCE"] - group :development do - gem "foreman" - gem "manageiq-style", "~>1.2.0", :require => false - gem "PoParser" - # ruby_parser is required for i18n string extraction - gem "ruby_parser", :require => false - gem "yard" - end - - group :test do - gem "brakeman", "~>5.0", :require => false - gem "capybara", "~>2.5.0", :require => false - gem "coveralls", "~>0.8.23", :require => false - gem "db-query-matchers", "~>0.10.0" - gem "factory_bot", "~>5.1", :require => false - - # TODO: faker is used for url generation in git repository factory and the lenovo - # provider, via a xclarity_client dependency - gem "faker", "~>1.8", :require => false - gem "timecop", "~>0.9", :require => false - gem "vcr", "~>5.0", :require => false - gem "webmock", "~>3.7", :require => false - end - - group :development, :test do - gem "parallel_tests" - gem "rspec-rails", "~>4.0.1" - end +group :development do + gem "foreman" + gem "manageiq-style", "~>1.2.0", :require => false + gem "PoParser" + # ruby_parser is required for i18n string extraction + gem "ruby_parser", :require => false + gem "yard" +end + +group :test do + gem "brakeman", "~>5.0", :require => false + gem "capybara", "~>2.5.0", :require => false + gem "coveralls", "~>0.8.23", :require => false + gem "db-query-matchers", "~>0.10.0" + gem "factory_bot", "~>5.1", :require => false + + # TODO: faker is used for url generation in git repository factory and the lenovo + # provider, via a xclarity_client dependency + gem "faker", "~>1.8", :require => false + gem "timecop", "~>0.9", :require => false + gem "vcr", "~>5.0", :require => false + gem "webmock", "~>3.7", :require => false +end + +group :development, :test do + gem "parallel_tests" + gem "rspec-rails", "~>4.0.1" end diff --git a/Gemfile.lock.release b/Gemfile.lock.release index 1b148bebcd3..f5daee84828 100644 --- a/Gemfile.lock.release +++ b/Gemfile.lock.release @@ -346,6 +346,9 @@ GEM GEM remote: https://rubygems.org/ specs: + ParseTree (1.1.1) + PoParser (0.1.1) + parslet actioncable (6.0.6.1) actionpack (= 6.0.6.1) nio4r (~> 2.0) @@ -433,6 +436,7 @@ GEM json (>= 1.2.1) oauth rest-client (>= 1.6.5) + ast (2.4.2) autoprefixer-rails (10.3.3.0) execjs (~> 2) autosde_openapi_client (1.1.8) @@ -506,10 +510,17 @@ GEM bootstrap-sass (3.4.1) autoprefixer-rails (>= 5.2.1) sassc (>= 2.0.0) + brakeman (5.0.4) builder (3.2.4) bunny (2.1.0) amq-protocol (>= 2.0.0) byebug (11.1.3) + capybara (2.5.0) + mime-types (>= 1.16) + nokogiri (>= 1.3.3) + rack (>= 1.0.0) + rack-test (>= 0.5.4) + xpath (~> 2.0) coffee-rails (5.0.0) coffee-script (>= 2.2.0) railties (>= 5.2.0) @@ -522,14 +533,26 @@ GEM config (2.2.3) deep_merge (~> 1.2, >= 1.2.1) dry-validation (~> 1.0, >= 1.0.0) + coveralls (0.8.23) + json (>= 1.8, < 3) + simplecov (~> 0.16.1) + term-ansicolor (~> 1.3) + thor (>= 0.19.4, < 2.0) + tins (~> 1.6) + crack (0.3.2) crass (1.0.6) dalli (2.7.6) + db-query-matchers (0.10.0) + activesupport (>= 4.0, < 7) + rspec (~> 3.0) dbus-systemd (1.1.2) ruby-dbus (~> 0.14) declarative (0.0.20) deep_merge (1.2.1) default_value_for (3.4.0) activerecord (>= 3.2.0, < 7.0) + diff-lcs (1.2.5) + docile (1.1.5) docker-api (1.33.6) excon (>= 0.38.0) json @@ -578,6 +601,8 @@ GEM event_emitter (0.2.6) excon (0.88.0) execjs (2.8.1) + factory_bot (5.1.2) + activesupport (>= 4.2.0) faker (1.8.7) i18n (>= 0.7) faraday (0.17.4) @@ -624,6 +649,8 @@ GEM font-awesome-sass (4.6.2) sass (>= 3.2) font-fabulous (1.0.5) + foreman (0.41.0) + thor (>= 0.13.6) foreman_api_client (1.0.1) apipie-bindings (= 0.0.15) rest-client (~> 2.0) @@ -676,6 +703,9 @@ GEM websocket-client-simple (~> 0.3.0) high_voltage (3.0.0) highline (1.6.21) + hoe (1.4.0) + rake (>= 0.7.3) + rubyforge (>= 0.4.4) http (4.4.1) addressable (~> 2.3) http-cookie (~> 1.0) @@ -737,6 +767,7 @@ GEM more_core_extensions (>= 3.5, < 5) pg (> 0) ipaddress (0.8.3) + jaro_winkler (1.5.6) jbuilder (2.11.3) activesupport (>= 5.0.0) jmespath (1.6.2) @@ -831,6 +862,12 @@ GEM activesupport net-sftp (~> 2.1) net-ssh (~> 4.2) + manageiq-style (1.2.0) + more_core_extensions + optimist + rubocop (~> 0.82.0) + rubocop-performance + rubocop-rails marcel (1.0.2) memoist (0.16.2) memory_buffer (0.1.0) @@ -894,6 +931,11 @@ GEM activerecord (< 6.1) pg parallel (1.12.1) + parallel_tests (0.3.8) + parallel + parser (2.7.2.0) + ast (~> 2.4.1) + parslet (0.9.0) patternfly-sass (3.59.5) bootstrap-sass (~> 3.4.0) font-awesome-sass (~> 4.6.2) @@ -958,6 +1000,8 @@ GEM method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) + rainbow (2.2.2) + rake rake (13.0.6) rb-fsevent (0.11.0) rb-inotify (0.10.1) @@ -993,8 +1037,46 @@ GEM rexml (3.3.9) ripper_ruby_parser (1.5.1) sexp_processor (~> 4.10) + rspec (3.10.0) + rspec-core (~> 3.10.0) + rspec-expectations (~> 3.10.0) + rspec-mocks (~> 3.10.0) + rspec-core (3.10.2) + rspec-support (~> 3.10.0) + rspec-expectations (3.10.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.10.0) + rspec-mocks (3.10.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.10.0) + rspec-rails (4.0.2) + actionpack (>= 4.2) + activesupport (>= 4.2) + railties (>= 4.2) + rspec-core (~> 3.10) + rspec-expectations (~> 3.10) + rspec-mocks (~> 3.10) + rspec-support (~> 3.10) + rspec-support (3.10.3) + rubocop (0.82.0) + jaro_winkler (~> 1.5.1) + parallel (~> 1.10) + parser (>= 2.7.0.1) + rainbow (>= 2.2.2, < 4.0) + rexml + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 2.0) + rubocop-performance (0.0.1) + rubocop (>= 0.58.0) + rubocop-rails (2.0.1) + rack (>= 1.1) + rubocop (>= 0.70.0) ruby-dbus (0.16.0) ruby-progressbar (1.7.5) + ruby_parser (1.0.0) + ParseTree + hoe (>= 1.4.0) + rubyforge (0.4.5) rubyntlm (0.6.3) rubyzip (2.0.0) rufus-lru (1.0.7) @@ -1034,6 +1116,11 @@ GEM faraday (>= 0.17.3, < 2.0) jwt (>= 1.5, < 3.0) multi_json (~> 1.10) + simplecov (0.16.1) + docile (~> 1.1) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.2) snmp (1.2.0) socksify (1.7.1) sprockets (3.7.2) @@ -1058,13 +1145,17 @@ GEM ffi (~> 1.9) systemu (2.6.5) temple (0.8.2) + term-ansicolor (1.3.2) + tins (~> 1.0) terminal (2.0.0) escape_utils (~> 1.0) text (1.3.1) thor (1.1.0) thread_safe (0.3.6) tilt (2.0.10) + timecop (0.9.10) timeliness (0.3.10) + tins (1.6.0) trailblazer-option (0.1.2) transaction-simple (1.4.0.2) typhoeus (1.4.0) @@ -1077,10 +1168,12 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.8) + unicode-display_width (1.4.1) useragent (0.16.10) uuid (2.3.9) macaddr (~> 1.0) uuidtools (2.1.5) + vcr (5.0.0) vmware_web_service (2.1.1) activesupport (>= 5.2.4.3, < 6.1) ffi-vix_disk_lib (~> 1.1) @@ -1113,6 +1206,10 @@ GEM addressable httpi (~> 2.0) nokogiri (>= 1.4.2) + webmock (3.7.6) + addressable (>= 2.3.6) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) webpacker (2.0) activesupport (>= 4.2) multi_json (~> 1.2) @@ -1151,6 +1248,9 @@ GEM httpclient (~> 2.8.3) json-schema (~> 2.8.0) uuid (~> 2.3.8) + xpath (2.0.0) + nokogiri (~> 1.3) + yard (0.2.3.5) zeitwerk (2.5.1) PLATFORMS @@ -1160,6 +1260,7 @@ PLATFORMS x86_64-linux DEPENDENCIES + PoParser activerecord-session_store (~> 2.0) activerecord-virtual_attributes (~> 3.0.0) acts_as_tree (~> 2.7) @@ -1168,17 +1269,24 @@ DEPENDENCIES ancestry (~> 3.0.7) aws-sdk-s3 (~> 1.0) bcrypt (~> 3.1.10) + brakeman (~> 5.0) bundler (~> 2.1, >= 2.1.4, < 2.5, != 2.2.10) byebug + capybara (~> 2.5.0) color (~> 1.8) config (~> 2.2, >= 2.2.3) + coveralls (~> 0.8.23) dalli (= 2.7.6) + db-query-matchers (~> 0.10.0) dbus-systemd (~> 1.1.0) default_value_for (~> 3.3) docker-api (~> 1.33.6) elif (= 0.1.0) et-orbi (>= 1.2.2) + factory_bot (~> 5.1) + faker (~> 1.8) fast_gettext (~> 2.0.1) + foreman gettext_i18n_rails (~> 1.7.2) gettext_i18n_rails_js (~> 1.3.0) hamlit (~> 2.11.0) @@ -1227,6 +1335,7 @@ DEPENDENCIES manageiq-schema! manageiq-smartstate (~> 0.7.0) manageiq-ssh-util (~> 0.1.1) + manageiq-style (~> 1.2.0) manageiq-ui-classic! manageiq-v2v! memoist (~> 0.16.0) @@ -1237,6 +1346,7 @@ DEPENDENCIES net-ping (~> 1.7.4) openscap (~> 0.4.8) optimist (~> 3.0) + parallel_tests pg pg-dsn_parser (~> 0.1.0) pg-logical_replication (~> 1.2) @@ -1252,8 +1362,10 @@ DEPENDENCIES responders (~> 3.0) rest-client (~> 2.1.0) ripper_ruby_parser (~> 1.5.1) + rspec-rails (~> 4.0.1) ruby-dbus ruby-progressbar (~> 1.7.0) + ruby_parser rubyzip (~> 2.0.0) rufus-scheduler rugged (~> 1.1) @@ -1268,8 +1380,12 @@ DEPENDENCIES sys-filesystem (~> 1.4.5) systemd-journal (~> 1.4.2) terminal + timecop (~> 0.9) + vcr (~> 5.0) + webmock (~> 3.7) websocket-driver (~> 0.6.3) wim_parser (~> 1.0) + yard BUNDLED WITH 2.3.26 diff --git a/README.md b/README.md index 4ff62a08926..22157f6f429 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ManageIQ -[![Build Status](https://travis-ci.com/ManageIQ/manageiq.svg?branch=morphy)](https://travis-ci.com/ManageIQ/manageiq) +[![CI](https://github.com/ManageIQ/manageiq/actions/workflows/ci.yaml/badge.svg?branch=morphy)](https://github.com/ManageIQ/manageiq/actions/workflows/ci.yaml) [![Code Climate](https://codeclimate.com/github/ManageIQ/manageiq/badges/gpa.svg)](https://codeclimate.com/github/ManageIQ/manageiq) [![Codacy](https://api.codacy.com/project/badge/grade/9ffce48ccb924020ae8f9e698048e9a4)](https://www.codacy.com/app/ManageIQ/manageiq) [![Coverage Status](https://coveralls.io/repos/ManageIQ/manageiq/badge.svg?branch=morphy&service=github)](https://coveralls.io/github/ManageIQ/manageiq?branch=morphy) @@ -11,8 +11,7 @@ [![Translate](https://img.shields.io/badge/translate-transifex-blue.svg)](https://www.transifex.com/manageiq/manageiq/dashboard/) [![License](http://img.shields.io/badge/license-APACHE2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) - -[![Build history for master branch](https://buildstats.info/travisci/chart/ManageIQ/manageiq?branch=morphy&includeBuildsFromPullRequest=false&buildCount=50)](https://travis-ci.org/ManageIQ/manageiq/branches) +[![Build history for morphy branch](https://buildstats.info/github/chart/ManageIQ/manageiq?branch=morphy&buildCount=50&includeBuildsFromPullRequest=false&showstats=false)](https://github.com/ManageIQ/manageiq/actions?query=branch%3Amorphy) ## Discover, Optimize, and Control your Hybrid IT diff --git a/app/models/openscap_result.rb b/app/models/openscap_result.rb index 48e76cece68..720ba9f800b 100644 --- a/app/models/openscap_result.rb +++ b/app/models/openscap_result.rb @@ -7,7 +7,7 @@ class OpenscapResult < ApplicationRecord before_save :create_rule_results def self.openscap_available? - # needed only for travis + # needed only for CI require 'openscap' require 'openscap/ds/arf' require 'openscap/xccdf/benchmark' diff --git a/bin/before_install b/bin/before_install new file mode 100755 index 00000000000..c653d89de28 --- /dev/null +++ b/bin/before_install @@ -0,0 +1,26 @@ +#!/bin/bash + +set -e + +APP_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." &>/dev/null && pwd) + +if [ -n "$CI" ]; then + echo "== Installing system packages ==" + sudo apt-get install libcurl4-openssl-dev + echo +fi + +if [ -n "$CI" ]; then + echo "== Setup git config ==" + git config --global user.name "ManageIQ" + git config --global user.email "contact@manageiq.org" + echo + + # Gemfile.lock.release only applies to non-master branches and PRs to non-master branches + if [ "$GITHUB_REPOSITORY_OWNER" = "ManageIQ" -a "$GITHUB_BASE_REF" != "master" -a "$GITHUB_REF_NAME" != "master" ]; then + echo "== Setup Gemfile.lock.release ==" + cp -f "$APP_ROOT/Gemfile.lock.release" "$APP_ROOT/Gemfile.lock" + cat Gemfile.lock + echo + fi +fi diff --git a/bin/ci/after_failure.sh b/bin/ci/after_failure.sh deleted file mode 100755 index 927ecdb7eb3..00000000000 --- a/bin/ci/after_failure.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -v - -echo "Errors and warnings in log files" -echo log/* -egrep -i "warn|error" log/*.log - -set +v diff --git a/bin/ci/before_install.rb b/bin/ci/before_install.rb deleted file mode 100755 index 3b1e51ed4f4..00000000000 --- a/bin/ci/before_install.rb +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env ruby -require_relative '../../lib/manageiq/environment' -ManageIQ::Environment.setup_gemfile_lock -ManageIQ::Environment.ensure_config_files -ManageIQ::Environment.create_database_user -ManageIQ::Environment.install_bundler diff --git a/bin/ci/before_install.sh b/bin/ci/before_install.sh deleted file mode 100755 index b9c243e283c..00000000000 --- a/bin/ci/before_install.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -set -ev - -if [ -n "$CI" ]; then - git config --global user.name "ManageIQ" - git config --global user.email "contact@manageiq.org" -fi - -./bin/ci/before_install.rb - -export BUNDLE_WITHOUT=development -export BUNDLE_GEMFILE=${PWD}/Gemfile - -set +ev diff --git a/bin/ci/before_script.sh b/bin/ci/before_script.sh deleted file mode 100755 index 979f8c09a5d..00000000000 --- a/bin/ci/before_script.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -bundle exec rake test:setup diff --git a/bin/setup b/bin/setup index 3a66b2fe337..56f38ee0bca 100755 --- a/bin/setup +++ b/bin/setup @@ -21,9 +21,11 @@ ENV["SKIP_TEST_RESET"] = "true" if ENV['RAILS_ENV'] == 'production' Dir.chdir(ManageIQ::Environment::APP_ROOT) do ManageIQ::Environment.ensure_config_files - puts '== Installing dependencies ==' - ManageIQ::Environment.install_bundler - ManageIQ::Environment.bundle_update + unless ENV["CI"] + puts '== Installing dependencies ==' + ManageIQ::Environment.install_bundler + ManageIQ::Environment.bundle_update + end ui_thread = ManageIQ::Environment.update_ui_thread unless ENV["SKIP_UI_UPDATE"] diff --git a/lib/manageiq/environment.rb b/lib/manageiq/environment.rb index d5b046fcc56..826b231e9c0 100644 --- a/lib/manageiq/environment.rb +++ b/lib/manageiq/environment.rb @@ -21,11 +21,7 @@ def self.manageiq_plugin_update(plugin_root = nil) ensure_config_files - create_database_user if ENV["CI"] - setup_test_environment(:task_prefix => 'app:', :root => plugin_root) unless ENV["SKIP_TEST_RESET"] - - prepare_codeclimate_test_reporter(plugin_root) if ENV["CI"] end def self.ensure_config_files @@ -57,20 +53,14 @@ def self.update_ui_thread end def self.install_bundler(root = APP_ROOT) - system!("echo 'gem: --no-ri --no-rdoc --no-document' > ~/.gemrc") if ENV['CI'] - system!("gem install bundler -v '#{bundler_version}' --conservative") - system!("bundle config path #{root.join('vendor/bundle').expand_path}", :chdir => root) if ENV["CI"] - - # For nokogiri 1.13.0+, native gem support was added, allowing pre-compiled binaries to be used. - # This provides faster and more reliable installation but assumes you have total control of the installation environment. - # On travis, or other CI's, we may not be able to easily install the various dev dependencies it expects. We'll force - # travis to compile these extensions from source until we can use these native gems. - # See https://nokogiri.org/CHANGELOG.html#1130-2022-01-06 - system!("bundle config set force_ruby_platform true") if ENV["TRAVIS"] + system!("gem install bundler -v '#{bundler_version}' --conservative") unless ENV["GITHUB_ACTIONS"] end def self.setup_gemfile_lock - return if ENV["TRAVIS_BRANCH"] == "master" + # Gemfile.lock.release only applies to non-master branches and PRs to non-master branches + return unless ENV["GITHUB_REPOSITORY_OWNER"] == "ManageIQ" && + ENV["GITHUB_BASE_REF"] != "master" && # PR to non-master branch + ENV["GITHUB_REF_NAME"] != "master" # A non-master branch raise "Missing Gemfile.lock.release" unless APP_ROOT.join("Gemfile.lock.release").file? end @@ -117,16 +107,6 @@ def self.clear_logs_and_temp run_rake_task("log:clear tmp:clear") end - def self.create_database_user - system!(%q(psql -c "CREATE USER root SUPERUSER PASSWORD 'smartvm';" -U postgres)) - end - - def self.prepare_codeclimate_test_reporter(root = APP_ROOT) - system!("curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter", :chdir => root) - system!("chmod +x ./cc-test-reporter", :chdir => root) - system!("./cc-test-reporter before-build", :chdir => root) - end - def self.update_ui system!("bundle exec rake update:ui") end diff --git a/lib/tasks/release.rake b/lib/tasks/release.rake index 18dde6f1e03..4565070a446 100644 --- a/lib/tasks/release.rake +++ b/lib/tasks/release.rake @@ -24,15 +24,12 @@ task :release do lock_release = root.join("Gemfile.lock.release") if lock_release.exist? gemfile_lock = lock_release.to_s.chomp(".release") - appliance_dependency = root.join("bundler.d/manageiq-appliance-dependencies.rb") FileUtils.ln_s(lock_release, gemfile_lock, :force => true) - FileUtils.ln_s(root.join("../manageiq-appliance/manageiq-appliance-dependencies.rb"), - appliance_dependency, :force => true) exit $?.exitstatus unless Bundler.unbundled_system({"BUNDLE_IGNORE_CONFIG" => "true", "APPLIANCE" => "true"}, "bundle lock --update --conservative --patch") - FileUtils.rm([appliance_dependency, gemfile_lock]) + FileUtils.rm(gemfile_lock) lock_content = lock_release.read lock_release.write(lock_content.gsub("branch: #{branch}", "tag: #{version}")) @@ -206,11 +203,6 @@ namespace :release do end begin - require "open-uri" - appliance_deps = URI.parse("https://raw.githubusercontent.com/ManageIQ/manageiq-appliance/#{branch}/manageiq-appliance-dependencies.rb").read - appliance_deps_file = local_bundler_d.join("manageiq_appliance_dependencies.rb") - File.write(appliance_deps_file, appliance_deps) - FileUtils.cp(root.join("Gemfile.lock.release"), root.join("Gemfile.lock")) if update_gems.any? @@ -235,8 +227,6 @@ namespace :release do end FileUtils.cp(root.join("Gemfile.lock"), root.join("Gemfile.lock.release")) - ensure - FileUtils.rm_f(appliance_deps_file) end end end diff --git a/spec/models/miq_database_spec.rb b/spec/models/miq_database_spec.rb index faae6481005..42d4d9b68e0 100644 --- a/spec/models/miq_database_spec.rb +++ b/spec/models/miq_database_spec.rb @@ -134,8 +134,8 @@ end end - if ENV.key?("CI") - it "uses a random, non-zero, region number on Travis" do + if ENV["CI"] + it "uses a random, non-zero, region number on CI" do db = MiqDatabase.seed expect(db.region_number).to be > 0 expect(db.region_number).to eq(MiqRegion.my_region_number) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b8c24028c41..6aac07d0bb7 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,5 @@ # This file is copied to spec/ when you run 'rails generate rspec:install' -if ENV["TRAVIS"] || ENV['CI'] +if ENV['CI'] require 'coveralls' require 'simplecov' SimpleCov.start @@ -65,7 +65,7 @@ EvmSpecHelper.clear_caches { example.run } end - if ENV["TRAVIS"] && ENV["TEST_SUITE"] == "vmdb" + if ENV["CI"] && ENV["TEST_SUITE"] == "vmdb" config.before(:suite) do require Rails.root.join("spec/coverage_helper.rb") end