jamesrwhite/minicron

Get minicron running on rbx (rubinius)

Closed this issue · 2 comments

Initial was this making a test fail rubinius/rubinius#2944

Current test failures:

$ bundle exec rspec

Minicron::PagerDuty
  #intiailize
    should create an instance of the Pagerduty gem
  #get_message
    when kind is miss
      should return the correct message
    when kind is fail
      should return the correct message
    when kind is not supported
      should raise an Exception
  #send
    should trigger an alert on the pagerduty client

Minicron::SMS
  #intiailize
    should create an instance of the Twilio gem
  #get_message
    when kind is miss
      should return the correct message
    when kind is fail
      should return the correct message
    when kind is not supported
      should raise an Exception

Minicron::CLI
  #server
    should start the minicron server (PENDING: Not yet implemented)
  #run
    when in --dry-run mode
      should run a simple command and print the output to stdout (FAILED - 1)
      should run a simple multi-line command and print the output to stdout (FAILED - 2)
      when a non-existent command is run
        should return an error (FAILED - 3)
      when no argument is passed to the run action
        should raise ArgumentError (FAILED - 4)
    when in --dry-run mode with a valid --config file passed
      should run a simple command and print the output to stdout (FAILED - 5)
      should run a simple multi-line command and print the output to stdout (FAILED - 6)
      when a non-existent command is run
        should return an error (FAILED - 7)
      when no argument is passed to the run action
        should raise ArgumentError (FAILED - 8)
    when run in --verbose mode
      should set the verbose to true (FAILED - 9)
  #run_command
    when in verbose mode
      a one line command should result in 7 total line
    when a non-existent command is run
      should raise an Exception (FAILED - 10)
  #coloured_output?
    when Rainbow is enabled
      should return true
    when Rainbow is disabled
      should return false
  #enable_coloured_output!
    should set Rainbow.enabled to true
  #disable_coloured_output!
    should set Rainbow.enabled to false

Minicron::Transport::Client
  #initialize
    when path is root
      should set the correct instance variables and call the parent init
    when path is not root
      should set the correct instance variables and call the parent init
  #setup
    should call #publish with the correct params (PENDING: Not yet implemented)
  #send
    should call #publish with the correct params
  #publish
    should call #request with the correct params

Minicron::Transport::FayeClient
  #initialize
    should set the host and queue instance variable
  #ensure_delivery
    should block until the queue hash is empty and return nil
  #tidy_up
    when eventmachine is running
      should stop eventmachine
    when eventmachine is not running
      should do nothing

Minicron::Transport::Server
  #start!
    when the server is running
      should return false
    when the server is not running
      should return true
  #stop!
    when the server is not running
      should return false
    when the server is running
      should return true
  #running?
    when the server is not running
      should return false
    when the server is running
      should return true

Minicron::Transport
  .get_job_hash
    when the correct params are passed
      should return a 32 char string (md5 hash)

Minicron
  .capture_output
    when :stdout is passed as an option
      should return a StringIO instance
    when :stderr is passed as an option
      should return a StringIO instance
    when :both is passed as an option
      should return a Hash
    when :both is passed as an option
      should return a Hash containing :stdout and :stderr with two StringIO instances
    when an invalid :type is used
      should raise an ArgumentError
  .parse_file_config
    when a valid toml file is passed
      should update the config class variable with the toml file config (FAILED - 11)
    when an invalid toml file is passed
      should update the config class variable with the toml file config
    when a non existent toml file is passed
      should raise an Exception
    when a file without read permissions is passed
      should raise an Exception
  .generate_ssh_key
    should generate an ssh key pub/priv pair
  .get_fqdn
    should return the fqdn as a string with no newline
  .get_hostname
    should return the hostname as a string with no newline
  .get_user
    should return the user as a string with no newline

Pending:
  Minicron::CLI#server should start the minicron server
    # Not yet implemented
    # ./spec/minicron/cli_spec.rb:9
  Minicron::Transport::Client#setup should call #publish with the correct params
    # Not yet implemented
    # ./spec/minicron/transport/client_spec.rb:42

