Compare commits

...

28 Commits

Author SHA1 Message Date
R. Tyler Croy d822ae541a Merge pull request #138 from bitwiseman/patch-3
Locked rake version to ~11.3.0
2016-12-13 17:24:47 -08:00
Liam Newman f6f71c98e4 Locked rake version to ~11.3.0
Rake 12.0 replace "last_comment" with "last_description".  

This describes the issue and possible fix:
http://stackoverflow.com/questions/35893584/nomethoderror-undefined-method-last-comment-after-upgrading-to-rake-11

Rather than upgrade rspec to 3.5.x and risk changes to test behavior, I've locked rake to the last version before 12.0.
2016-12-13 15:53:55 -08:00
R. Tyler Croy f9957b5629 Merge pull request #137 from bitwiseman/patch-2
Updated for latest Pipeline fixes
2016-11-17 13:56:48 -08:00
Liam Newman 35eba84dc6 Updated for latest Pipeline fixes
JENKINS-29711 was fixed and stage step now uses curly braces
2016-11-17 13:53:09 -08:00
R. Tyler Croy 68515effc7 Merge pull request #136 from bitwiseman/feature/simplepipe
Simplify Pipeline
2016-07-06 17:52:11 -07:00
Liam Newman 69af2e310f Simplify Pipeline 2016-07-06 17:01:35 -07:00
R. Tyler Croy 9473c8b24b Merge pull request #135 from bitwiseman/feature/jenkinsfile
Add Jenkins pipeline
2016-06-30 10:15:37 -07:00
Liam Newman e0225b6761 Add Jenkins pipeline 2016-06-29 17:36:30 -07:00
R. Tyler Croy a4d678deaf Merge pull request #134 from bitwiseman/patch-1
Update README.md
2016-06-17 13:12:51 -07:00
Liam Newman 5dd952145b Update README.md
Add simple build and unit test instructions.   Similar to what is in releasing document.
2016-06-17 13:09:26 -07:00
R. Tyler Croy 9f5cf12151
No sense supporting ree in any capacity any more 2016-05-29 18:32:37 -07:00
R. Tyler Croy f71ab11ea2 Merge pull request #132 from thedrow/patch-1
Added Ruby 2.2 and 2.3 to the matrix
2016-05-29 18:29:58 -07:00
R. Tyler Croy 436ec9be82 Merge pull request #133 from jfeltesse-mdsol/concurrent_ruby
depend on concurrent-ruby ~> 1.0.0
2016-02-24 08:29:11 -08:00
Julien Feltesse 587f3be16e depend on concurrent-ruby ~> 1.0.0 2016-02-24 18:19:06 +09:00
Omer Katz c2b2274af3 Specify 2.3.0 instead of 2.3 for travis. 2016-02-04 17:06:39 +02:00
Omer Katz c8fe7e06b5 Added Ruby 2.2 and 2.3 to the matrix. 2016-02-04 14:17:55 +02:00
R. Tyler Croy 246f27e76d
Add some code coverage while we're here 2016-02-03 05:32:57 -08:00
R. Tyler Croy bc560f21ea
Add support for generating JUnit-compatible output for Jenkins 2016-02-03 05:09:30 -08:00
R. Tyler Croy 9f8fbe381c Merge pull request #128 from rtyler/minor-doc-fixes
Minor doc fixes
2015-09-30 09:51:42 -07:00
R. Tyler Croy 5b669504af
Document the current janky release process
At least this way I won't forget each time

