Goldberg

Lightweight Continuous Integration in Ruby

Latest Builds

goldberg (1.9.2) passed

Using /home/goldberg/.rvm/gems/ruby-1.9.2-p318 with gemset goldberg-goldberg

The Gemfile's dependencies are satisfied
==  CreateProjects: migrating =================================================
-- create_table(:projects)
   -> 0.0019s
==  CreateProjects: migrated (0.0020s) ========================================

==  CreateBuilds: migrating ===================================================
-- create_table(:builds)
   -> 0.0027s
==  CreateBuilds: migrated (0.0028s) ==========================================

==  ChangeBuildStatusToString: migrating ======================================
-- remove_column(:builds, :status)
   -> 0.0077s
-- add_column(:builds, :status, :string)
   -> 0.0006s
==  ChangeBuildStatusToString: migrated (0.0085s) =============================

==  AddBuildRequestedToProjects: migrating ====================================
-- add_column(:projects, :build_requested, :boolean, {:default=>false})
   -> 0.0372s
==  AddBuildRequestedToProjects: migrated (0.0373s) ===========================

==  AddBranchToProject: migrating =============================================
-- add_column(:projects, :branch, :string)
   -> 0.0008s
==  AddBranchToProject: migrated (0.0887s) ====================================

==  AddNextBuildAtToProjects: migrating =======================================
-- add_column(:projects, :next_build_at, :timestamp)
   -> 0.0319s
==  AddNextBuildAtToProjects: migrated (0.0320s) ==============================

==  AddRubyToBuild: migrating =================================================
-- add_column(:builds, :ruby, :string)
   -> 0.0007s
==  AddRubyToBuild: migrated (0.0007s) ========================================

==  AddEnvironmentVariablesToBuild: migrating =================================
-- add_column(:builds, :environment_string, :string)
   -> 0.0008s
==  AddEnvironmentVariablesToBuild: migrated (0.0009s) ========================

==  RemoveCustomCommandFromProject: migrating =================================
-- remove_column(:projects, :custom_command)
   -> 0.0089s
==  RemoveCustomCommandFromProject: migrated (0.0090s) ========================

==  AddScmToProjects: migrating ===============================================
-- add_column(:projects, :scm, :string)
   -> 0.0011s
==  AddScmToProjects: migrated (0.0026s) ======================================

/home/goldberg/.rvm/rubies/ruby-1.9.2-p318/bin/ruby -S rspec ./spec/controllers/projects_controller_spec.rb ./spec/controllers/builds_controller_spec.rb ./spec/controllers/home_controller_spec.rb ./spec/mailers/build_status_mailer_spec.rb ./spec/models/build_post_processor_spec.rb ./spec/models/project_spec.rb ./spec/models/global_config_spec.rb ./spec/models/scm_spec.rb ./spec/models/build_spec.rb ./spec/models/project/configuration_spec.rb ./spec/models/command_spec.rb ./spec/models/scm/svn_spec.rb ./spec/models/paths_spec.rb ./spec/models/repository_spec.rb ./spec/models/init_spec.rb ./spec/models/build_mail_notification_spec.rb ./spec/helpers/home_helper_spec.rb ./spec/helpers/builds_helper_spec.rb ./spec/helpers/application_helper_spec.rb
No DRb server is running. Running in local process instead ...

ProjectsController
  loads one project
  allows forcing a build
  gives a 404 when an unknown project is requested for
  gives a 404 when an unknown project is requested for
  gives a json representation of all projects
  loads the passed badge when the status is passed
  loads the failed badge when the status is failed
  loads the failed badge when the status is timeout
  loads the unknown badge when the status is not available

BuildsController
  loads one build
  denotes an unknown project
  denotes an unknown build
  cancels the build
  artefacts
    sends a requested file that lives beneath the given directory
    raises an error if a file outside the given directory was requested
    renders the directory view if a directory was requested
    returns a 404 if the path is not found

HomeController
  generates the cc feed
  index
    loads all projects
    sorts the projects by most recent activity
    can sort projects with no latest build
    groups projects
    returns just one group
  projects_partial
    loads all projects
    sorts the projects by most recent activity
    can sort projects with no latest build
    groups projects
    returns just one group

BuildStatusMailer
  build status mail
    takes a default subject line
    delivers a mail with a link pointing to the build page

BuildPostProcessor
  on successfull build
    executes build completion callbacks
    does not execute build failure callbacks
    executes build success callbacks
    executes red to green callback if previous build status was failed
    does not executes red to green callback if previous build status was not failed
  on failed build
    executes build completion callbacks
    executes build failure callbacks
    does not execute build success callbacks

Project
  is able to return the latest build
  cleans up older 'building' builds
  provides list of projects to be built
  evaluates now every time while picking the projects to build
  attribute validation
    should be invalid without a name
    should be invalid without a url
    should be invalid without a branch
  lifecycle
    adding a project
      creates a new projects and checks out the code for it
      doesn't do anything if a project already exists with the same name
    removing a project
      removes it from the DB
      removes the checked out code and build info from filesystem
      removes all the builds from DB
  checkout
    checks out the code for the project
    doesn't create the project if the checkout fails
  delegation to latest build
    delegates latest_build_number to the latest build
    delegates latest_build_status to the latest build
    delegates latest_build_build_log to the latest build
    delegates latest_build_timestamp to the latest build
  last complete build
    delegates last_complete_build_timestamp to the last complete build
  command
    defaults the custom command to rake
    is able to retrieve the custom command
    does 'bundle exec' if asked to
  forcing a build
    sets the build requested flag to true
  when to build
    builds if there are no existing builds
    builds even if there are existing builds if it is requested
  run build
    preprocesses the codebase before calling build
    with build requested
      runs the build even if there are no updates
    without changes or requested build
      does not run the build if there are no updates from repository or build is not required
      schedules the next build based on the project's configuration
    with changes
      creates a new build for a project with build number set to 1 in case of first build  and run it
      creates a new build for a project with build number one greater than last build and run it
      schedules the next build based on the project's configuration
      should read the environment variables from the config