Failures:

  1) Minicron::CLI#run when in --dry-run mode should run a simple command and print the output to stdout
     Failure/Error: Minicron.parse_file_config('./default.config.toml')
     Citrus::SyntaxError:
       /Users/james/.rvm/gems/rbx-2.2.6/gems/toml-rb-0.1.6/lib/toml/grammars/helper.citrus: Malformed Citrus syntax on line 3 at offset 10
           (space? "#" (~line_break)* line_break?) { nil }

                 ^
     # kernel/common/code_loader.rb:243:in `require'
     # kernel/common/code_loader.rb:143:in `require_relative'
     # kernel/common/kernel.rb:711:in `require_relative'
     # kernel/common/code_loader.rb:243:in `require'
     # kernel/common/autoload.rb:55:in `resolve'
     # ./lib/minicron.rb:68:in `parse_file_config'
     # ./spec/minicron/cli_spec.rb:22:in `__script__'
     # kernel/common/eval.rb:43:in `instance_eval'
     # kernel/bootstrap/array.rb:66:in `each'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/proc.rb:20:in `call'
     # kernel/loader.rb:710:in `run_at_exits'
     # kernel/loader.rb:730:in `epilogue'
     # kernel/loader.rb:866:in `main'

  2) Minicron::CLI#run when in --dry-run mode should run a simple multi-line command and print the output to stdout
     Failure/Error: Minicron.parse_file_config('./default.config.toml')
     NoMethodError:
       undefined method `load_file' on TOML (Module)
     # kernel/delta/kernel.rb:78:in `load_file (method_missing)'
     # ./lib/minicron.rb:68:in `parse_file_config'
     # ./spec/minicron/cli_spec.rb:22:in `__script__'
     # kernel/common/eval.rb:43:in `instance_eval'
     # kernel/bootstrap/array.rb:66:in `each'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/proc.rb:20:in `call'
     # kernel/loader.rb:710:in `run_at_exits'
     # kernel/loader.rb:730:in `epilogue'
     # kernel/loader.rb:866:in `main'

  3) Minicron::CLI#run when in --dry-run mode when a non-existent command is run should return an error
     Failure/Error: Minicron.parse_file_config('./default.config.toml')
     NoMethodError:
       undefined method `load_file' on TOML (Module)
     # kernel/delta/kernel.rb:78:in `load_file (method_missing)'
     # ./lib/minicron.rb:68:in `parse_file_config'
     # ./spec/minicron/cli_spec.rb:22:in `__script__'
     # kernel/common/eval.rb:43:in `instance_eval'
     # kernel/bootstrap/array.rb:66:in `each'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/proc.rb:20:in `call'
     # kernel/loader.rb:710:in `run_at_exits'
     # kernel/loader.rb:730:in `epilogue'
     # kernel/loader.rb:866:in `main'

  4) Minicron::CLI#run when in --dry-run mode when no argument is passed to the run action should raise ArgumentError
     Failure/Error: Minicron.parse_file_config('./default.config.toml')
     NoMethodError:
       undefined method `load_file' on TOML (Module)
     # kernel/delta/kernel.rb:78:in `load_file (method_missing)'
     # ./lib/minicron.rb:68:in `parse_file_config'
     # ./spec/minicron/cli_spec.rb:22:in `__script__'
     # kernel/common/eval.rb:43:in `instance_eval'
     # kernel/bootstrap/array.rb:66:in `each'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/proc.rb:20:in `call'
     # kernel/loader.rb:710:in `run_at_exits'
     # kernel/loader.rb:730:in `epilogue'
     # kernel/loader.rb:866:in `main'

  5) Minicron::CLI#run when in --dry-run mode with a valid --config file passed should run a simple command and print the output to stdout
     Failure/Error: Minicron.parse_file_config('./default.config.toml')
     NoMethodError:
       undefined method `load_file' on TOML (Module)
     # kernel/delta/kernel.rb:78:in `load_file (method_missing)'
     # ./lib/minicron.rb:68:in `parse_file_config'
     # ./spec/minicron/cli_spec.rb:22:in `__script__'
     # kernel/common/eval.rb:43:in `instance_eval'
     # kernel/bootstrap/array.rb:66:in `each'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/proc.rb:20:in `call'
     # kernel/loader.rb:710:in `run_at_exits'
     # kernel/loader.rb:730:in `epilogue'
     # kernel/loader.rb:866:in `main'

  6) Minicron::CLI#run when in --dry-run mode with a valid --config file passed should run a simple multi-line command and print the output to stdout
     Failure/Error: Minicron.parse_file_config('./default.config.toml')
     NoMethodError:
       undefined method `load_file' on TOML (Module)
     # kernel/delta/kernel.rb:78:in `load_file (method_missing)'
     # ./lib/minicron.rb:68:in `parse_file_config'
     # ./spec/minicron/cli_spec.rb:22:in `__script__'
     # kernel/common/eval.rb:43:in `instance_eval'
     # kernel/bootstrap/array.rb:66:in `each'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/proc.rb:20:in `call'
     # kernel/loader.rb:710:in `run_at_exits'
     # kernel/loader.rb:730:in `epilogue'
     # kernel/loader.rb:866:in `main'

  7) Minicron::CLI#run when in --dry-run mode with a valid --config file passed when a non-existent command is run should return an error
     Failure/Error: Minicron.parse_file_config('./default.config.toml')
     NoMethodError:
       undefined method `load_file' on TOML (Module)
     # kernel/delta/kernel.rb:78:in `load_file (method_missing)'
     # ./lib/minicron.rb:68:in `parse_file_config'
     # ./spec/minicron/cli_spec.rb:22:in `__script__'
     # kernel/common/eval.rb:43:in `instance_eval'
     # kernel/bootstrap/array.rb:66:in `each'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/proc.rb:20:in `call'
     # kernel/loader.rb:710:in `run_at_exits'
     # kernel/loader.rb:730:in `epilogue'
     # kernel/loader.rb:866:in `main'

  8) Minicron::CLI#run when in --dry-run mode with a valid --config file passed when no argument is passed to the run action should raise ArgumentError
     Failure/Error: Minicron.parse_file_config('./default.config.toml')
     NoMethodError:
       undefined method `load_file' on TOML (Module)
     # kernel/delta/kernel.rb:78:in `load_file (method_missing)'
     # ./lib/minicron.rb:68:in `parse_file_config'
     # ./spec/minicron/cli_spec.rb:22:in `__script__'
     # kernel/common/eval.rb:43:in `instance_eval'
     # kernel/bootstrap/array.rb:66:in `each'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/proc.rb:20:in `call'
     # kernel/loader.rb:710:in `run_at_exits'
     # kernel/loader.rb:730:in `epilogue'
     # kernel/loader.rb:866:in `main'

  9) Minicron::CLI#run when run in --verbose mode should set the verbose to true
     Failure/Error: Minicron.parse_file_config('./default.config.toml')
     NoMethodError:
       undefined method `load_file' on TOML (Module)
     # kernel/delta/kernel.rb:78:in `load_file (method_missing)'
     # ./lib/minicron.rb:68:in `parse_file_config'
     # ./spec/minicron/cli_spec.rb:22:in `__script__'
     # kernel/common/eval.rb:43:in `instance_eval'
     # kernel/bootstrap/array.rb:66:in `each'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/proc.rb:20:in `call'
     # kernel/loader.rb:710:in `run_at_exits'
     # kernel/loader.rb:730:in `epilogue'
     # kernel/loader.rb:866:in `main'

  10) Minicron::CLI#run_command when a non-existent command is run should raise an Exception
     Failure/Error: expect do
       expected Exception but nothing was raised
     # ./spec/minicron/cli_spec.rb:128:in `__script__'
     # kernel/common/eval.rb:43:in `instance_eval'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/proc.rb:20:in `call'
     # kernel/loader.rb:710:in `run_at_exits'
     # kernel/loader.rb:730:in `epilogue'
     # kernel/loader.rb:866:in `main'

  11) Minicron.parse_file_config when a valid toml file is passed should update the config class variable with the toml file config
     Failure/Error: parse_file_config = Minicron.parse_file_config('./spec/valid_config.toml')
     NoMethodError:
       undefined method `load_file' on TOML (Module)
     # kernel/delta/kernel.rb:78:in `load_file (method_missing)'
     # ./lib/minicron.rb:68:in `parse_file_config'
     # ./spec/minicron_spec.rb:106:in `__script__'
     # kernel/common/eval.rb:43:in `instance_eval'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/array.rb:87:in `map'
     # kernel/bootstrap/proc.rb:20:in `call'
     # kernel/loader.rb:710:in `run_at_exits'
     # kernel/loader.rb:730:in `epilogue'
     # kernel/loader.rb:866:in `main'

