jenkins_api_client 1.4.5 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/jenkins_api_client.gemspec +15 -136
  3. data/lib/jenkins_api_client/version.rb +2 -2
  4. metadata +6 -180
  5. data/.gitignore +0 -41
  6. data/.jenkins.yml +0 -9
  7. data/.travis.yml +0 -15
  8. data/CHANGELOG.md +0 -391
  9. data/CONTRIBUTORS.md +0 -3
  10. data/Gemfile +0 -20
  11. data/LICENCE +0 -21
  12. data/README.md +0 -454
  13. data/Rakefile +0 -107
  14. data/Vagrantfile +0 -83
  15. data/config/login.yml.example +0 -27
  16. data/jenkins_api_client_class_diagram.png +0 -0
  17. data/scripts/login_with_irb.rb +0 -54
  18. data/scripts/login_with_pry.rb +0 -54
  19. data/spec/func_tests/client_spec.rb +0 -109
  20. data/spec/func_tests/job_spec.rb +0 -669
  21. data/spec/func_tests/node_spec.rb.pending +0 -217
  22. data/spec/func_tests/plugin_spec.rb +0 -148
  23. data/spec/func_tests/spec_helper.rb +0 -41
  24. data/spec/func_tests/system_spec.rb +0 -84
  25. data/spec/func_tests/user_spec.rb +0 -49
  26. data/spec/func_tests/view_spec.rb +0 -276
  27. data/spec/unit_tests/build_queue_spec.rb +0 -152
  28. data/spec/unit_tests/client_spec.rb +0 -471
  29. data/spec/unit_tests/fake_http_response.rb +0 -9
  30. data/spec/unit_tests/fixtures/files/available_plugins.json +0 -1
  31. data/spec/unit_tests/fixtures/files/computer_sample.xml +0 -17
  32. data/spec/unit_tests/fixtures/files/installed_plugins.json +0 -1
  33. data/spec/unit_tests/fixtures/files/job_sample.xml +0 -16
  34. data/spec/unit_tests/fixtures/files/updatable_plugins.json +0 -1
  35. data/spec/unit_tests/job_spec.rb +0 -783
  36. data/spec/unit_tests/node_spec.rb +0 -342
  37. data/spec/unit_tests/plugin_settings/colllection_spec.rb +0 -62
  38. data/spec/unit_tests/plugin_settings/hipchat_spec.rb +0 -44
  39. data/spec/unit_tests/plugin_settings/workspace_cleanup_spec.rb +0 -31
  40. data/spec/unit_tests/plugin_spec.rb +0 -165
  41. data/spec/unit_tests/spec_helper.rb +0 -19
  42. data/spec/unit_tests/system_spec.rb +0 -76
  43. data/spec/unit_tests/user_spec.rb +0 -144
  44. data/spec/unit_tests/view_spec.rb +0 -149
  45. data/travis/hudson.model.UpdateCenter.xml +0 -7
  46. data/travis/jenkins_config.xml +0 -63
  47. data/travis/jenkins_config_with_crumb.xml +0 -67
  48. data/travis/setup.sh +0 -23
  49. data/travis/setup_crumb.sh +0 -11
  50. data/travis/spec.yml +0 -14
  51. data/travis/user_config.xml +0 -29
