diff --git a/README.md b/README.md index 134c6bcd..0ef59f8e 100644 --- a/README.md +++ b/README.md @@ -78,25 +78,6 @@ Current PR test jobs (used on Foreman itself) support these commands: * `ok to test` - run tests for an unknown user, if the code within the patch is not malicious * `[test STATUS-NAME]`, e.g. `[test foreman]` to re-run a particular set of tests -## Quick reference for plugin maintainers - -### Smart proxy plugin testing - -Proxy plugins are tested like ordinary gems with tests run entirely from the plugin directory, installing the smart proxy as a dependency (via bundler's git support). - -To add testing for a plugin `smart_proxy_example` do the following: - -* ensure plugin tests run when doing `bundle install` and `rake test`, see [testing a plugin](https://projects.theforeman.org/projects/foreman/wiki/How_to_Create_a_Smart-Proxy_Plugin#Testing) for help -* if different branches rely on different versions of smart proxy, specify `:branch` in Gemfile on those branches -* add the project in [theforeman.org/yaml/jobs/smart-proxy-plugin.yaml](https://github.com/theforeman/jenkins-jobs/tree/master/theforeman.org/yaml/jobs/smart-proxy-plugin.yaml) to create a `smart-proxy-example-test` job in Jenkins to test the master branch. -* add the project in [theforeman.org/yaml/jobs/smart-proxy-plugin-pr-test.yaml](https://github.com/theforeman/jenkins-jobs/tree/master/theforeman.org/yaml/jobs/tests/smart-proxy-plugin-pr-test.yaml) to create a `smart_proxy_example-pr-test` job in Jenkins to test PRs. -* ensure the job is green by fixing bugs, installing dependencies etc. -* add hook to GitHub repo, see [GitHub repo hook](#testing-develop) - -An org admin must then: - -* add the repo to the [Bots team](https://github.com/orgs/theforeman/teams/bots/repositories) with **write** access - # Foreman's Other Tests Jenkins is not the only place tests are defined and executed. diff --git a/theforeman.org/yaml/builders/smart-proxy-plugin.yaml b/theforeman.org/yaml/builders/smart-proxy-plugin.yaml deleted file mode 100644 index 44757265..00000000 --- a/theforeman.org/yaml/builders/smart-proxy-plugin.yaml +++ /dev/null @@ -1,18 +0,0 @@ -- builder: - name: smart-proxy-plugin - builders: - - shell: |+ - #!/bin/bash -ex - - export PATH="$HOME/.rbenv/shims:$PATH" - export RBENV_VERSION=${{ruby}} - - if [ "${{ruby}}" = '2.7.6' ] - then - gem install bundler -v 2.4.22 --no-document - else - gem install bundler --no-document - fi - - bundle install --retry 5 --jobs 5 - bundle exec rake TESTOPTS="--verbose" diff --git a/theforeman.org/yaml/jobs/smart-proxy-plugin-pull-request.yaml b/theforeman.org/yaml/jobs/smart-proxy-plugin-pull-request.yaml deleted file mode 100644 index b4a8af1b..00000000 --- a/theforeman.org/yaml/jobs/smart-proxy-plugin-pull-request.yaml +++ /dev/null @@ -1,41 +0,0 @@ -- job-template: - name: 'smart-proxy-{plugin}-pull-request' - concurrent: true - project-type: matrix - properties: - - github: - url: 'https://github.com/theforeman/smart_proxy_{plugin}' - - tfm-pull-request-build-discarder - scm: - - git: - url: 'https://github.com/theforeman/smart_proxy_{plugin}' - wipe-workspace: true - prune: true - branches: - - '${{ghprbActualCommit}}' - refspec: '+refs/pull/${{ghprbPullId}}/*:refs/remotes/origin/pr/${{ghprbPullId}}/*' - triggers: - - github_pr: - context: 'smart_proxy_{plugin}' - wrappers: - - timeout: - type: absolute - abort: true - timeout: 60 - write-description: 'Build timed out (after {{0}} minutes). Marking the build as aborted.' - axes: - - axis: - type: user-defined - name: ruby - values: - - '2.7.6' - builders: - - smart-proxy-plugin - - -- project: - name: smart-proxy-plugin-pull-request - plugin: - - ansible - jobs: - - 'smart-proxy-{plugin}-pull-request' diff --git a/theforeman.org/yaml/jobs/smart-proxy-plugin.yaml b/theforeman.org/yaml/jobs/smart-proxy-plugin.yaml deleted file mode 100644 index 45acbfce..00000000 --- a/theforeman.org/yaml/jobs/smart-proxy-plugin.yaml +++ /dev/null @@ -1,50 +0,0 @@ -- job-template: - name: 'smart-proxy-{plugin}-test' - concurrent: true - project-type: matrix - properties: - - github: - url: 'https://github.com/theforeman/smart_proxy_{plugin}' - scm: - - git: - url: 'https://github.com/theforeman/smart_proxy_{plugin}' - wipe-workspace: true - prune: true - branches: - - '{branch|master}' # default to 'master' if branch not set - triggers: - - github - - pollscm: - cron: 'H/15 * * * *' - - timed: 'H H * * H' - wrappers: - - timeout: - type: absolute - abort: true - timeout: 60 - write-description: 'Build timed out (after {{0}} minutes). Marking the build as aborted.' - axes: - - axis: - type: user-defined - name: ruby - values: - - '2.7.6' - builders: - - smart-proxy-plugin - - -- project: - name: smart-proxy-plugin - plugin: - - ansible - - dhcp_infoblox - - dhcp_remote_isc - - dns_infoblox - - discovery: - branch: develop # have to be the special child - - monitoring - - omaha - - pulp - - salt - jobs: - - 'smart-proxy-{plugin}-test' diff --git a/theforeman.org/yaml/jobs/tests/smart-proxy-plugin-pr-test.yaml b/theforeman.org/yaml/jobs/tests/smart-proxy-plugin-pr-test.yaml deleted file mode 100644 index 2c744838..00000000 --- a/theforeman.org/yaml/jobs/tests/smart-proxy-plugin-pr-test.yaml +++ /dev/null @@ -1,32 +0,0 @@ -- job-template: - name: 'smart_proxy_{plugin}-pr-test' - concurrent: true - sandbox: true - project-type: pipeline - properties: - - github: - url: 'https://github.com/theforeman/smart_proxy_{plugin}' - - tfm-pull-request-build-discarder - triggers: - - github_pr: - context: 'smart_proxy_{plugin}' - dsl: - !include-raw-verbatim: - - pipelines/lib/git.groovy{empty} - - pipelines/lib/rbenv.groovy{empty} - - pipelines/test/smart-proxy.groovy{empty} - -- project: - name: smart_proxy_plugin_pr_test - plugin: - - dhcp_infoblox - - dhcp_remote_isc - - discovery - - dns_infoblox - - monitoring - - omaha - - pulp - - salt - jobs: - - 'smart_proxy_{plugin}-pr-test' - empty: ''