Skip to content

Commit

Permalink
Merge pull request #88 from embulk/fix-travis2
Browse files Browse the repository at this point in the history
Fix travis to work with embulk 0.9.x
  • Loading branch information
sonots committed Mar 3, 2019
2 parents d08803c + 46cf9d7 commit 387c70e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 17 deletions.
22 changes: 11 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ matrix:
- env: EMBULK_VERSION=0.8.39
rvm: jruby-9.1.5.0 # bundled jruby version
jdk: openjdk7 # embulk 0.8.x uses jdk7
# - env: EMBULK_VERSION=0.9.15
# rvm: jruby-9.1.5.0 # bundled jruby version
# jdk: openjdk8 # embulk 0.9.x uses jdk8
# - env: EMBULK_VERSION=latest
# rvm: jruby-9.1.5.0 # ?
# jdk: openjdk8 # ?
# allow_failures:
# - env: EMBULK_VERSION=latest
# before_install:
# - curl -o embulk.jar --create-dirs -L "http://dl.embulk.org/embulk-${EMBULK_VERSION}.jar"
# script: bundle exec env RUBYOPT="-r $PWD/embulk.jar -r embulk" rake test
- env: EMBULK_VERSION=0.9.15
rvm: jruby-9.1.5.0 # bundled jruby version
jdk: openjdk8 # embulk 0.9.x uses jdk8
- env: EMBULK_VERSION=latest
rvm: jruby-9.1.5.0 # ?
jdk: openjdk8 # ?
allow_failures:
- env: EMBULK_VERSION=latest
before_install:
- curl -o embulk.jar --create-dirs -L "http://dl.embulk.org/embulk-${EMBULK_VERSION}.jar"
script: bundle exec env RUBYOPT="-r ./embulk.jar" rake test
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,16 +444,24 @@ $ embulk run -X page_size=1 -b . -l trace example/example.yml

### Run test:

Place your embulk with `.jar` extension:

```
$ cp -a $(which embulk) embulk.jar
```

Run tests with `env RUBYOPT="-r ./embulk.jar`:

```
$ bundle exec rake test
$ bundle exec env RUBYOPT="-r ./embulk.jar" rake test
```

To run tests which actually connects to BigQuery such as test/test\_bigquery\_client.rb,
prepare a json\_keyfile at example/your-project-000.json, then

```
$ bundle exec ruby test/test_bigquery_client.rb
$ bundle exec ruby test/test_example.rb
$ bundle exec env RUBYOPT="-r ./embulk.jar" ruby test/test_bigquery_client.rb
$ bundle exec env RUBYOPT="-r ./embulk.jar" ruby test/test_example.rb
```

### Release gem:
Expand Down
1 change: 0 additions & 1 deletion embulk-output-bigquery.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Gem::Specification.new do |spec|
spec.add_dependency 'google-api-client'
spec.add_dependency 'time_with_zone'

spec.add_development_dependency 'embulk', ['>= 0.8.2']
spec.add_development_dependency 'bundler', ['>= 1.10.6']
spec.add_development_dependency 'rake', ['>= 10.0']
end
9 changes: 7 additions & 2 deletions test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
require 'test/unit'
require 'test/unit/rr'

# require 'embulk/java/bootstrap'
require 'embulk'
Embulk.setup
begin
# Embulk ~> 0.8.x
Embulk.setup
rescue NotImplementedError
# Embulk ~> 0.9.x
require 'embulk/java/bootstrap'
end
Embulk.logger = Embulk::Logger.new('/dev/null')

APP_ROOT = File.expand_path('../', __dir__)
Expand Down

0 comments on commit 387c70e

Please sign in to comment.