@@ -1,9 +0,0 @@
1
- class FakeResponse
2
- attr_accessor :code, :body, :header
3
-
4
- def initialize(code=200, body='eww, a body', header={})
5
- @body = body
6
- @code = code.to_s
7
- @header = header
8
- end
9
- end
@@ -1 +0,0 @@
1
- {"availables":[{"name":"accurev","version":"0.6.18"},{"name":"active-directory","version":"1.33"},{"name":"AdaptivePlugin","version":"0.1"},{"name":"additional-identities-plugin","version":"1.0"},{"name":"all-changes","version":"1.3"},{"name":"analysis-collector","version":"1.35"},{"name":"analysis-core","version":"1.49"},{"name":"AnchorChain","version":"1.0"},{"name":"android-emulator","version":"2.10"},{"name":"android-lint","version":"2.1"},{"name":"ansicolor","version":"0.3.1"},{"name":"AntepediaReporter-CI-plugin","version":"1.6.3"},{"name":"antexec","version":"1.8"},{"name":"any-buildstep","version":"0.1"},{"name":"anything-goes-formatter","version":"1.0"},{"name":"appaloosa-plugin","version":"1.4.0"},{"name":"appdynamics-dashboard","version":"1.0.1"},{"name":"application-director-plugin","version":"1.3"},{"name":"artifact-diff-plugin","version":"1.2"},{"name":"artifactdeployer","version":"0.27"},{"name":"artifactory","version":"2.1.6"},{"name":"asakusa-satellite-plugin","version":"0.1.1"},{"name":"assembla","version":"1.4"},{"name":"assembla-auth","version":"1.03"},{"name":"associated-files","version":"0.2.1"},{"name":"async-http-client","version":"1.7.8"},{"name":"async-job","version":"1.3"},{"name":"audit-trail","version":"1.8"},{"name":"audit2db","version":"0.5"},{"name":"avatar","version":"1.2"},{"name":"backlog","version":"1.9"},{"name":"backup","version":"1.6.1"},{"name":"backup-interrupt-plugin","version":"1.0"},{"name":"bamboo-notifier","version":"1.1"},{"name":"batch-task","version":"1.17"},{"name":"bazaar","version":"1.22"},{"name":"beer","version":"1.2"},{"name":"bitbucket-oauth","version":"0.1"},{"name":"bitkeeper","version":"1.7"},{"name":"blame-upstream-commiters","version":"1.2"},{"name":"BlameSubversion","version":"1.200"},{"name":"BlazeMeterJenkinsPlugin","version":"1.04-beta-1"},{"name":"blink1","version":"1.1"},{"name":"blitz_io-jenkins","version":"1.04"},{"name":"brakeman","version":"0.7"},{"name":"browser-axis-plugin","version":"1.0"},{"name":"bruceschneier","version":"0.1"},{"name":"buckminster","version":"1.1.1"},{"name":"buddycloud","version":"0.2.3"},{"name":"bugzilla","version":"1.5"},{"name":"build-alias-setter","version":"0.1"},{"name":"build-blocker-plugin","version":"1.4.1"},{"name":"build-cause-run-condition","version":"0.1"},{"name":"build-failure-analyzer","version":"1.5.0"},{"name":"build-flow-plugin","version":"0.9"},{"name":"build-keeper-plugin","version":"1.3"},{"name":"build-metrics","version":"1.0"},{"name":"build-name-setter","version":"1.3"},{"name":"build-node-column","version":"0.1"},{"name":"build-pipeline-plugin","version":"1.3.4.1"},{"name":"build-publisher","version":"1.17"},{"name":"build-timeout","version":"1.11"},{"name":"build-token-root","version":"1.0"},{"name":"build-user-vars-plugin","version":"1.1"},{"name":"build-view-column","version":"0.1"},{"name":"build-with-parameters","version":"1.1"},{"name":"buildcoin-plugin","version":"1.4"},{"name":"buildcontext-capture","version":"0.6"},{"name":"buildheroes","version":"0.2"},{"name":"buildresult-trigger","version":"0.12"},{"name":"buildtriggerbadge","version":"1.0"},{"name":"built-on-column","version":"1.1"},{"name":"bulk-builder","version":"1.5"},{"name":"caliper-ci","version":"2.3"},{"name":"call-remote-job-plugin","version":"1.0.16"},{"name":"campfire","version":"2.6"},{"name":"caroline","version":"1.0"},{"name":"cas-plugin","version":"1.1.1"},{"name":"cas1","version":"1.0.1"},{"name":"categorized-view","version":"1.0"},{"name":"cccc","version":"0.6"},{"name":"ccm","version":"3.0"},{"name":"changelog-history","version":"1.3"},{"name":"changes-since-last-success","version":"0.5"},{"name":"checkstyle","version":"3.35"},{"name":"chosen","version":"1.0"},{"name":"chrome-frame-plugin","version":"1.1"},{"name":"chromedriver","version":"1.0"},{"name":"chucknorris","version":"0.5"},{"name":"ci-game","version":"1.19"},{"name":"claim","version":"2.2"},{"name":"clamav","version":"0.2.1"},{"name":"clang-scanbuild-plugin","version":"1.4"},{"name":"clearcase","version":"1.3.14"},{"name":"clearcase-release","version":"0.3"},{"name":"clearcase-ucm-baseline","version":"1.7.4"},{"name":"clearcase-ucm-plugin","version":"1.3.8"},{"name":"clone-workspace-scm","version":"0.5"},{"name":"cloudbees-deployer-plugin","version":"1.7"},{"name":"cloudbees-enterprise-plugins","version":"13.5.0"},{"name":"cloudbees-plugin-gateway","version":"4.0"},{"name":"cloudtest","version":"2.4"},{"name":"clover","version":"4.0.6"},{"name":"cloverphp","version":"0.3.3"},{"name":"cluster-stats","version":"0.4.4"},{"name":"cmakebuilder","version":"1.9"},{"name":"cmvc","version":"0.4"},{"name":"cobertura","version":"1.9.1"},{"name":"cocoapods-integration","version":"0.2.0"},{"name":"codecover","version":"1.1"},{"name":"codescanner","version":"0.11"},{"name":"collabnet","version":"1.1.8"},{"name":"collabnet-uc4-deploy","version":"1.0"},{"name":"collapsing-console-sections","version":"1.3"},{"name":"ColumnPack-plugin","version":"1.0.3"},{"name":"ColumnsPlugin","version":"1.0"},{"name":"compact-columns","version":"1.9"},{"name":"computer-queue-plugin","version":"1.3"},{"name":"concordionpresenter","version":"0.7"},{"name":"conditional-buildstep","version":"1.2.2"},{"name":"config-autorefresh-plugin","version":"1.0"},{"name":"config-file-provider","version":"2.5.1"},{"name":"config-rotator","version":"1.1.1"},{"name":"configurationslicing","version":"1.37"},{"name":"configure-job-column-plugin","version":"1.0"},{"name":"confluence-publisher","version":"1.8"},{"name":"console-column-plugin","version":"1.5"},{"name":"copy-data-to-workspace-plugin","version":"1.0"},{"name":"copy-project-link","version":"1.1"},{"name":"copy-to-slave","version":"1.4"},{"name":"copyartifact","version":"1.27"},{"name":"countjobs-viewstabbar","version":"1.0.0"},{"name":"covcomplplot","version":"1.1.1"},{"name":"coverity","version":"1.2.5"},{"name":"cppcheck","version":"1.13"},{"name":"cppncss","version":"1.1"},{"name":"cpptest","version":"0.9"},{"name":"crap4j","version":"0.8"},{"name":"create-fingerprint","version":"1.2"},{"name":"create-fingerprint-plugin","version":"1.0"},{"name":"createjobadvanced","version":"1.7"},{"name":"crittercism-dsym","version":"1.1"},{"name":"cron_column","version":"1.003"},{"name":"crowd","version":"1.2"},{"name":"crowd2","version":"1.5"},{"name":"cucumber","version":"0.0.2"},{"name":"cucumber-reports","version":"0.0.21"},{"name":"custom-job-icon","version":"0.2"},{"name":"custom-tools-plugin","version":"0.2"},{"name":"CustomHistory","version":"1.5"},{"name":"cvs-tag","version":"1.7"},{"name":"cygpath","version":"1.5"},{"name":"darcs","version":"0.3.11"},{"name":"dashboard-view","version":"2.7"},{"name":"database","version":"1.1"},{"name":"database-drizzle","version":"1.0"},{"name":"database-h2","version":"1.0"},{"name":"database-mysql","version":"1.0"},{"name":"database-postgresql","version":"1.0"},{"name":"datical-db-plugin","version":"1.0.4"},{"name":"dbCharts","version":"0.4"},{"name":"debian-package-builder","version":"1.4.2"},{"name":"delete-log-plugin","version":"1.0"},{"name":"delta-cloud","version":"1.0.1"},{"name":"dependency-queue-plugin","version":"1.1"},{"name":"dependencyanalyzer","version":"0.6"},{"name":"depgraph-view","version":"0.11"},{"name":"deploy","version":"1.9"},{"name":"deploy-websphere","version":"1.0"},{"name":"deployed-on-column","version":"1.7"},{"name":"deploygate-plugin","version":"1.2"},{"name":"description-column-plugin","version":"1.3"},{"name":"description-setter","version":"1.8"},{"name":"devstack","version":"0.0.6"},{"name":"dimensionsscm","version":"0.8.1"},{"name":"discard-old-build","version":"1.05"},{"name":"disk-usage","version":"0.20"},{"name":"display-upstream-changes","version":"0.1"},{"name":"distfork","version":"1.3"},{"name":"distTest","version":"1.0"},{"name":"doclinks","version":"0.5"},{"name":"dos-trigger","version":"1.23"},{"name":"downstream-buildview","version":"1.8"},{"name":"downstream-ext","version":"1.8"},{"name":"doxygen","version":"0.13"},{"name":"drmemory-plugin","version":"0.1.1"},{"name":"dropdown-viewstabbar-plugin","version":"1.6"},{"name":"dry","version":"2.34"},{"name":"dry-run","version":"0.9"},{"name":"dtkit","version":"1.12"},{"name":"dumpinfo-buildwrapper-plugin","version":"1.1"},{"name":"dynamic-axis","version":"1.0.1"},{"name":"dynamicparameter","version":"0.2.0"},{"name":"easyant","version":"1.1"},{"name":"ec2","version":"1.18"},{"name":"eclipse-update-site","version":"1.2"},{"name":"eggplant-plugin","version":"1.4"},{"name":"elastic-axis","version":"1.1"},{"name":"elOyente","version":"1.2"},{"name":"email-ext","version":"2.30.2"},{"name":"email-ext-recipients-column","version":"1.0"},{"name":"embeddable-build-status","version":"1.4"},{"name":"emma","version":"1.29"},{"name":"emmacoveragecolumn","version":"0.0.4"},{"name":"emotional-hudson","version":"1.3"},{"name":"emotional-jenkins-plugin","version":"1.1"},{"name":"enhanced-old-build-discarder","version":"1.0"},{"name":"envfile","version":"1.2"},{"name":"envinject","version":"1.87"},{"name":"environment-script","version":"1.1.2"},{"name":"escaped-markup-plugin","version":"0.1"},{"name":"excludeMatrixParent","version":"1.1"},{"name":"Exclusion","version":"0.8"},{"name":"exclusive-execution","version":"0.7"},{"name":"exclusive-label-plugin","version":"1.0"},{"name":"extended-choice-parameter","version":"0.28"},{"name":"extended-read-permission","version":"1.0"},{"name":"extensible-choice-parameter","version":"1.2.1"},{"name":"extension-filter","version":"1.0"},{"name":"external-scheduler","version":"1.0"},{"name":"externalresource-dispatcher","version":"1.1.0"},{"name":"extra-columns","version":"1.9"},{"name":"extreme-feedback","version":"1.2"},{"name":"ezwall","version":"0.2"},{"name":"fail-the-build-plugin","version":"1.0"},{"name":"favorite","version":"1.14"},{"name":"favorite-view","version":"1.0"},{"name":"feature-branch-notifier","version":"1.1"},{"name":"file-leak-detector","version":"1.2"},{"name":"files-found-trigger","version":"1.3"},{"name":"filesystem_scm","version":"1.20"},{"name":"findbugs","version":"4.48"},{"name":"fitnesse","version":"1.8"},{"name":"flashlog-plugin","version":"1.0"},{"name":"flexible-publish","version":"0.10"},{"name":"flexteam","version":"1.1"},{"name":"flow","version":"1.1"},{"name":"fogbugz","version":"1.0"},{"name":"form-element-path","version":"1.4"},{"name":"fortify360","version":"3.81"},{"name":"fstrigger","version":"0.36"},{"name":"ftppublisher","version":"1.2"},{"name":"fxcop-runner","version":"1.1"},{"name":"gallio","version":"1.6"},{"name":"gant","version":"1.2"},{"name":"gatling","version":"1.0.3"},{"name":"gcal","version":"0.4"},{"name":"gcm-notification","version":"1.0"},{"name":"gearman-plugin","version":"0.0.1"},{"name":"gerrit","version":"0.7"},{"name":"gerrit-trigger","version":"2.10.1"},{"name":"ghprb","version":"1.8"},{"name":"girls","version":"1.0.0"},{"name":"git","version":"1.4.0"},{"name":"git-chooser-alternative","version":"1.0"},{"name":"git-client","version":"1.0.7"},{"name":"git-notes","version":"0.0.4"},{"name":"git-parameter","version":"0.2"},{"name":"git-server","version":"1.1"},{"name":"git-userContent","version":"1.3"},{"name":"github","version":"1.6"},{"name":"github-api","version":"1.42"},{"name":"github-oauth","version":"0.13.1"},{"name":"github-sqs-plugin","version":"1.5"},{"name":"gitlab-hook","version":"0.2.6"},{"name":"gitlab-merge-request-jenkins","version":"1.1.1"},{"name":"gitorious","version":"1.0"},{"name":"global-build-stats","version":"1.3"},{"name":"global-variable-string-parameter","version":"1.1"},{"name":"gnat","version":"0.14"},{"name":"googleanalytics","version":"1.3"},{"name":"googlecode","version":"1.7"},{"name":"gradle","version":"1.22"},{"name":"grails","version":"1.6.3"},{"name":"gravatar","version":"1.1"},{"name":"greenballs","version":"1.12"},{"name":"grinder","version":"1.4"},{"name":"groovy","version":"1.13"},{"name":"groovy-label-assignment","version":"1.0.0"},{"name":"groovy-postbuild","version":"1.8"},{"name":"groovy-remote","version":"0.2"},{"name":"groovyaxis","version":"0.3"},{"name":"growl","version":"1.1"},{"name":"hadoop","version":"1.4"},{"name":"harvest","version":"0.5"},{"name":"heavy-job","version":"1.0"},{"name":"heroku-jenkins-plugin","version":"0.7.1-BETA"},{"name":"hgca","version":"1.3"},{"name":"hipchat","version":"0.1.4"},{"name":"hipchat-plugin","version":"0.1.0"},{"name":"hockeyapp","version":"1.0.4"},{"name":"hp-application-automation-tools-plugin","version":"2.0.0"},{"name":"hp-operations-orchestration-automation-execution-plugin","version":"1.0.11"},{"name":"hsts-filter-plugin","version":"1.0"},{"name":"html-audio-notifier","version":"0.4"},{"name":"html5-notifier-plugin","version":"1.2"},{"name":"htmlpublisher","version":"1.2"},{"name":"http_request","version":"1.8"},{"name":"hudson-logaction-plugin","version":"1.1"},{"name":"hudson-pview-plugin","version":"1.8"},{"name":"hudson-wsclean-plugin","version":"1.0.4"},{"name":"hudsontrayapp","version":"0.7.3"},{"name":"humbug","version":"0.1.1"},{"name":"icescrum","version":"1.0.2"},{"name":"ikachan","version":"0.0.1"},{"name":"image-gallery","version":"1.0"},{"name":"instant-messaging","version":"1.25"},{"name":"integrity-plugin","version":"1.17"},{"name":"ion-deployer-plugin","version":"0.9"},{"name":"ios-device-connector","version":"1.2"},{"name":"iphoneview","version":"0.2"},{"name":"ipmessenger-plugin","version":"1.2"},{"name":"ircbot","version":"2.23"},{"name":"ivy","version":"1.22"},{"name":"ivy-report","version":"1.2"},{"name":"ivytrigger","version":"0.28"},{"name":"jabber","version":"1.25"},{"name":"jacoco","version":"1.0.12"},{"name":"japex","version":"1.7"},{"name":"javancss","version":"1.1"},{"name":"javanet","version":"1.3"},{"name":"javanet-uploader","version":"1.7"},{"name":"javatest-report","version":"1.4"},{"name":"jboss","version":"1.0.5"},{"name":"jbpm-embedded-plugin","version":"0.2"},{"name":"jbpm-workflow-plugin","version":"0.3"},{"name":"jcaptcha-plugin","version":"1.1"},{"name":"jclouds-jenkins","version":"2.3.1"},{"name":"jdepend","version":"1.2.3"},{"name":"jenkins-cloudformation-plugin","version":"0.11"},{"name":"jenkins-flowdock-plugin","version":"1.1.2"},{"name":"jenkins-jira-issue-updater","version":"1.3"},{"name":"jenkins-leiningen","version":"0.5.1"},{"name":"jenkins-multijob-plugin","version":"1.9"},{"name":"jenkins-tag-cloud-plugin","version":"1.6"},{"name":"jenkins-testswarm-plugin","version":"1.2"},{"name":"jenkins-tracker","version":"0.1.0"},{"name":"jenkinswalldisplay","version":"0.6.17"},{"name":"jenkinswalldisplay-pom","version":"0.6.2"},{"name":"jenkow-activiti-designer","version":"0.3.1"},{"name":"jenkow-activiti-explorer","version":"0.3.1"},{"name":"jenkow-plugin","version":"0.3.1"},{"name":"jigomerge","version":"0.7"},{"name":"jira","version":"1.37"},{"name":"JiraTestResultReporter","version":"1.0.4"},{"name":"job-direct-mail","version":"1.5"},{"name":"job-dsl","version":"1.15"},{"name":"job-exporter","version":"0.4"},{"name":"job-import-plugin","version":"1.0"},{"name":"job-log-logger-plugin","version":"1.0"},{"name":"job-node-stalker","version":"1.0.1"},{"name":"job-parameter-summary","version":"0.1"},{"name":"job-poll-action-plugin","version":"1.0"},{"name":"job-strongauth-simple","version":"0.5"},{"name":"jobConfigHistory","version":"2.4"},{"name":"jobcopy-builder","version":"1.1.0"},{"name":"jobgenerator","version":"1.14"},{"name":"jobrequeue","version":"1.0"},{"name":"jobrevision","version":"0.6"},{"name":"jobtype-column","version":"1.3"},{"name":"join","version":"1.15"},{"name":"jprt","version":"1.1"},{"name":"jqs-monitoring","version":"1.2"},{"name":"jquery","version":"1.7.2-1"},{"name":"jquery-ui","version":"1.0.2"},{"name":"jsgames","version":"0.2"},{"name":"jshint-checkstyle","version":"3.36"},{"name":"jslint","version":"0.8.0"},{"name":"jslint-checkstyle","version":"3.35"},{"name":"jsoup","version":"1.6.3"},{"name":"jsunit","version":"1.5"},{"name":"jswidgets","version":"1.10"},{"name":"junit-attachments","version":"1.3"},{"name":"jython","version":"1.9"},{"name":"kagemai","version":"1.3"},{"name":"karotz","version":"0.2"},{"name":"keepSlaveOffline","version":"1.0"},{"name":"keyboard-shortcuts-plugin","version":"1.2"},{"name":"klaros-testmanagement","version":"1.4"},{"name":"klocwork","version":"1.15"},{"name":"kundo","version":"0.2"},{"name":"label-verifier","version":"1.0"},{"name":"labeled-test-groups-publisher","version":"1.2.6"},{"name":"labmanager","version":"0.2.8"},{"name":"lastfailureversioncolumn","version":"1.1"},{"name":"lastsuccessdescriptioncolumn","version":"1.0"},{"name":"lastsuccessversioncolumn","version":"1.1"},{"name":"LavaLampNotifier","version":"1.4"},{"name":"ldapemail","version":"0.7"},{"name":"leastload","version":"1.0.3"},{"name":"lechat","version":"0.1.3"},{"name":"leiningen-plugin","version":"0.5.5"},{"name":"libvirt-slave","version":"1.8.1"},{"name":"lingr-plugin","version":"0.1"},{"name":"list-command","version":"0.2"},{"name":"liverebel-deploy","version":"2.5.5"},{"name":"livescreenshot","version":"1.4.4"},{"name":"loaderio-jenkins-plugin","version":"1.0.1"},{"name":"locale","version":"1.2"},{"name":"locked-files-report","version":"1.6"},{"name":"locks-and-latches","version":"0.6"},{"name":"log-command","version":"1.0.1"},{"name":"log-parser","version":"1.0.8"},{"name":"logaction-plugin","version":"1.2"},{"name":"logfilesizechecker","version":"1.0"},{"name":"logging","version":"0.2.8"},{"name":"logstash","version":"0.8.0"},{"name":"lotus-connections-plugin","version":"1.23"},{"name":"m2-extra-steps","version":"1.1.7"},{"name":"m2-repo-reaper","version":"1.0"},{"name":"m2release","version":"0.10.0"},{"name":"mail-watcher-plugin","version":"1.4"},{"name":"mailcommander","version":"1.0.0"},{"name":"managed-scripts","version":"1.1"},{"name":"mantis","version":"0.25"},{"name":"mask-passwords","version":"2.7.2"},{"name":"matrix-reloaded","version":"1.1.1"},{"name":"Matrix-sorter-plugin","version":"1.1"},{"name":"matrixtieparent","version":"1.2"},{"name":"maven-dependency-update-trigger","version":"1.4"},{"name":"maven-deployment-linker","version":"1.5.1"},{"name":"maven-info","version":"0.0.4"},{"name":"maven-invoker-plugin","version":"1.2"},{"name":"maven-metadata-plugin","version":"1.0.0"},{"name":"maven-release-cascade","version":"1.3.2"},{"name":"maven-repo-cleaner","version":"1.2"},{"name":"measurement-plots","version":"0.1"},{"name":"memegen","version":"0.4.3"},{"name":"memory-map","version":"1.0.1"},{"name":"mercurial","version":"1.46"},{"name":"metadata","version":"1.0b"},{"name":"mock-security-realm","version":"1.0"},{"name":"mock-slave","version":"1.1"},{"name":"mogotest","version":"0.1.0"},{"name":"mongodb","version":"1.3"},{"name":"mongodb-document-upload","version":"1.0"},{"name":"monitoring","version":"1.45.0"},{"name":"monkit-plugin","version":"0.2.6"},{"name":"mozmill","version":"1.3"},{"name":"msbuild","version":"1.18"},{"name":"mstest","version":"0.7"},{"name":"mstestrunner","version":"1.0.1"},{"name":"mttr","version":"1.1"},{"name":"multi-module-tests-publisher","version":"1.32"},{"name":"multi-slave-config-plugin","version":"1.0.0"},{"name":"multiline-tabbar-plugin","version":"1.1"},{"name":"multiple-scms","version":"0.2"},{"name":"mysql-auth","version":"1.0"},{"name":"nabaztag","version":"1.9"},{"name":"naginator","version":"1.8"},{"name":"nant","version":"1.4.3"},{"name":"ncover","version":"0.3"},{"name":"nerrvana-plugin","version":"1.02.01"},{"name":"nested-view","version":"1.10"},{"name":"netio-plugin","version":"1.4"},{"name":"network-monitor","version":"1.1"},{"name":"next-build-number","version":"1.0"},{"name":"next-executions","version":"1.0.5"},{"name":"nexus-task-runner","version":"0.9.2"},{"name":"nis-notification-lamp","version":"1.131"},{"name":"nodejs","version":"0.1"},{"name":"nodelabelparameter","version":"1.4"},{"name":"nodenamecolumn","version":"1.1"},{"name":"nodeofflinenotification","version":"1.0.3"},{"name":"nopmdcheck","version":"0.9"},{"name":"nopmdverifytrac","version":"0.9"},{"name":"notification","version":"1.5"},{"name":"notifo","version":"1.0.1"},{"name":"nsiqcollector","version":"1.3.3"},{"name":"nuget","version":"0.3"},{"name":"nunit","version":"0.14"},{"name":"offlineonfailure-plugin","version":"1.0"},{"name":"openid","version":"1.6"},{"name":"openJDK-native-plugin","version":"1.0"},{"name":"openscada-jenkins-exporter","version":"0.0.2"},{"name":"origo-issue-notifier","version":"1.1"},{"name":"oslc-cm","version":"1.31"},{"name":"otabuilder","version":"0.2.3"},{"name":"parallel-test-executor","version":"1.0"},{"name":"parameterized-trigger","version":"2.18"},{"name":"patch-parameter","version":"1.0"},{"name":"pathignore","version":"0.6"},{"name":"pegdown-formatter","version":"1.3"},{"name":"pending-changes","version":"0.3.0"},{"name":"people-redirector","version":"1.3"},{"name":"perforce","version":"1.3.24"},{"name":"performance","version":"1.8"},{"name":"perfpublisher","version":"7.97"},{"name":"periodic-reincarnation","version":"1.2"},{"name":"periodicbackup","version":"1.3"},{"name":"perl","version":"0.0.4"},{"name":"persona","version":"2.3"},{"name":"phing","version":"0.13.1"},{"name":"php","version":"1.0"},{"name":"piwikanalytics","version":"1.1.0"},{"name":"plasticscm-plugin","version":"2.0"},{"name":"platformlabeler","version":"1.1"},{"name":"play-autotest-plugin","version":"0.0.12"},{"name":"plot","version":"1.5"},{"name":"pmd","version":"3.34"},{"name":"polarion","version":"1.3"},{"name":"pollscm","version":"1.2"},{"name":"port-allocator","version":"1.5"},{"name":"postbuild-task","version":"1.8"},{"name":"postbuildscript","version":"0.12"},{"name":"powershell","version":"1.2"},{"name":"pragprog","version":"1.0.4"},{"name":"prereq-buildstep","version":"1.1"},{"name":"preSCMbuildstep","version":"0.2"},{"name":"pretest-commit","version":"0.4"},{"name":"pretested-integration","version":"0.0.4"},{"name":"PrioritySorter","version":"1.3"},{"name":"progress-bar-column-plugin","version":"1.0"},{"name":"project-description-setter","version":"1.1"},{"name":"project-health-report","version":"1.2"},{"name":"project-stats-plugin","version":"0.4"},{"name":"promoted-builds","version":"2.11"},{"name":"promoted-builds-simple","version":"1.9"},{"name":"prqa-plugin","version":"1.2.0"},{"name":"pry","version":"1.1"},{"name":"publish-over-cifs","version":"0.2"},{"name":"publish-over-ftp","version":"1.9"},{"name":"publish-over-ssh","version":"1.10"},{"name":"purge-build-queue-plugin","version":"1.0"},{"name":"pvcs_scm","version":"1.1"},{"name":"pwauth","version":"0.4"},{"name":"pxe","version":"1.5"},{"name":"pyenv","version":"0.0.4"},{"name":"python","version":"1.2"},{"name":"qc","version":"1.2.1"},{"name":"r","version":"0.2"},{"name":"rabbitmq-build-trigger","version":"1.5"},{"name":"rabbitmq-consumer","version":"1.5"},{"name":"rad-builder","version":"1.1.4"},{"name":"radiatorviewplugin","version":"1.13"},{"name":"rake","version":"1.7.7"},{"name":"rally-update-plugin-1","version":"1.2"},{"name":"random-string-parameter","version":"1.0"},{"name":"rbenv","version":"0.0.14"},{"name":"read-only-configurations","version":"1.7"},{"name":"rebuild","version":"1.19"},{"name":"recipe","version":"1.0"},{"name":"redmine","version":"0.13"},{"name":"refit","version":"0.3.1"},{"name":"regexemail","version":"0.3"},{"name":"regression-report-plugin","version":"1.1"},{"name":"release","version":"2.3"},{"name":"remote-terminal-access","version":"1.4"},{"name":"repo","version":"1.5"},{"name":"repository","version":"1.0"},{"name":"repository-connector","version":"0.8.2"},{"name":"reverse-proxy-auth-plugin","version":"1.0.1"},{"name":"reviewboard","version":"1.0.1"},{"name":"rhnpush-plugin","version":"0.1"},{"name":"rich-text-publisher-plugin","version":"1.1"},{"name":"robot","version":"1.2.3"},{"name":"role-strategy","version":"1.1.2"},{"name":"rpmsign-plugin","version":"0.1"},{"name":"rqm-plugin","version":"1.0"},{"name":"rrod","version":"1.1.0"},{"name":"rtc","version":"0.3"},{"name":"ruby","version":"1.2"},{"name":"ruby-runtime","version":"0.11"},{"name":"rubyMetrics","version":"1.5.0"},{"name":"rubymotion","version":"0.13"},{"name":"run-condition","version":"0.10"},{"name":"rundeck","version":"2.11"},{"name":"rusalad-plugin","version":"1.0.8"},{"name":"rvm","version":"0.4"},{"name":"s3","version":"0.3.2"},{"name":"saferestart","version":"0.3"},{"name":"sametime","version":"0.4"},{"name":"sauce-ondemand","version":"1.57"},{"name":"sbt","version":"1.4"},{"name":"scala-junit-name-decoder","version":"1.0"},{"name":"schedule-failed-builds","version":"1.1"},{"name":"Schmant","version":"1.1.4"},{"name":"scm-sync-configuration","version":"0.0.7.1"},{"name":"scm2job","version":"2.3"},{"name":"scons","version":"0.4"},{"name":"scp","version":"1.8"},{"name":"screenshot","version":"1.1"},{"name":"script-realm","version":"1.5"},{"name":"script-scm","version":"1.12"},{"name":"scripted-cloud-plugin","version":"0.12"},{"name":"scriptler","version":"2.6.1"},{"name":"scripttrigger","version":"0.29"},{"name":"SCTMExecutor","version":"1.5.1"},{"name":"search-all-results-plugin","version":"1.0"},{"name":"secret","version":"1.7"},{"name":"sectioned-view","version":"1.18"},{"name":"selection-tasks-plugin","version":"1.0"},{"name":"selenium","version":"2.2"},{"name":"selenium-aes","version":"0.5"},{"name":"selenium-builder","version":"1.6"},{"name":"seleniumhq","version":"0.4"},{"name":"seleniumhtmlreport","version":"0.94"},{"name":"seleniumrc-plugin","version":"1.0"},{"name":"serenity","version":"0.4"},{"name":"sfee","version":"1.0.4"},{"name":"shared-objects","version":"0.44"},{"name":"shelve-project-plugin","version":"1.3"},{"name":"shiningpanda","version":"0.19"},{"name":"show-build-parameters","version":"1.0"},{"name":"sicci_for_xcode","version":"0.0.8"},{"name":"sidebar-link","version":"1.6"},{"name":"signal-killer","version":"1.0"},{"name":"simple-parameterized-builds-report","version":"1.0"},{"name":"simple-theme-plugin","version":"0.3"},{"name":"simpleclearcase","version":"1.2.2"},{"name":"simpleupdatesite","version":"1.1.2"},{"name":"sitemonitor","version":"0.4"},{"name":"skip-certificate-check","version":"1.0"},{"name":"skype-notifier","version":"1.1.0"},{"name":"sladiator-notifier","version":"1.0.4"},{"name":"slave-prerequisites","version":"1.0"},{"name":"slave-proxy","version":"1.1"},{"name":"slave-setup","version":"1.6"},{"name":"slave-squatter","version":"1.2"},{"name":"slave-status","version":"1.6"},{"name":"slave-utilization-plugin","version":"1.5"},{"name":"sloccount","version":"1.10"},{"name":"smart-jenkins","version":"1.0"},{"name":"sms-notification","version":"1.0"},{"name":"snsnotify","version":"1.6"},{"name":"sonar","version":"2.1"},{"name":"sonargraph-plugin","version":"1.2"},{"name":"sonatype-ci","version":"1.3"},{"name":"sounds","version":"0.4"},{"name":"sourcemonitor","version":"0.2"},{"name":"speaks","version":"0.1.1"},{"name":"sra-deploy","version":"1.4.2.2"},{"name":"ssh","version":"2.3"},{"name":"ssh-agent","version":"1.0"},{"name":"SSSCM","version":"1.0"},{"name":"stackhammer","version":"1.0.6"},{"name":"staf","version":"0.1"},{"name":"starteam","version":"0.6.11"},{"name":"started-by-envvar","version":"1.0"},{"name":"startup-trigger-plugin","version":"2.4"},{"name":"stashNotifier","version":"1.3"},{"name":"status-view","version":"1.0"},{"name":"statusmonitor","version":"1.3"},{"name":"stepcounter","version":"1.3.2"},{"name":"storable-configs-plugin","version":"1.0"},{"name":"strawboss","version":"1.1"},{"name":"suite-test-groups-publisher","version":"1.13"},{"name":"summary_report","version":"1.9"},{"name":"suppress-stack-trace","version":"1.1"},{"name":"Surround-SCM-plugin","version":"1.1"},{"name":"svn-release-mgr","version":"1.2"},{"name":"svn-revert-plugin","version":"1.3"},{"name":"svn-tag","version":"1.16"},{"name":"svn-workspace-cleaner","version":"1.0"},{"name":"svncompat13","version":"1.2"},{"name":"svncompat14","version":"1.1"},{"name":"svnmerge","version":"1.2"},{"name":"svnpublisher","version":"0.1"},{"name":"swarm","version":"1.9"},{"name":"synergy","version":"1.6"},{"name":"systemloadaverage-monitor","version":"1.2"},{"name":"tag-profiler","version":"0.2"},{"name":"tap","version":"1.10"},{"name":"tasks","version":"4.36"},{"name":"tattletale-plugin","version":"0.3"},{"name":"tcl","version":"0.4"},{"name":"team-views","version":"0.9.0"},{"name":"teamconcert","version":"1.0.5"},{"name":"template-project","version":"1.4"},{"name":"template-workflows","version":"1.2"},{"name":"tepco","version":"0.1"},{"name":"tepco-epuw","version":"1.0"},{"name":"terminal","version":"1.4"},{"name":"terminate-ssh-processes-plugin","version":"1.0"},{"name":"test-stability","version":"1.0"},{"name":"testabilityexplorer","version":"0.4"},{"name":"testflight","version":"1.3.8"},{"name":"testingbot","version":"1.5"},{"name":"testInProgress","version":"1.0"},{"name":"testlink","version":"3.5"},{"name":"testng-plugin","version":"1.1"},{"name":"testopia","version":"1.3"},{"name":"text-finder","version":"1.9"},{"name":"text-finder-run-condition","version":"0.1"},{"name":"tfs","version":"1.20"},{"name":"thinBackup","version":"1.7.2"},{"name":"thread-dump-action-plugin","version":"1.0"},{"name":"throttle-concurrents","version":"1.7.2"},{"name":"thucydides","version":"0.1"},{"name":"timestamper","version":"1.5.4"},{"name":"tmpcleaner","version":"1.1"},{"name":"token-macro","version":"1.7"},{"name":"toolenv","version":"1.1"},{"name":"trac","version":"1.13"},{"name":"trac-publisher-plugin","version":"1.3"},{"name":"tracking-svn","version":"1.1"},{"name":"tuxdroid","version":"1.7"},{"name":"TwilioNotifier","version":"0.2.1"},{"name":"twitter","version":"0.7"},{"name":"ui-samples-plugin","version":"1.520"},{"name":"unicorn","version":"0.1.1"},{"name":"unity-asset-server","version":"1.1.1"},{"name":"unity3d-plugin","version":"0.3"},{"name":"unreliable-slave-plugin","version":"1.1"},{"name":"update-sites-manager","version":"1.0.0"},{"name":"uptime","version":"1.0"},{"name":"url-auth","version":"1.0.1"},{"name":"URLSCM","version":"1.6"},{"name":"urltrigger","version":"0.31"},{"name":"utplsql","version":"0.4"},{"name":"vagrant","version":"0.1.4"},{"name":"valgrind","version":"0.19"},{"name":"validating-string-parameter","version":"2.2"},{"name":"vault-scm-plugin","version":"1.1.1"},{"name":"vboxwrapper","version":"1.3"},{"name":"veracode-scanner","version":"1.1"},{"name":"versioncolumn","version":"0.2"},{"name":"versionnumber","version":"1.4.1"},{"name":"vertx","version":"1.0.1"},{"name":"view-job-filters","version":"1.22"},{"name":"viewVC","version":"1.6"},{"name":"violation-columns","version":"1.5"},{"name":"violations","version":"0.7.11"},{"name":"virtualbox","version":"0.6"},{"name":"visualworks-store","version":"1.0"},{"name":"vmware","version":"0.8"},{"name":"vs-code-metrics","version":"1.6"},{"name":"vsphere-cloud","version":"0.10"},{"name":"vss","version":"1.9"},{"name":"vstestrunner","version":"1.0.1"},{"name":"warnings","version":"4.26"},{"name":"was-builder","version":"1.6.1"},{"name":"weblogic-deployer-plugin","version":"2.3"},{"name":"websocket","version":"1.0.5"},{"name":"WebSVN2","version":"0.9"},{"name":"webtestpresenter","version":"0.23"},{"name":"whitesource","version":"1.1"},{"name":"windmill","version":"1.5"},{"name":"windows-azure-storage","version":"0.1.1"},{"name":"windows-exe-runner","version":"1.1"},{"name":"wix","version":"1.2"},{"name":"writable-filesystem-monitor","version":"0.1"},{"name":"ws-cleanup","version":"0.15"},{"name":"xcode-plugin","version":"1.3.3"},{"name":"xfpanel","version":"1.2.2"},{"name":"xframe-filter-plugin","version":"1.0"},{"name":"xpath-config-viewer","version":"1.1.1"},{"name":"xpdev","version":"1.0"},{"name":"xshell","version":"0.8"},{"name":"xtrigger","version":"0.54"},{"name":"xunit","version":"1.60"},{"name":"xvfb","version":"1.0.7"},{"name":"xvnc","version":"1.14"},{"name":"yammer","version":"1.0.0"},{"name":"youtrack-plugin","version":"0.3"},{"name":"zentimestamp","version":"3.3"},{"name":"zubhium","version":"0.1.6"}]}
@@ -1,17 +0,0 @@
1
- <slave>
2
- <name>slave</name>
3
- <description/>
4
- <remoteFS>/var/jenkins</remoteFS>
5
- <numExecutors>20</numExecutors>
6
- <mode>NORMAL</mode>
7
- <retentionStrategy class="hudson.slaves.RetentionStrategy$Always"/>
8
- <launcher class="hudson.plugins.sshslaves.SSHLauncher" plugin="ssh-slaves@0.21">
9
- <host>127.0.0.1</host>
10
- <port>22</port>
11
- <password>supersecret</password>
12
- <privatekey>/root/.ssh/api_user_key</privatekey>
13
- </launcher>
14
- <label>slave</label>
15
- <nodeProperties/>
16
- <userId>kannan</userId>
17
- </slave>
@@ -1 +0,0 @@
1
- {"plugins":[{"active":true,"backupVersion":null,"bundled":true,"deleted":false,"dependencies":[],"downgradable":false,"enabled":true,"hasUpdate":false,"longName":"Jenkins Mailer Plugin","pinned":false,"shortName":"mailer","supportsDynamicLoad":"MAYBE","url":"http://wiki.jenkins-ci.org/display/JENKINS/Mailer","version":"1.5"},{"active":false,"backupVersion":null,"bundled":true,"deleted":false,"dependencies":[],"downgradable":false,"enabled":false,"hasUpdate":false,"longName":"External Monitor Job Type Plugin","pinned":false,"shortName":"external-monitor-job","supportsDynamicLoad":"MAYBE","url":"https://wiki.jenkins-ci.org/display/JENKINS/Monitoring+external+jobs","version":"1.1"},{"active":true,"backupVersion":"1.2","bundled":true,"deleted":false,"dependencies":[{}],"downgradable":true,"enabled":false,"hasUpdate":false,"longName":"LDAP Plugin","pinned":true,"shortName":"ldap","supportsDynamicLoad":"MAYBE","url":"http://wiki.jenkins-ci.org/display/JENKINS/LDAP+Plugin","version":"1.5"},{"active":true,"backupVersion":"1.1","bundled":true,"deleted":false,"dependencies":[{}],"downgradable":true,"enabled":true,"hasUpdate":false,"longName":"PAM Authentication plugin","pinned":true,"shortName":"pam-auth","supportsDynamicLoad":"MAYBE","url":"http://wiki.jenkins-ci.org/display/JENKINS/PAM+Authentication+Plugin","version":"1.1"},{"active":false,"backupVersion":null,"bundled":true,"deleted":false,"dependencies":[],"downgradable":false,"enabled":false,"hasUpdate":false,"longName":"Ant Plugin","pinned":false,"shortName":"ant","supportsDynamicLoad":"MAYBE","url":"http://wiki.jenkins-ci.org/display/JENKINS/Ant+Plugin","version":"1.2"},{"active":true,"backupVersion":null,"bundled":true,"deleted":false,"dependencies":[{},{},{},{}],"downgradable":false,"enabled":true,"hasUpdate":false,"longName":"Javadoc Plugin","pinned":false,"shortName":"javadoc","supportsDynamicLoad":"MAYBE","url":"http://wiki.jenkins-ci.org/display/JENKINS/Javadoc+Plugin","version":"1.1"},{"active":true,"backupVersion":null,"bundled":true,"deleted":false,"dependencies":[{},{},{},{},{},{}],"downgradable":false,"enabled":true,"hasUpdate":false,"longName":"Jenkins Translation Assistance plugin","pinned":false,"shortName":"translation","supportsDynamicLoad":"MAYBE","url":"http://wiki.jenkins-ci.org/display/JENKINS/Translation+Assistance+Plugin","version":"1.10"},{"active":true,"backupVersion":null,"bundled":false,"deleted":false,"dependencies":[{}],"downgradable":false,"enabled":false,"hasUpdate":false,"longName":"SMS Notification","pinned":false,"shortName":"sms","supportsDynamicLoad":"MAYBE","url":"https://wiki.jenkins-ci.org/display/JENKINS/SMS+Notification","version":"1.1"},{"active":true,"backupVersion":null,"bundled":true,"deleted":false,"dependencies":[{},{}],"downgradable":false,"enabled":true,"hasUpdate":false,"longName":"Maven Integration plugin","pinned":false,"shortName":"maven-plugin","supportsDynamicLoad":"MAYBE","url":"http://wiki.jenkins-ci.org/display/JENKINS/Maven+2+Project+Plugin","version":"1.520"},{"active":false,"backupVersion":null,"bundled":true,"deleted":false,"dependencies":[],"downgradable":false,"enabled":false,"hasUpdate":false,"longName":"Credentials Plugin","pinned":false,"shortName":"credentials","supportsDynamicLoad":"MAYBE","url":"http://wiki.jenkins-ci.org/display/JENKINS/Credentials+Plugin","version":"1.4"},{"active":true,"backupVersion":null,"bundled":true,"deleted":false,"dependencies":[{},{},{},{},{},{},{}],"downgradable":false,"enabled":true,"hasUpdate":false,"longName":"SSH Credentials Plugin","pinned":false,"shortName":"ssh-credentials","supportsDynamicLoad":"MAYBE","url":"http://wiki.jenkins-ci.org/display/JENKINS/SSH+Credentials+Plugin","version":"0.3"},{"active":true,"backupVersion":"0.25","bundled":true,"deleted":false,"dependencies":[{},{},{},{},{}],"downgradable":true,"enabled":true,"hasUpdate":false,"longName":"Jenkins SSH Slaves plugin","pinned":true,"shortName":"ssh-slaves","supportsDynamicLoad":"MAYBE","url":"http://wiki.jenkins-ci.org/display/JENKINS/SSH+Slaves+plugin","version":"0.27"},{"active":true,"backupVersion":"2.8","bundled":true,"deleted":false,"dependencies":[{},{},{},{}],"downgradable":true,"enabled":true,"hasUpdate":false,"longName":"Jenkins CVS Plug-in","pinned":true,"shortName":"cvs","supportsDynamicLoad":"MAYBE","url":"http://wiki.jenkins-ci.org/display/JENKINS/CVS+Plugin","version":"2.9"},{"active":true,"backupVersion":"1.45","bundled":true,"deleted":false,"dependencies":[{},{},{},{}],"downgradable":true,"enabled":true,"hasUpdate":false,"longName":"Jenkins Subversion Plug-in","pinned":true,"shortName":"subversion","supportsDynamicLoad":"MAYBE","url":"http://wiki.jenkins-ci.org/display/JENKINS/Subversion+Plugin","version":"1.50"}]}
@@ -1,16 +0,0 @@
1
- <project>
2
- <actions/>
3
- <description/>
4
- <keepDependencies>false</keepDependencies>
5
- <properties/>
6
- <scm class="hudson.scm.NullSCM"/>
7
- <canRoam>true</canRoam>
8
- <disabled>false</disabled>
9
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
10
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
11
- <triggers class="vector"/>
12
- <concurrentBuild>false</concurrentBuild>
13
- <builders/>
14
- <publishers/>
15
- <buildWrappers/>
16
- </project>
@@ -1 +0,0 @@
1
- {"updates":[]}
@@ -1,783 +0,0 @@
1
- require File.expand_path('../spec_helper', __FILE__)
2
- require 'net/http'
3
- require File.expand_path('../fake_http_response', __FILE__)
4
-
5
- describe JenkinsApi::Client::Job do
6
- context "With properly initialized Client and all methods defined" do
7
-
8
- before do
9
- mock_logger = Logger.new "/dev/null"
10
- @client = JenkinsApi::Client.new({:server_ip => '127.0.0.1'})
11
- @client.should_receive(:logger).at_least(1).and_return(mock_logger)
12
- @job = JenkinsApi::Client::Job.new(@client)
13
- @sample_json_response = {
14
- "jobs" => [
15
- {"name" => "test_job"},
16
- {"name" => "test_job2"}
17
- ]
18
- }
19
- @sample_json_job_response = {
20
- "downstreamProjects" => ["test_job1"],
21
- "upstreamProjects" => ["test_job2"],
22
- "builds" => [],
23
- "color" => "running",
24
- "nextBuildNumber" => 2
25
- }
26
- @sample_job_xml = File.read(
27
- File.expand_path('../fixtures/files/job_sample.xml', __FILE__))
28
- end
29
-
30
- describe "InstanceMethods" do
31
-
32
- describe "#create_job" do
33
- it "accepts job_name and xml and creates the job" do
34
- job_name = 'test_job'
35
- xml = '<name>somename</name>'
36
- @client.should_receive(:post_config)
37
- @job.create(job_name, xml)
38
- end
39
- end
40
-
41
- describe "#create_or_update" do
42
- it "creates jobs if they do not exist" do
43
- job_name = 'test_job'
44
- xml = '<name>somename</name>'
45
-
46
- mock_job_list_response = { "jobs" => [] } # job response w/ 0 jobs
47
-
48
- @client.should_receive(:api_get_request).with('').and_return(mock_job_list_response)
49
- @job.should_receive(:create).with(job_name, xml).and_return(nil)
50
-
51
- @job.create_or_update(job_name, xml)
52
- end
53
-
54
- it "updates existing jobs if they exist" do
55
- job_name = 'test_job'
56
- xml = '<name>somename</name>'
57
-
58
- mock_job_list_response = { "jobs" => [ { "name" => job_name } ] } # job response w/ 1 job
59
-
60
- @client.should_receive(:api_get_request).with('').and_return(mock_job_list_response)
61
- @job.should_receive(:update).with(job_name, xml).and_return(nil)
62
-
63
- @job.create_or_update(job_name, xml)
64
- end
65
- end
66
-
67
- describe "#create_freestyle" do
68
- it "creates a simple freestyle job" do
69
- params = {
70
- :name => 'test_job_using_params'
71
- }
72
- @client.should_receive(:post_config)
73
- @job.create_freestyle(params)
74
- end
75
- it "creates a freestyle job with shell command" do
76
- params = {
77
- :name => "test_job_using_params_shell",
78
- :shell_command => "echo this is a freestyle project"
79
- }
80
- @client.should_receive(:post_config)
81
- @job.create_freestyle(params)
82
- end
83
- it "accepts Git SCM provider" do
84
- params = {
85
- :name => "test_job_using_params_git",
86
- :scm_provider => "git",
87
- :scm_url => "git://github.com/arangamani/jenkins_api_client/git",
88
- :scm_branch => "master",
89
- :scm_credentials_id => 'foobar'
90
- }
91
- @client.should_receive(:post_config)
92
- @job.create_freestyle(params)
93
- end
94
- it "accepts subversion SCM provider" do
95
- params = {
96
- :name => "test_job_using_params_subversion",
97
- :scm_provider => "subversion",
98
- :scm_url => "http://svn.freebsd.org/base",
99
- :scm_branch => "master"
100
- }
101
- @client.should_receive(:post_config)
102
- @job.create_freestyle(params)
103
- end
104
- it "accepts CVS SCM provider with branch" do
105
- params = {
106
- :name => "test_job_using_params_cvs_branch",
107
- :scm_provider => "cvs",
108
- :scm_url => "http://cvs.NetBSD.org",
109
- :scm_module => "src",
110
- :scm_branch => "MAIN"
111
- }
112
- @client.should_receive(:post_config)
113
- @job.create_freestyle(params)
114
- end
115
- it "accepts CVS SCM provider with tag" do
116
- params = {
117
- :name => "test_job_using_params_cvs_tag",
118
- :scm_provider => "cvs",
119
- :scm_url => "http://cvs.NetBSD.org",
120
- :scm_module => "src",
121
- :scm_tag => "MAIN"
122
- }
123
- @client.should_receive(:post_config)
124
- @job.create_freestyle(params)
125
- end
126
- it "accepts timer and creates job" do
127
- params = {
128
- :name => "test_job_with_timer",
129
- :timer => "* * * * *"
130
- }
131
- @client.should_receive(:post_config)
132
- @job.create_freestyle(params)
133
- end
134
- it "accepts individual targets for skype notification" do
135
- params = {
136
- :name => "test_job_with_individual_skype_target",
137
- :skype_targets => "testuser"
138
- }
139
- @client.should_receive(:post_config)
140
- @job.create_freestyle(params)
141
- end
142
- it "accepts group targets for skype notification" do
143
- params = {
144
- :name => "test_job_with_group_skype_target",
145
- :skype_targets => "*testgroup"
146
- }
147
- @client.should_receive(:post_config)
148
- @job.create_freestyle(params)
149
- end
150
- it "accepts complex configuration for skype notifications" do
151
- params = {
152
- :name => "test_job_with_complex_skype_configuration",
153
- :skype_targets => "testuser *testgroup anotheruser *anothergroup",
154
- :skype_strategy => "failure_and_fixed",
155
- :skype_notify_on_build_start => true,
156
- :skype_notify_suspects => true,
157
- :skype_notify_culprits => true,
158
- :skype_notify_fixers => true,
159
- :skype_notify_upstream_committers => false,
160
- :skype_message => "summary_and_scm_changes"
161
- }
162
- @client.should_receive(:post_config)
163
- @job.create_freestyle(params)
164
- end
165
- end
166
-
167
- describe "#copy" do
168
- it "accepts the from and to job names and copies the from job to the to job" do
169
- @client.should_receive(:api_post_request).with(
170
- "/createItem?name=new_job&mode=copy&from=old_job"
171
- )
172
- @job.copy("old_job", "new_job")
173
- end
174
- it "accepts the from job name and copies the from job to the copy_of_from job" do
175
- @client.should_receive(:api_post_request).with(
176
- "/createItem?name=copy_of_old_job&mode=copy&from=old_job"
177
- )
178
- @job.copy("old_job")
179
- end
180
- end
181
-
182
- describe "#add_email_notification" do
183
- it "accepts email address and adds to existing job" do
184
- params = {
185
- :name => "email_notification_test_job"
186
- }
187
- @client.should_receive(:post_config)
188
- @job.create_freestyle(params)
189
- @client.should_receive(:get_config).and_return(@sample_job_xml)
190
- @client.should_receive(:post_config)
191
- @job.add_email_notification(
192
- :name => "email_notification_test_job",
193
- :notification_email => "testuser@testdomain.com"
194
- )
195
- end
196
- end
197
-
198
- describe "#add_skype_notification" do
199
- it "accepts skype configuration and adds to existing job" do
200
- params = {
201
- :name => "skype_notification_test_job"
202
- }
203
- @client.should_receive(:post_config)
204
- @job.create_freestyle(params)
205
- @client.should_receive(:get_config).and_return(@sample_job_xml)
206
- @client.should_receive(:post_config)
207
- @job.add_skype_notification(
208
- :name => "skype_notification_test_job",
209
- :skype_targets => "testuser"
210
- )
211
- end
212
- end
213
-
214
- describe "#rename" do
215
- it "accepts the old and new job names and renames the job" do
216
- @client.should_receive(:api_post_request).with(
217
- "/job/old_job/doRename?newName=new_job"
218
- )
219
- @job.rename("old_job", "new_job")
220
- end
221
- end
222
-
223
- describe "#delete" do
224
- it "accepts the job name and deletes the job" do
225
- @client.should_receive(:api_post_request)
226
- @job.delete('test_job')
227
- end
228
- end
229
-
230
- describe "#wipe_out_workspace" do
231
- it "accepts the job name and wipes out the workspace of the job" do
232
- @client.should_receive(:api_post_request).with(
233
- "/job/test_job/doWipeOutWorkspace"
234
- )
235
- @job.wipe_out_workspace('test_job')
236
- end
237
- end
238
-
239
- describe "#stop_build" do
240
- it "accepts the job name and build number and stops the build" do
241
- @client.should_receive(:api_get_request).twice.and_return(
242
- "building" => true, "nextBuildNumber" => 2)
243
- @client.should_receive(:api_post_request)
244
- @job.stop_build('test_job')
245
- end
246
- end
247
-
248
- describe "#get_console_output" do
249
- it "accepts the job name and the obtains the console output" do
250
- msg = "/job/test_job/1/logText/progressiveText?start=0"
251
- @client.should_receive(:api_get_request).
252
- with(msg, nil, nil, true).
253
- and_return(FakeResponse.new)
254
- @job.get_console_output('test_job', 1, 0, 'text')
255
- end
256
-
257
- it "raises an error if invalid mode is specified" do
258
- expect(
259
- lambda do
260
- @job.get_console_output('test_job', 1, 0, 'image')
261
- end
262
- ).to raise_error
263
- end
264
- end
265
-
266
- describe "#list_all" do
267
- it "accepts no parameters and returns all jobs in an array" do
268
- @client.should_receive(:api_get_request).and_return(
269
- @sample_json_response)
270
- response = @job.list_all
271
- response.class.should == Array
272
- response.size.should == @sample_json_response["jobs"].size
273
- end
274
- end
275
-
276
- describe "#exists?" do
277
- it "accepts a job name and returns true if the job exists" do
278
- @client.should_receive(:api_get_request).and_return(
279
- @sample_json_response)
280
- @job.exists?("test_job").should == true
281
- end
282
- end
283
-
284
- describe "#list_by_status" do
285
- it "accepts the status and returns jobs in specified status" do
286
- @client.should_receive(:api_get_request).twice.and_return(
287
- @sample_json_response)
288
- @job.list_by_status("success").class.should == Array
289
- end
290
- it "accepts the status and returns the jobs in specified status" do
291
- @client.should_receive(:api_get_request).and_return(
292
- @sample_json_response)
293
- @job.list_by_status("success", ["test_job"]).class.should == Array
294
- end
295
- end
296
-
297
- describe "#list" do
298
- it "accepts a filter and returns all jobs matching the filter" do
299
- @client.should_receive(:api_get_request).and_return(
300
- "jobs" => ["test_job"])
301
- @job.list("filter").class.should == Array
302
- end
303
- end
304
-
305
- describe "#list_all_with_details" do
306
- it "accepts no parameters and returns all jobs with details" do
307
- @client.should_receive(:api_get_request).and_return(
308
- @sample_json_response)
309
- response = @job.list_all_with_details
310
- response.class.should == Array
311
- response.size.should == @sample_json_response["jobs"].size
312
- end
313
- end
314
-
315
- describe "#list_details" do
316
- it "accepts the job name and returns its details" do
317
- @client.should_receive(:api_get_request).and_return(
318
- @sample_json_response)
319
- response = @job.list_details("test_job")
320
- response.class.should == Hash
321
- end
322
- end
323
-
324
- describe "#get_upstream_projects" do
325
- it "accepts the job name and returns its upstream projects" do
326
- @client.should_receive(:api_get_request).and_return(
327
- @sample_json_job_response)
328
- response = @job.get_upstream_projects("test_job")
329
- response.class.should == Array
330
- end
331
- end
332
-
333
- describe "#get_downstream_projects" do
334
- it "accepts the job name and returns its downstream projects" do
335
- @client.should_receive(:api_get_request).and_return(
336
- @sample_json_job_response)
337
- response = @job.get_downstream_projects("test_job")
338
- response.class.should == Array
339
- end
340
- end
341
-
342
- describe "#get_builds" do
343
- it "accepts the job name and returns its builds" do
344
- @client.should_receive(:api_get_request).and_return(
345
- @sample_json_job_response)
346
- response = @job.get_builds("test_job")
347
- response.class.should == Array
348
- end
349
- end
350
-
351
- describe "#color_to_status" do
352
- it "accepts the color and convert it to correct status" do
353
- @job.color_to_status("blue").should == "success"
354
- @job.color_to_status("blue_anime").should == "running"
355
- @job.color_to_status("red").should == "failure"
356
- @job.color_to_status("red_anime").should == "running"
357
- @job.color_to_status("yellow").should == "unstable"
358
- @job.color_to_status("yellow_anime").should == "running"
359
- @job.color_to_status("grey").should == "not_run"
360
- @job.color_to_status("grey_anime").should == "running"
361
- @job.color_to_status("aborted").should == "aborted"
362
- end
363
- it "returns invalid as the output if unknown color is detected" do
364
- @job.color_to_status("orange").should == "invalid"
365
- end
366
- end
367
-
368
- describe "#get_current_build_status" do
369
- it "accepts the job name and returns its current build status" do
370
- @client.should_receive(:api_get_request).and_return(
371
- @sample_json_job_response)
372
- @job.get_current_build_status("test_job").class.should == String
373
- end
374
- end
375
-
376
- describe "#get_current_build_number" do
377
- it "accepts the job name and returns its current build number" do
378
- @client.should_receive(:api_get_request).and_return(
379
- @sample_json_job_response)
380
- @job.get_current_build_number("test_job").class.should == Fixnum
381
- end
382
- end
383
-
384
- describe "#build" do
385
- # First tests confirm the build method works the same as it used to
386
- it "accepts the job name and builds the job" do
387
- @client.should_receive(:api_post_request).with(
388
- "/job/test_job/build", {}, true).and_return(FakeResponse.new(302))
389
- @job.build("test_job").should == '302'
390
- end
391
- it "accepts the job name with params and builds the job" do
392
- @client.should_receive(:api_post_request).with(
393
- "/job/test_job/buildWithParameters",
394
- {:branch => 'feature/new-stuff'},
395
- true
396
- ).and_return(FakeResponse.new(302))
397
- @job.build("test_job", {:branch => 'feature/new-stuff'}).should == '302'
398
- end
399
-
400
- ### OLD NON-QUEUE RESPONSE JENKINS ###
401
- # Next tests confirm it deals with different jenkins versions and waits
402
- # for build to start (or not)
403
- context "accepts the job name and builds the job (w/timeout)" do
404
- before do
405
- @client.should_receive(:api_get_request).with(
406
- "/job/test_job").and_return({})
407
- @client.should_receive(:api_post_request).with(
408
- "/job/test_job/build", {}, true).and_return(FakeResponse.new(302))
409
- @client.should_receive(:api_get_request).with(
410
- "/job/test_job/1/").and_return({})
411
- @client.should_receive(:get_jenkins_version).and_return("1.1")
412
- end
413
-
414
- it "passes a number of seconds for timeout in opts={} parameter" do
415
- @job.build("test_job", {}, {'build_start_timeout' => 10}).should == 1
416
- end
417
-
418
- it "passes a true value for timeout in opts={} parameter" do
419
- @job.instance_variable_set :@client_timeout, 10
420
- @job.build("test_job", {}, true).should == 1
421
- end
422
- end
423
-
424
- it "accepts the job name and builds the job (with a false timeout value)" do
425
- @client.should_receive(:api_post_request).with(
426
- "/job/test_job/build", {}, true).and_return(FakeResponse.new(302))
427
- @job.build("test_job", {}, false).should == "302"
428
- end
429
-
430
- # wait for build to start (or not) (initial response will fail)
431
- it "accepts the job name and builds the job after short delay (w/timeout)" do
432
- @client.should_receive(:api_get_request).with(
433
- "/job/test_job").and_return({})
434
- @client.should_receive(:api_post_request).with(
435
- "/job/test_job/build", {}, true).and_return(FakeResponse.new(302))
436
- @client.should_receive(:api_get_request).with(
437
- "/job/test_job/1/").ordered.and_raise(JenkinsApi::Exceptions::NotFound.new(@client.logger))
438
- @client.should_receive(:api_get_request).with(
439
- "/job/test_job/1/").ordered.and_return({})
440
- @client.should_receive(:get_jenkins_version).and_return("1.1")
441
- @job.build("test_job", {}, {'build_start_timeout' => 3}).should == 1
442
- end
443
-
444
- # wait for build to start - will fail
445
- it "accepts the job name and builds the job, but the job doesn't start" do
446
- @client.should_receive(:api_get_request).with(
447
- "/job/test_job").and_return({})
448
- @client.should_receive(:api_post_request).with(
449
- "/job/test_job/build", {}, true).and_return(FakeResponse.new(302))
450
- @client.should_receive(:api_get_request).with(
451
- "/job/test_job/1/").twice.ordered.and_raise(JenkinsApi::Exceptions::NotFound.new(@client.logger))
452
- @client.should_receive(:get_jenkins_version).and_return("1.1")
453
- expect( lambda { @job.build("test_job", {}, {'build_start_timeout' => 3}) }).to raise_error(Timeout::Error)
454
- end
455
-
456
- ### JENKINS POST 1.519 (QUEUE RESPONSE) ###
457
- # Next tests confirm it deals with different jenkins versions and waits
458
- # for build to start (or not)
459
- it "accepts the job name and builds the job (w/timeout)" do
460
- @client.should_receive(:api_get_request).with(
461
- "/job/test_job").and_return({})
462
- @client.should_receive(:api_post_request).with(
463
- "/job/test_job/build", {}, true).and_return({"location" => "/item/42/"})
464
- @client.should_receive(:api_get_request).with(
465
- "/queue/item/42").and_return({'executable' => {'number' => 1}})
466
- @client.should_receive(:get_jenkins_version).and_return("1.519")
467
- @job.build("test_job", {}, {'build_start_timeout' => 10}).should == 1
468
- end
469
-
470
- # wait for build to start (or not) (initial response will fail)
471
- it "accepts the job name and builds the job after short delay (w/timeout)" do
472
- @client.should_receive(:api_get_request).with(
473
- "/job/test_job").and_return({})
474
- @client.should_receive(:api_post_request).with(
475
- "/job/test_job/build", {}, true).and_return({"location" => "/item/42/"})
476
- @client.should_receive(:api_get_request).with(
477
- "/queue/item/42").and_return({}, {'executable' => {'number' => 1}})
478
- @client.should_receive(:get_jenkins_version).and_return("1.519")
479
- @job.build("test_job", {}, {'build_start_timeout' => 3}).should == 1
480
- end
481
-
482
- # wait for build to start - will fail
483
- it "accepts the job name and builds the job, but the job doesn't start" do
484
- @client.should_receive(:api_get_request).with(
485
- "/job/test_job").and_return({})
486
- @client.should_receive(:api_post_request).with(
487
- "/job/test_job/build", {}, true).and_return({"location" => "/item/42/"})
488
- @client.should_receive(:api_get_request).with(
489
- "/queue/item/42").and_return({}, {})
490
- @client.should_receive(:get_jenkins_version).and_return("1.519")
491
- expect( lambda { @job.build("test_job", {}, {'build_start_timeout' => 3}) }).to raise_error(Timeout::Error)
492
- end
493
- end
494
-
495
- describe "#poll" do
496
- it "accepts the job name and polls the job for scm changes" do
497
- @client.should_receive(:api_post_request).with(
498
- "/job/test_job/polling"
499
- ).and_return(302)
500
- @job.poll("test_job").should == 302
501
- end
502
- end
503
-
504
- describe "#enable" do
505
- it "accepts the job name and enables the job" do
506
- @client.should_receive(:api_post_request).with(
507
- "/job/test_job/enable").and_return(302)
508
- @job.enable("test_job").should == 302
509
- end
510
- end
511
-
512
- describe "#disable" do
513
- it "accepts the job name and disables the job" do
514
- @client.should_receive(:api_post_request).with(
515
- "/job/test_job/disable").and_return(302)
516
- @job.disable("test_job").should == 302
517
- end
518
- end
519
-
520
- describe "#get_config" do
521
- it "accepts the job name and obtains its config.xml" do
522
- @client.should_receive(:get_config).with(
523
- "/job/test_job").and_return("<job>test_job</job>")
524
- @job.get_config("test_job").should == "<job>test_job</job>"
525
- end
526
- end
527
-
528
- describe "#post_config" do
529
- it "accepts the job name and posts its config.xml to the server" do
530
- @client.should_receive(:post_config).with(
531
- "/job/test_job/config.xml", "<job>test_job</job>")
532
- @job.post_config("test_job", "<job>test_job</job>")
533
- end
534
- end
535
-
536
- describe "#change_description" do
537
- it "accepts the job name and description and changes it" do
538
- @client.should_receive(:get_config).with(
539
- "/job/test_job").and_return(@sample_job_xml)
540
- @client.should_receive(:post_config)
541
- @job.change_description("test_job", "new description")
542
- end
543
- end
544
-
545
- describe "#block_build_when_downstream_building" do
546
- it "accepts the job name and blocks build when downstream builds" do
547
- @client.should_receive(:get_config).with(
548
- "/job/test_job").and_return(@sample_job_xml)
549
- @client.should_receive(:post_config)
550
- @job.block_build_when_downstream_building("test_job")
551
- end
552
- end
553
-
554
- describe "#unblock_build_when_downstream_building" do
555
- it "accepts the job name and unblocks build when downstream builds" do
556
- @client.should_receive(:get_config).with(
557
- "/job/test_job").and_return(@sample_job_xml)
558
- @job.unblock_build_when_downstream_building("test_job")
559
- end
560
- end
561
-
562
- describe "#block_build_when_upstream_building" do
563
- it "accepts the job name and blocks build when upstream is building" do
564
- @client.should_receive(:get_config).with(
565
- "/job/test_job").and_return(@sample_job_xml)
566
- @client.should_receive(:post_config)
567
- @job.block_build_when_upstream_building("test_job")
568
- end
569
- end
570
-
571
- describe "#unblock_build_when_upstream_building" do
572
- it "accepts the job name and unblocks build when upstream builds" do
573
- @client.should_receive(:get_config).with(
574
- "/job/test_job").and_return(@sample_job_xml)
575
- @job.unblock_build_when_upstream_building("test_job")
576
- end
577
- end
578
-
579
- describe "#execute_concurrent_builds" do
580
- it "accepts the job name and option and executes concurrent builds" do
581
- @client.should_receive(:get_config).with(
582
- "/job/test_job").and_return(@sample_job_xml)
583
- @client.should_receive(:post_config)
584
- @job.execute_concurrent_builds("test_job", true)
585
- end
586
- end
587
-
588
- describe "#restrict_to_node" do
589
- it "accepts the job name and node name and restricts the job node" do
590
- @client.should_receive(:get_config).with(
591
- "/job/test_job").and_return(@sample_job_xml)
592
- @client.should_receive(:post_config)
593
- @job.restrict_to_node("test_job", "test_slave")
594
- end
595
- end
596
-
597
- describe "#unchain" do
598
- it "accepts the job names and unchains them" do
599
- @client.should_receive(:get_config).with(
600
- "/job/test_job").and_return(@sample_job_xml)
601
- @client.should_receive(:post_config)
602
- @job.unchain(["test_job"])
603
- end
604
- end
605
-
606
- describe "#chain" do
607
- it "accepts the job names and other options and chains them" do
608
- @client.should_receive(:get_config).with(
609
- "/job/test_job").and_return(@sample_job_xml)
610
- @client.should_receive(:post_config)
611
- @job.unchain(["test_job"])
612
- end
613
- end
614
-
615
- describe "#get_promotions" do
616
- it "accepts the jon name and returns the promotions" do
617
- mock_job_promotions_response = {
618
- "processes" => [ { "name" => "dev",
619
- "url" => "not_required",
620
- "color" => "blue",
621
- },
622
- { "name" => "stage",
623
- "url" => "not_required",
624
- "color" => "notbuilt",
625
- },
626
- ], }
627
-
628
- @client.should_receive(:api_get_request).with('/job/test_job/promotion').and_return(
629
- mock_job_promotions_response)
630
- @client.should_receive(:api_get_request).and_return({'target' => {'number' => 42}})
631
- @job.get_promotions("test_job").should == {'dev' => 42, 'stage' => nil}
632
- end
633
- end
634
-
635
- describe "#get_promote_config" do
636
- it "accepts name and process and returns promotion config" do
637
- @client.should_receive(:get_config).with('/job/testjob/promotion/process/promo/config.xml')
638
- @job.get_promote_config('testjob', 'promo')
639
- end
640
- end
641
-
642
- describe "#set_promote_config" do
643
- it "accepts name, process and config." do
644
- @client.should_receive(:post_config).with('/job/testjob/promotion/process/promo/config.xml', 'xml')
645
- @job.set_promote_config('testjob', 'promo', 'xml')
646
- end
647
- end
648
-
649
- describe "#delete_promote_config" do
650
- it "accepts name and process and deletes promotion config" do
651
- @client.should_receive(:post_config).with('/job/testjob/promotion/process/promo/doDelete')
652
- @job.delete_promote_config('testjob', 'promo')
653
- end
654
- end
655
-
656
- describe '#scm_git' do
657
- before do
658
- @job.send(:scm_git, {
659
- scm_url: 'http://foo.bar',
660
- scm_credentials_id: 'foobar',
661
- scm_branch: 'master',
662
- scm_git_tool: 'Git_NoPath',
663
- }, xml_builder=Nokogiri::XML::Builder.new(:encoding => 'UTF-8'))
664
- @xml_config = Nokogiri::XML(xml_builder.to_xml)
665
- end
666
-
667
- it 'adds scm_url to hudson.plugins.git.UserRemoteConfig userRemoteConfig url tag' do
668
- expect(@xml_config.at_css('scm userRemoteConfigs url').content).to eql('http://foo.bar')
669
- end
670
-
671
- it 'adds scm_credentials_id to hudson.plugins.git.UserRemoteConfig userRemoteConfig credentialsId tag' do
672
- expect(@xml_config.at_css('scm userRemoteConfigs credentialsId').content).to eql('foobar')
673
- end
674
-
675
- it 'adds branch to scm branches' do
676
- expect(@xml_config.at_css('scm branches name').content).to eql('master')
677
- end
678
-
679
- it 'adds gitTool to scm tag' do
680
- expect(@xml_config.at_css('scm gitTool').content).to eql('Git_NoPath')
681
- end
682
- end
683
- end
684
-
685
- describe '#build_freestyle_config' do
686
- it 'calls configure on its plugin collection' do
687
- expect(@job.plugin_collection).to receive(:configure).and_return(Nokogiri::XML::Document.new(''))
688
- @job.build_freestyle_config(name: 'foobar')
689
- end
690
-
691
- context 'scm_trigger and ignore_post_commit_hooks params' do
692
- it 'configures triggers with a hudson.triggers.SCMTrigger' do
693
- xml = @job.build_freestyle_config(
694
- name: 'foobar',
695
- scm_trigger: 'H 0 29 2 0',
696
- ignore_post_commit_hooks: true
697
- )
698
-
699
- xml_config = Nokogiri::XML(xml)
700
- expect(xml_config.at_css('triggers spec').content).to eql('H 0 29 2 0')
701
- expect(xml_config.at_css('triggers ignorePostCommitHooks').content).to eql('true')
702
- end
703
-
704
- it 'does not add a tag to triggers if not passed scm_trigger param' do
705
- xml = @job.build_freestyle_config(
706
- name: 'foobar'
707
- )
708
-
709
- xml_config = Nokogiri::XML(xml)
710
- expect(xml_config.at_css('triggers').children).to be_empty
711
- end
712
- end
713
-
714
- context 'artifact archiver build step' do
715
- context 'given artifact_archiver params' do
716
- it 'configures with given params' do
717
- artifact_archiver_params = {
718
- artifact_files: '**',
719
- excludes: 'foo',
720
- fingerprint: true,
721
- allow_empty_archive: true,
722
- only_if_successful: true,
723
- default_excludes: true,
724
- }
725
- xml = @job.build_freestyle_config(
726
- name: 'foobar',
727
- artifact_archiver: artifact_archiver_params,
728
- )
729
- xml_config = Nokogiri::XML(xml)
730
-
731
- expect(xml_config.at_xpath('//publishers/hudson.tasks.ArtifactArchiver/artifacts').content).to eql('**')
732
- expect(xml_config.at_xpath('//publishers/hudson.tasks.ArtifactArchiver/excludes').content).to eql('foo')
733
- expect(xml_config.at_xpath('//publishers/hudson.tasks.ArtifactArchiver/fingerprint').content).to eql('true')
734
- expect(xml_config.at_xpath('//publishers/hudson.tasks.ArtifactArchiver/allowEmptyArchive').content).to eql('true')
735
- expect(xml_config.at_xpath('//publishers/hudson.tasks.ArtifactArchiver/onlyIfSuccessful').content).to eql('true')
736
- expect(xml_config.at_xpath('//publishers/hudson.tasks.ArtifactArchiver/defaultExcludes').content).to eql('true')
737
- end
738
-
739
- it 'configures with defaults for non-specified options' do
740
- xml = @job.build_freestyle_config(
741
- name: 'foobar',
742
- artifact_archiver: {},
743
- )
744
- xml_config = Nokogiri::XML(xml)
745
-
746
- expect(xml_config.at_xpath('//publishers/hudson.tasks.ArtifactArchiver/artifacts').content).to eql('')
747
- expect(xml_config.at_xpath('//publishers/hudson.tasks.ArtifactArchiver/excludes').content).to eql('')
748
- expect(xml_config.at_xpath('//publishers/hudson.tasks.ArtifactArchiver/fingerprint').content).to eql('false')
749
- expect(xml_config.at_xpath('//publishers/hudson.tasks.ArtifactArchiver/allowEmptyArchive').content).to eql('false')
750
- expect(xml_config.at_xpath('//publishers/hudson.tasks.ArtifactArchiver/onlyIfSuccessful').content).to eql('false')
751
- expect(xml_config.at_xpath('//publishers/hudson.tasks.ArtifactArchiver/defaultExcludes').content).to eql('false')
752
- end
753
- end
754
-
755
- context 'not given artifact_archiver params' do
756
- it 'omits hudson.tasks.ArtifactArchiver tag' do
757
- xml = @job.build_freestyle_config(name: 'foobar')
758
- xml_config = Nokogiri::XML(xml)
759
-
760
- expect(xml_config.xpath('//publishers/hudson.tasks.ArtifactArchiver')).to be_empty
761
- end
762
- end
763
- end
764
- end
765
-
766
- context 'plugin settings' do
767
- let(:plugin) { JenkinsApi::Client::PluginSettings::Base.new }
768
- describe '#add_plugin' do
769
- it 'calls add on @plugin_collection with given plugin setting' do
770
- expect(@job.plugin_collection).to receive(:add).with(plugin)
771
- @job.add_plugin(plugin)
772
- end
773
- end
774
-
775
- describe '#remove_plugin' do
776
- it 'calls remove on @plugin_collection with given plugin setting' do
777
- expect(@job.plugin_collection).to receive(:remove).with(plugin)
778
- @job.remove_plugin(plugin)
779
- end
780
- end
781
- end
782
- end
783
- end