Fixes #126
2015-09-30 09:45:20 -07:00
R. Tyler Croy d4a350c65c
Update the gitter and travis badges after repo move 2015-09-30 09:39:10 -07:00
R. Tyler Croy 17b51359a9 Merge pull request #127 from rtyler/upgrade-scala-dependency
Upgrade scala dependency
2015-09-28 11:18:33 -07:00
R. Tyler Croy 0ad9be88f0
Upgrade bundler for our Travis build 2015-09-28 11:12:33 -07:00
R. Tyler Croy 8422e82125
Move hermann to the newer faster travis infra 2015-09-28 10:25:43 -07:00
R. Tyler Croy 1c7543f730
Upgrade to a Kafka (JVM) version which uses Scala 2.11
Scala 2.10 is three years old and it appears to me tha 2.10 is moderately
broken and old, at that 2.11 is the bare minimum folks should be using these
days (see also: https://github.com/twitter/scrooge/pull/198)
2015-09-28 08:43:50 -07:00
R. Tyler Croy 9d5b773542
Properly include hermann_jars.rb in the built gem but exclude from the tree 2015-09-23 13:19:40 -07:00
R. Tyler Croy ecae27dd65 Merge pull request #125 from rtyler/no-fixed-jars
Remove hard-coded hermann_jars.rb
2015-09-23 08:08:24 -07:00
R. Tyler Croy e9d301be3d
Remove hermann_jars.rb to gem installation to generate it properly
Fixes #124
2015-09-23 07:52:21 -07:00
11 changed files with 91 additions and 23 deletions

3
.gitignore vendored
View File

@ -13,3 +13,6 @@ tmp/
Gemfile.lock
Jarfile.lock
.jbundler/
lib/hermann_jars.rb
coverage/
spec/reports

View File

@ -1,10 +1,17 @@
language: ruby
sudo: false
rvm:
- ruby-head
- 2.3.0
- 2.2
- 2.1
- 1.9.3
- jruby
- ree
# upgrading bundler since our gemspec relying on lib/hermann_jars.rb being
# present causes troubles with bundler .17.x
before_install:
- gem install bundler -N --version ">= 1.8.0"
#deploy:
# provider: rubygems
# gemspec: hermann.gemspec

View File

@ -4,7 +4,7 @@ gemspec
group :development do
gem 'jbundler', :platform => :jruby
gem 'rake'
gem 'rake', '~> 11.3.0'
gem 'i18n', '~> 0.6.11', :platform => :mri_18
gem 'activesupport', '~> 3.x', :platform => :mri_18
gem 'ruby-maven', '~> 3.1.1.0', :platform => :jruby
@ -23,4 +23,8 @@ group :test do
# Used for testing encoding protobufs in an out of Hermann in integration
# tests
gem 'protobuffy'
gem 'ci_reporter_rspec'
gem 'simplecov'
gem 'simplecov-rcov'
end

33
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,33 @@
#!groovy
/* Only keep the 10 most recent builds. */
properties([[$class: 'BuildDiscarderProperty',
strategy: [$class: 'LogRotator', numToKeepStr: '10']]])
stage ('Build') {
node {
// Checkout
checkout scm
// install required bundles
sh 'bundle install'
// build and run tests with coverage
sh 'bundle exec rake build spec'
// Archive the built artifacts
archive (includes: 'pkg/*.gem')
// publish html
publishHTML ([
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: 'coverage',
reportFiles: 'index.html',
reportName: "RCov Report"
])
}
}

View File

@ -1,6 +1,6 @@
# Hermann
[![Gitter chat](https://badges.gitter.im/lookout/Hermann.png)](https://gitter.im/lookout/Hermann) [![Build Status](https://travis-ci.org/lookout/hermann.svg?branch=master)](https://travis-ci.org/lookout/hermann)
[![Gitter chat](https://badges.gitter.im/reiseburo/hermann.png)](https://gitter.im/reiseburo/hermann) [![Build Status](https://travis-ci.org/reiseburo/hermann.svg?branch=master)](https://travis-ci.org/reiseburo/hermann)
A Ruby gem implementing a Kafka Publisher and Consumer
@ -114,6 +114,14 @@ end
```
#### Build & Unit Test
First time (from a clean repository):
`bundle install && bundle exec rake`
Thereafter:
`bundle exec rake spec`
#### Testing
To run the integration tests:

17
RELEASING.md Normal file
View File

@ -0,0 +1,17 @@
# Releasing Hermann
Hermann is a multi-platform gem, which means that two actual `.gem` files need
to be built and uploaded to [rubygems.org](https://rubygems.org/gems/hermann).
Here's the current process that [I](https://github.com/rtyler) use:
* `rvm use ruby@rubygems` (*switch to MRI*)
* `bundle install && rake` (*ensure that MRI tests pass*)
* `rvm use jruby@rubygems` (*switch to JRuby*)
* `bundle install && rake` (*ensure that the JRuby tests pass*)
* `rake release` (*tag the release and upload the `-java` platform gem*)
* `rvm use ruby@rubygems` (*switch back to MRI*)
* `gem build hermann.gemspec` (*build the 'ruby' platform gem*)
* `gem push pkg/hermann-0.blah.gem` (*upload the ruby platform gem*)
This can certainly be cleaned up, but this is the process at it is right now

View File

@ -3,7 +3,7 @@ require 'fileutils'
require "bundler/gem_tasks"
require 'rspec/core/rake_task'
require 'rake/extensiontask'
require 'ci/reporter/rake/rspec'
Rake::ExtensionTask.new do |t|
t.name = 'hermann_rdkafka'

View File

@ -16,7 +16,7 @@ Gem::Specification.new do |s|
s.homepage = 'https://github.com/lookout/Hermann'
s.licenses = ['MIT']
s.files = [ "Rakefile"]
s.files = ['Rakefile']
s.files += `git ls-files -- lib`.split($\)
s.files += `git ls-files -- ext`.split($\)
@ -28,15 +28,16 @@ Gem::Specification.new do |s|
s.add_dependency 'thread_safe', '~> 0.3.4'
if RUBY_PLATFORM == "java"
s.add_dependency 'concurrent-ruby', '~> 0.7.0'
s.files << 'lib/hermann_jars.rb'
s.add_dependency 'concurrent-ruby', '~> 1.0.0'
# IMPORTANT: make sure that jar-dependencies is only a development
# dependency of your gem. if it is a runtime dependencies the require_jars
# file will be overwritten during installation.
s.add_dependency 'jar-dependencies', ['~> 0.1', '>= 0.1.10']
s.requirements << "jar org.apache.kafka:kafka_2.10, ~>0.8.1.1"
s.requirements << "jar org.apache.kafka:kafka_2.11, ~> 0.8.2.2"
# use log4j-1.2.16+ to as 1.2.15 declares deps which are not in maven central and causes the dep resolution to fail
s.requirements << "jar log4j:log4j, ~>1.2.16"
s.requirements << "jar log4j:log4j, ~> 1.2.16"
s.require_paths = ["lib"]
s.platform = 'java'
else

View File

@ -102,7 +102,8 @@ module Hermann
@children.each do |child|
# Skip over any children that should already be reaped for other
# reasons
next if child.completed?
next if (Hermann.jruby? ? child.fulfilled? : child.completed?)
# Propagate errors to the remaining children
child.internal_set_error(ex)
end
@ -118,7 +119,7 @@ module Hermann
# Filter all children who are no longer pending/fulfilled
total_children = @children.size
@children = @children.reject { |c| c.completed? }
@children = @children.reject { |c| Hermann.jruby? ? c.fulfilled? : c.completed? }
return (total_children - children.size)
end

View File

@ -1,13 +0,0 @@
# this is a generated file, to avoid over-writing it just delete this comment
require 'jar_dependencies'
require_jar( 'org.apache.zookeeper', 'zookeeper', '3.3.4' )
require_jar( 'net.sf.jopt-simple', 'jopt-simple', '3.2' )
require_jar( 'org.xerial.snappy', 'snappy-java', '1.0.5' )
require_jar( 'jline', 'jline', '0.9.94' )
require_jar( 'com.101tec', 'zkclient', '0.3' )
require_jar( 'log4j', 'log4j', '1.2.17' )
require_jar( 'org.scala-lang', 'scala-library', '2.10.1' )
require_jar( 'org.slf4j', 'slf4j-api', '1.7.2' )
require_jar( 'com.yammer.metrics', 'metrics-core', '2.2.0' )
require_jar( 'org.apache.kafka', 'kafka_2.10', '0.8.1.1' )

View File

@ -2,6 +2,13 @@ require 'rubygems'
require 'yaml'
require 'rspec'
require 'simplecov'
require 'simplecov-rcov'
SimpleCov.start do
formatter = SimpleCov::Formatter::RcovFormatter
end
# Add ext/ to the load path so we can load `hermann_lib`
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/../ext/'))
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib/'))