From 3ff25d9cbb6f2ae83391dabe539fc227200cd787 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 8 May 2024 10:31:59 +0200 Subject: [PATCH 1/7] drop unused test_plugin.sh Fixes: c8741037729b478cb1077a9c60a5af32c271d11d --- theforeman.org/scripts/test/test_plugin.sh | 85 ---------------------- 1 file changed, 85 deletions(-) delete mode 100644 theforeman.org/scripts/test/test_plugin.sh diff --git a/theforeman.org/scripts/test/test_plugin.sh b/theforeman.org/scripts/test/test_plugin.sh deleted file mode 100644 index 4854830d..00000000 --- a/theforeman.org/scripts/test/test_plugin.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash -ex - -TOP_ROOT=`pwd` -APP_ROOT=$TOP_ROOT/foreman -PLUGIN_ROOT=$TOP_ROOT/plugin - -cd $APP_ROOT - -### START test_develop ### -# This section is from test_develop, please keep it in sync - -# setup basic settings file -cp $APP_ROOT/config/settings.yaml.example $APP_ROOT/config/settings.yaml - -echo "Setting up RVM environment." -set +x -# RVM Ruby environment -. /etc/profile.d/rvm.sh -# Use a gemset unique to each executor to enable parallel builds -gemset=$(echo ${JOB_NAME} | cut -d/ -f1)-${EXECUTOR_NUMBER} -rvm use ruby-${ruby}@${gemset} --create -rvm gemset empty --force - -set -x - -if [ "${ruby}" = '2.7' ] -then - gem install bundler -v 2.4.22 --no-document -else - gem install bundler --no-document -fi - -# Retry as rubygems (being external to us) can be intermittent -bundle install --without=development --jobs=5 --retry=5 - -# Database environment -( - sed "s/^test:/development:/; s/database:.*/database: ${gemset}-dev/" $HOME/postgresql.db.yaml - echo - sed "s/database:.*/database: ${gemset}-test/" $HOME/postgresql.db.yaml -) > $APP_ROOT/config/database.yml - -# Create DB first in development as migrate behaviour can change -bundle exec rake db:drop DISABLE_DATABASE_ENVIRONMENT_CHECK=true --trace -# We drop and create in 2 separate commands (speed penalty, 2 Rails initializations) -# as it's necessary to make sure at db:migrate models are loaded from a clean slate. -# e.g: model Host isn't loaded with a 'type' attribute before the column is added -# in the migration. -bundle exec rake db:create db:migrate DISABLE_DATABASE_ENVIRONMENT_CHECK=true --trace - -### END test_develop ### - -# Ensure we don't mention the gem twice in the Gemfile in case it's already mentioned there -find Gemfile bundler.d -type f -exec sed -i "/gem ['\"]${plugin_name}['\"]/d" {} \; -# Now let's introduce the plugin -echo "gem '${plugin_name}', :path => '${PLUGIN_ROOT}'" >> bundler.d/Gemfile.local.rb - -# Plugin specifics.. -[ -e ${PLUGIN_ROOT}/gemfile.d/${plugin_name}.rb ] && cat ${PLUGIN_ROOT}/gemfile.d/${plugin_name}.rb >> bundler.d/Gemfile.local.rb - -# Update dependencies -bundle update --jobs=5 --retry=5 - -# Now let's add the plugin migrations -bundle exec rake db:migrate RAILS_ENV=development --trace - -tasks="jenkins:unit" - -# If the plugin contains integration tests or triggers core integration tests, -# we need to install node modules and compile webpack -if [ -d "${PLUGIN_ROOT}/test/integration" ] ; then - npm install --no-audit - tasks="$tasks jenkins:integration" -fi - -bundle exec rake $tasks TESTOPTS="-v" --trace - -# Run the DB seeds to verify they work -bundle exec rake db:drop --trace -# We drop and create in 2 separate commands (speed penalty, 2 Rails initializations) -# as it's necessary to make sure at db:migrate models are loaded from a clean slate. -# e.g: model Host isn't loaded with a 'type' attribute before the column is added -# in the migration. -bundle exec rake db:create db:migrate --trace -bundle exec rake db:seed --trace From 20ca19005d55e0404d5dfa024b357bcf73b0c757 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 8 May 2024 10:33:01 +0200 Subject: [PATCH 2/7] drop unused test_katello Fixes: c8741037729b478cb1077a9c60a5af32c271d11d --- theforeman.org/scripts/test/test_katello.sh | 84 ------------------- .../yaml/builders/test_katello.yaml | 4 - 2 files changed, 88 deletions(-) delete mode 100644 theforeman.org/scripts/test/test_katello.sh delete mode 100644 theforeman.org/yaml/builders/test_katello.yaml diff --git a/theforeman.org/scripts/test/test_katello.sh b/theforeman.org/scripts/test/test_katello.sh deleted file mode 100644 index 842186fc..00000000 --- a/theforeman.org/scripts/test/test_katello.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash -ex - -TOP_ROOT=`pwd` -if [ -e $TOP_ROOT/foreman/Gemfile ]; then - APP_ROOT=$TOP_ROOT/foreman -else - APP_ROOT=$TOP_ROOT -fi -PLUGIN_ROOT=$TOP_ROOT/plugin - -### Foreman PR testing ### -cd $APP_ROOT -if [ -n "${foreman_pr_git_url}" ]; then - git remote add pr ${foreman_pr_git_url} - git fetch pr - git merge pr/${foreman_pr_git_ref} -fi - -### PR testing ### -cd $PLUGIN_ROOT -if [ -n "${pr_git_url}" ]; then - git remote add pr ${pr_git_url} - git fetch pr - git merge pr/${pr_git_ref} -fi - -cd $APP_ROOT -mkdir config/settings.plugins.d - -# setup basic settings file -cp $APP_ROOT/config/settings.yaml.example $APP_ROOT/config/settings.yaml - -echo "Setting up RVM environment." -set +x -# RVM Ruby environment -. /etc/profile.d/rvm.sh -# Use a gemset unique to each executor to enable parallel builds -gemset=$(echo ${JOB_NAME} | cut -d/ -f1)-${EXECUTOR_NUMBER} -rvm use ruby-${ruby}@${gemset} --create -rvm gemset empty --force -set -x - -if [ "${ruby}" = '2.7' ] -then - gem install bundler -v 2.4.22 --no-document -else - gem install bundler --no-document -fi - -# Now let's introduce the plugin -echo "gemspec :path => '${PLUGIN_ROOT}', :development_group => :katello_dev" >> bundler.d/Gemfile.local.rb - -# Install dependencies -bundle update --jobs=5 --retry=5 - -# Database environment -( - sed "s/^test:/development:/; s/database:.*/database: ${gemset}-dev/" $HOME/postgresql.db.yaml - echo - sed "s/database:.*/database: ${gemset}-test/" $HOME/postgresql.db.yaml -) > $APP_ROOT/config/database.yml - -# First try to drop the DB, but ignore failure as it might happen with Rails 5 -# when there is really no DB yet. -bundle exec rake db:drop >/dev/null 2>/dev/null || true - -# Create DB first in development as migrate behaviour can change -bundle exec rake db:create --trace -### END test_develop ### - -# Now let's add the plugin migrations -bundle exec rake db:migrate --trace - -# Katello-specific tests -bundle exec rake jenkins:katello TESTOPTS="-v" --trace - -# Run the DB seeds to verify they work -bundle exec rake db:drop RAILS_ENV=test >/dev/null 2>/dev/null || true -bundle exec rake db:create RAILS_ENV=test -bundle exec rake db:migrate --trace RAILS_ENV=test -bundle exec rake db:seed --trace RAILS_ENV=test - -# Clean up the database after use -bundle exec rake db:drop >/dev/null 2>/dev/null || true diff --git a/theforeman.org/yaml/builders/test_katello.yaml b/theforeman.org/yaml/builders/test_katello.yaml deleted file mode 100644 index 426a5fa7..00000000 --- a/theforeman.org/yaml/builders/test_katello.yaml +++ /dev/null @@ -1,4 +0,0 @@ -- builder: - name: test_katello - builders: - - shell: !include-raw: scripts/test/test_katello.sh From a767a20ec85884c68806880f4f66bc5f713f8f8a Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 8 May 2024 11:06:29 +0200 Subject: [PATCH 3/7] drop unused test_foreman_virt_who_configure.sh Fixes: 6836b7605e4eeb113751df652dbeec1fad0317a2 --- theforeman.org/scripts/test/test_foreman_virt_who_configure.sh | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 theforeman.org/scripts/test/test_foreman_virt_who_configure.sh diff --git a/theforeman.org/scripts/test/test_foreman_virt_who_configure.sh b/theforeman.org/scripts/test/test_foreman_virt_who_configure.sh deleted file mode 100644 index 72eeb2a9..00000000 --- a/theforeman.org/scripts/test/test_foreman_virt_who_configure.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -ex - -bundle exec rake test:foreman_virt_who_configure TESTOPTS="-v" --trace From eb4bf54d1fcb96f6e29cee05eefa6c83b771d186 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 8 May 2024 11:07:24 +0200 Subject: [PATCH 4/7] drop unused clone_foreman Fixes: 6836b7605e4eeb113751df652dbeec1fad0317a2 --- theforeman.org/scripts/test/clone_foreman.sh | 4 ---- theforeman.org/yaml/builders/clone_foreman.yaml | 4 ---- 2 files changed, 8 deletions(-) delete mode 100644 theforeman.org/scripts/test/clone_foreman.sh delete mode 100644 theforeman.org/yaml/builders/clone_foreman.yaml diff --git a/theforeman.org/scripts/test/clone_foreman.sh b/theforeman.org/scripts/test/clone_foreman.sh deleted file mode 100644 index 821d94a7..00000000 --- a/theforeman.org/scripts/test/clone_foreman.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -ex - -rm -rf foreman/ -git clone https://github.com/theforeman/foreman --branch "${foreman_branch}" diff --git a/theforeman.org/yaml/builders/clone_foreman.yaml b/theforeman.org/yaml/builders/clone_foreman.yaml deleted file mode 100644 index 307d52dc..00000000 --- a/theforeman.org/yaml/builders/clone_foreman.yaml +++ /dev/null @@ -1,4 +0,0 @@ -- builder: - name: clone_foreman - builders: - - shell: !include-raw: scripts/test/clone_foreman.sh From eb68679796b534a63017192f736fa9ab0a04665a Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 8 May 2024 11:08:23 +0200 Subject: [PATCH 5/7] drop unused packaging_test_pull_request_deb.sh Fixes: 1d154a41e5b660a4980fa9ea7a93e343ca229666 --- .../test/packaging_test_pull_request_deb.sh | 85 ------------------- 1 file changed, 85 deletions(-) delete mode 100644 theforeman.org/scripts/test/packaging_test_pull_request_deb.sh diff --git a/theforeman.org/scripts/test/packaging_test_pull_request_deb.sh b/theforeman.org/scripts/test/packaging_test_pull_request_deb.sh deleted file mode 100644 index 25cb012e..00000000 --- a/theforeman.org/scripts/test/packaging_test_pull_request_deb.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash -ex - -### Debian builds -[[ $ghprbTargetBranch == deb/* ]] || exit 0 - -if [[ $ghprbSourceBranch != deb/* ]] ; then - echo "Source branch name must start with deb/" - exit 1 -fi - -mkdir -p test_builds/{debian,dependencies,plugins,smart_proxy_plugins,katello} - -# deb build jobs assume a deb/ branch prefix -pr_git_short_ref=${ghprbSourceBranch##deb/} - -# deb component -branch_version=${ghprbTargetBranch##deb/} -[ x$branch_version = xdevelop ] && branch_version=nightly - -merge_base=$(git merge-base HEAD upstream/${ghprbTargetBranch}) - -# identify changed core projects, 5 at most! -for p in $(git diff --name-only HEAD $merge_base debian | cut -d/ -f3 | sort -u | tail -n5); do - [ $(find debian/*/${p} -name control | wc -l) -ge 1 ] || continue - - cat > test_builds/debian/${p}.properties <> test_builds/debian/${p}.properties - elif [[ $p == foreman* ]] ; then - echo "nightly_jenkins_job=$p-develop-source-release" >> test_builds/debian/${p}.properties - fi -done - -# identify changed dependencies, 5 at most! -for p in $(git diff --name-only HEAD $merge_base dependencies | cut -d/ -f3 | sort -u | tail -n5); do - [ $(find dependencies/*/${p} -name control | wc -l) -ge 1 ] || continue - - cat > test_builds/dependencies/${p}.properties < test_builds/plugins/${p}.properties < test_builds/smart_proxy_plugins/${p}.properties < Date: Wed, 8 May 2024 11:09:26 +0200 Subject: [PATCH 6/7] drop unused plugin_pr_checkout Fixes: 3c38e530e4fc424fcc2c5daccc0a4ff15e465232 --- theforeman.org/scripts/plugin_pr_checkout.sh | 11 ----------- theforeman.org/yaml/builders/plugin_pr_checkout.yaml | 4 ---- 2 files changed, 15 deletions(-) delete mode 100644 theforeman.org/scripts/plugin_pr_checkout.sh delete mode 100644 theforeman.org/yaml/builders/plugin_pr_checkout.yaml diff --git a/theforeman.org/scripts/plugin_pr_checkout.sh b/theforeman.org/scripts/plugin_pr_checkout.sh deleted file mode 100644 index 63c0b250..00000000 --- a/theforeman.org/scripts/plugin_pr_checkout.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -xe - -pushd plugin - -if [ -n "${pr_git_url}" ]; then - git remote add pr ${pr_git_url} - git fetch pr - git merge pr/${pr_git_ref} -fi - -popd diff --git a/theforeman.org/yaml/builders/plugin_pr_checkout.yaml b/theforeman.org/yaml/builders/plugin_pr_checkout.yaml deleted file mode 100644 index 5c753ac1..00000000 --- a/theforeman.org/yaml/builders/plugin_pr_checkout.yaml +++ /dev/null @@ -1,4 +0,0 @@ -- builder: - name: plugin_pr_checkout - builders: - - shell: !include-raw: scripts/plugin_pr_checkout.sh From 10d7abf117ffb25a2520df35045c0645fd5151fb Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 8 May 2024 11:10:08 +0200 Subject: [PATCH 7/7] drop unused clone_repository Fixes: c8741037729b478cb1077a9c60a5af32c271d11d --- theforeman.org/scripts/clone_repository.sh | 4 ---- theforeman.org/yaml/builders/clone_repository.yaml | 4 ---- 2 files changed, 8 deletions(-) delete mode 100644 theforeman.org/scripts/clone_repository.sh delete mode 100644 theforeman.org/yaml/builders/clone_repository.yaml diff --git a/theforeman.org/scripts/clone_repository.sh b/theforeman.org/scripts/clone_repository.sh deleted file mode 100644 index f2c566db..00000000 --- a/theforeman.org/scripts/clone_repository.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -ex - -[ -e plugin ] && rm -rf plugin/ -git clone -b ${plugin_branch} ${plugin_repo} plugin diff --git a/theforeman.org/yaml/builders/clone_repository.yaml b/theforeman.org/yaml/builders/clone_repository.yaml deleted file mode 100644 index 207f671e..00000000 --- a/theforeman.org/yaml/builders/clone_repository.yaml +++ /dev/null @@ -1,4 +0,0 @@ -- builder: - name: clone_repository - builders: - - shell: !include-raw: scripts/clone_repository.sh