From 6836b7605e4eeb113751df652dbeec1fad0317a2 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Thu, 14 Mar 2024 17:51:20 +0100 Subject: [PATCH] Drop Foreman plugin tests Both foreman_hooks and foreman_virt_who_configure have been converted. foreman_default_hostgroup is being worked on, but has been broken for 3 years so nothing is lost there. foreman_setup is being retired and can already be dropped. --- .../foreman-plugins-pull-request.yaml | 75 ------------------- .../jobs/foreman-plugins-pull-request.yaml | 54 ------------- .../plugins/foreman_default_hostgroup.yaml | 6 -- .../yaml/jobs/plugins/foreman_hooks.yaml | 5 -- .../yaml/jobs/plugins/foreman_setup.yaml | 5 -- .../plugins/foreman_virt_who_configure.yaml | 27 ------- 6 files changed, 172 deletions(-) delete mode 100644 theforeman.org/yaml/builders/foreman-plugins-pull-request.yaml delete mode 100644 theforeman.org/yaml/jobs/foreman-plugins-pull-request.yaml delete mode 100644 theforeman.org/yaml/jobs/plugins/foreman_default_hostgroup.yaml delete mode 100644 theforeman.org/yaml/jobs/plugins/foreman_hooks.yaml delete mode 100644 theforeman.org/yaml/jobs/plugins/foreman_setup.yaml delete mode 100644 theforeman.org/yaml/jobs/plugins/foreman_virt_who_configure.yaml diff --git a/theforeman.org/yaml/builders/foreman-plugins-pull-request.yaml b/theforeman.org/yaml/builders/foreman-plugins-pull-request.yaml deleted file mode 100644 index 424e5a1a..00000000 --- a/theforeman.org/yaml/builders/foreman-plugins-pull-request.yaml +++ /dev/null @@ -1,75 +0,0 @@ -- builder: - name: plugin-pull-request - builders: - - shell: |+ - #!/bin/bash -ex - - rm -rf plugin/ - git clone {plugin-repo} plugin - - # check out the pull request - pushd plugin - git fetch --tags --progress {plugin-repo} +refs/pull/${{ghprbPullId}}/*:refs/remotes/origin/pr/${{ghprbPullId}}/* - git checkout -f ${{ghprbActualCommit}} - popd - - TOP_ROOT=`pwd` - APP_ROOT=${{TOP_ROOT}}/foreman - PLUGIN_ROOT=${{TOP_ROOT}}/plugin - - cd ${{APP_ROOT}} - - # setup basic settings file - cp $APP_ROOT/config/settings.yaml.example $APP_ROOT/config/settings.yaml - - # 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 - - if [ "${{ruby}}" = '2.7' ] - then - gem install bundler -v 2.4.22 --no-document - else - gem install bundler --no-document - fi - - bundle install --without development --jobs=5 --retry=5 - - # Database environment - ( - sed "s/^test:/development:/; s/database:.*/database: test-${{gemset}}-dev/" ${{HOME}}/postgresql.db.yaml - echo - sed "s/database:.*/database: test-${{gemset}}/" ${{HOME}}/postgresql.db.yaml - ) > ${{APP_ROOT}}/config/database.yml - - # Create DB first in development as migrate behaviour can change - bundle exec rake db:drop db:create db:migrate - - # 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 - - 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 diff --git a/theforeman.org/yaml/jobs/foreman-plugins-pull-request.yaml b/theforeman.org/yaml/jobs/foreman-plugins-pull-request.yaml deleted file mode 100644 index 678b11a3..00000000 --- a/theforeman.org/yaml/jobs/foreman-plugins-pull-request.yaml +++ /dev/null @@ -1,54 +0,0 @@ -- job-template: - name: '{plugin}-pull-request' - concurrent: true - project-type: matrix - properties: - - github: - url: '{repo}' - - tfm-pull-request-build-discarder - scm: - - git: - url: https://github.com/theforeman/foreman - prune: true - wipe-workspace: true - basedir: 'foreman' - branches: - - develop - triggers: - - github_pr: - context: '{plugin}' - axes: - - axis: - type: user-defined - name: ruby - values: - - '2.7' - - axis: - type: slave - name: label - values: - - fast - wrappers: - - timeout: - type: absolute - abort: true - timeout: 120 - write-description: 'Build timed out (after {{0}} minutes). Marking the build as aborted.' - builders: - - plugin-pull-request: - plugin-name: '{plugin}' - plugin-repo: '{repo}' - publishers: - - gemset_cleanup - - junit: - results: 'foreman/jenkins/reports/unit/*.xml' - -- project: - name: foreman-plugin-pull-request - plugin: - - foreman_default_hostgroup: - repo: 'https://github.com/theforeman/foreman_default_hostgroup' - - foreman_setup: - repo: 'https://github.com/theforeman/foreman_setup' - jobs: - - '{plugin}-pull-request' diff --git a/theforeman.org/yaml/jobs/plugins/foreman_default_hostgroup.yaml b/theforeman.org/yaml/jobs/plugins/foreman_default_hostgroup.yaml deleted file mode 100644 index ee5b3548..00000000 --- a/theforeman.org/yaml/jobs/plugins/foreman_default_hostgroup.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- project: - name: foreman_default_hostgroup - defaults: plugin - branch: develop - jobs: - - 'test_plugin_{name}_{branch}' diff --git a/theforeman.org/yaml/jobs/plugins/foreman_hooks.yaml b/theforeman.org/yaml/jobs/plugins/foreman_hooks.yaml deleted file mode 100644 index 664bd88d..00000000 --- a/theforeman.org/yaml/jobs/plugins/foreman_hooks.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- project: - name: foreman_hooks - defaults: plugin - jobs: - - 'test_plugin_{name}_{branch}' diff --git a/theforeman.org/yaml/jobs/plugins/foreman_setup.yaml b/theforeman.org/yaml/jobs/plugins/foreman_setup.yaml deleted file mode 100644 index 34e90c1f..00000000 --- a/theforeman.org/yaml/jobs/plugins/foreman_setup.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- project: - name: foreman_setup - defaults: plugin - jobs: - - 'test_plugin_{name}_{branch}' diff --git a/theforeman.org/yaml/jobs/plugins/foreman_virt_who_configure.yaml b/theforeman.org/yaml/jobs/plugins/foreman_virt_who_configure.yaml deleted file mode 100644 index 14db301c..00000000 --- a/theforeman.org/yaml/jobs/plugins/foreman_virt_who_configure.yaml +++ /dev/null @@ -1,27 +0,0 @@ -- project: - name: foreman_virt_who_configure - defaults: plugin - parameters: - - string: - name: branch - default: master - description: "Branch to run test suite on" - - pr_parameters - - string: - name: foreman_branch - default: develop - description: "Foreman branch to run test suite against" - - string: - name: foreman_pr_git_url - default: - description: 'Foreman it URL to PR to test, e.g. https://github.com/user/foo.git' - - string: - name: foreman_pr_git_ref - default: - description: 'Foreman Git ref for PR to test, usually the branch name' - jobs: - - 'test_plugin_{name}_{branch}' - builders: - - clone_foreman - - test_katello - - test_foreman_virt_who_configure