cd: 1: can't cd to some_path/goldberg/code
      should execute the post_build hooks from the config
  culprit_revision_range
    returns build which originally failed
    returns all failed build if there are no passing builds
    returns nil if the latest build passed
  culprits_for_failure
    returns authors of the culprit build
    returns empty string if there is no culprit build
  build preprocessing
    removes Gemfile.lock if the file exists and is not being versioned and if it is newer than the Gemfile
    does not remove Gemfile.lock if the file exists but it's being versioned
  project configuration
    loads a new configuration object with default values if goldberg_config.rb is not found
    evals the goldberg_config.rb and returns the modified config as project config when file exists
    loads the server-side config which overrides the checked in version
  activity
    is Sleeping if no build is currently happening and if the last build passed
    is Sleeping if no build is currently happening and if the last build failed
    is Sleeping if no build is currently happening and if the last build timeout
    is Building if a build is currently happening
    is Unknown for any status
  cctray project status
    is 'Success' when the last build 'passed'
    is 'Success' when the last build is building & the second to last 'passed'
    is 'Failure' when the last build 'failed'
    is 'Failure' when the last build is building & the second to last 'failed'
    is 'Failure' when the last build 'timeout'
    is 'Failure' when the last build is building & the second to last 'timeout'
  removing a failed add
    if the checkout fails
    if the checkout raises an error
  github
    doesn't think random urls are on git
    detects a git protocol url
    detects an http url

GlobalConfig
  default values
    returns frequency to 10 seconds
  yml file exists
    returns the frequency from yml file
  reading yml file
    reads the configuration from config/goldberg.yml if available and return configuration for current Rails.env
    returns an empty hash if config/goldberg.yml is not available

Scm
  provider
    chooses the given provider by name

Build
  is able to fake a build
  is not a nil build
  sorts correctly
  is able to read the build log file to retrieve associated log
  cancels build
  paths
    knows where to store the build artefacts on the file system
    appends build number to the project path to create a path for change_list
    appends build number to the project path to create a path for build_log
  after create
    creates a directory for storing build artefacts
  before create
    updates the revision of the build if it is blank
    does not update the build revision if it is already set
  changes
    writes a file with all the changes since the previous build
  run
    executes in a clean environment (PENDING: Need to write spec to make sure all code is getting executed within Bundle.with_clean_env)
    performs prebuild setup before building the project
    runs the build command
    sets build status to failed if the build command succeeds
    sets build status to failed if the build command fails
    timeout
      reports when the build hasn't exceeded the timeout
      reports when the build has exceeded the timeout
      doesn't timeout if it was configured as such
  before build
    sets build status to 'building' and persist the change list
  artefacts
    if the folder exists
    if the folder doesn't exist

Project::Configuration
  default value
    for build frequency should be 20 seconds
    environment variables should be an empty hash
    for niceness of the build process should be +0
    should have no callbacks set
  setting values
    should be able to add environment variables
  callbacks
    should be able to register build completion callbacks
    should be able to register build failure callbacks
    should be able to register red build passed callbacks
    should be able to register success callbacks
  ruby_version
    uses the RUBY_PATCHLEVEL when it's MRI
    uses the JRUBY_VERSION if it's jruby
    just use the RUBY_VERSION with nothing else otherwise

Scm::Svn
  author
    should use revision range provided

Paths
  projects
    creates the goldberg path if it doesn't exist and returns it
    creates the goldberg path using the environment variable if defined
  pid
    creates the pid directory if it doesn't exist

Repository
  checks out the code at the given path and return true on success
  knows the sha of current revision
  author
    gets the author information from the scm in the code path
  update
    updates the code at given location and return true if there are updates
    returns false if code there were no updates
  change list
    retrieves a list of changes given two revisions
    returns empty change list if old sha is blank
    retrieves a list of changes if old sha is present but new sha is blank
  check if file is versioned
    should return false if the file is not versioned
    should return true if the file is versioned

Init
  adds a new project
  adds a new project with a custom command
  reports failure in adding a project
  removes the specified project
  fails gracefully if it can't find the project to remove
  lists all projects
  continues on with the next project even if one build fails

BuildMailNotification
  can send mail in a DSLish syntax

HomeHelper
  renders the status icon when the status is building
  renders the status icon when the status is not_available
  renders the status icon when the status is cancelled
  renders the status icon when the status is passed
  renders the status icon when the status is failed

BuildsHelper
  generates just the revision number if the project is not hosted on github
  generates a github url if the project is hosted on github

ApplicationHelper
  replaces white spaces in build status with underscore
  reports on unknown status
  formats timestamp
  formats a nil as an empty string timestamp

Pending:
  Build run executes in a clean environment
    # Need to write spec to make sure all code is getting executed within Bundle.with_clean_env
    # ./spec/models/build_spec.rb:95

Finished in 2.99 seconds
171 examples, 0 failures, 1 pending
Coverage report generated for RSpec to /home/goldberg/.goldberg/projects/goldberg/code/coverage. 421 / 463 LOC (90.93%) covered.
cp -r coverage /home/goldberg/.goldberg/projects/goldberg/builds/265/artefacts