Finished in 2.64 seconds
54 examples, 11 failures, 2 pending

Failed examples:

rspec ./spec/minicron/cli_spec.rb:26 # Minicron::CLI#run when in --dry-run mode should run a simple command and print the output to stdout
rspec ./spec/minicron/cli_spec.rb:32 # Minicron::CLI#run when in --dry-run mode should run a simple multi-line command and print the output to stdout
rspec ./spec/minicron/cli_spec.rb:43 # Minicron::CLI#run when in --dry-run mode when a non-existent command is run should return an error
rspec ./spec/minicron/cli_spec.rb:53 # Minicron::CLI#run when in --dry-run mode when no argument is passed to the run action should raise ArgumentError
rspec ./spec/minicron/cli_spec.rb:64 # Minicron::CLI#run when in --dry-run mode with a valid --config file passed should run a simple command and print the output to stdout
rspec ./spec/minicron/cli_spec.rb:70 # Minicron::CLI#run when in --dry-run mode with a valid --config file passed should run a simple multi-line command and print the output to stdout
rspec ./spec/minicron/cli_spec.rb:81 # Minicron::CLI#run when in --dry-run mode with a valid --config file passed when a non-existent command is run should return an error
rspec ./spec/minicron/cli_spec.rb:91 # Minicron::CLI#run when in --dry-run mode with a valid --config file passed when no argument is passed to the run action should raise ArgumentError
rspec ./spec/minicron/cli_spec.rb:102 # Minicron::CLI#run when run in --verbose mode should set the verbose to true
rspec ./spec/minicron/cli_spec.rb:127 # Minicron::CLI#run_command when a non-existent command is run should raise an Exception
rspec ./spec/minicron_spec.rb:64 # Minicron.parse_file_config when a valid toml file is passed should update the config class variable with the toml file config
Coverage report generated for RSpec to /Users/james/Dropbox/University/Year 4/FYP/minicron/coverage. 295 / 303 LOC (97.36%) covered.

No longer valid due to "binary" releases.