Skip to content

Commit

Permalink
Use shared setup script
Browse files Browse the repository at this point in the history
Add steps to Travis CI build to install Riak
  • Loading branch information
Luke Bakken committed Sep 23, 2016
1 parent 98ef673 commit 7d0045b
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 65 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "tools"]
path = tools
url = https://github.com/basho/riak-client-tools
61 changes: 14 additions & 47 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,26 @@
language: php

php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1

- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
sudo: required

dist: trusty

addons:
hosts:
- riak-test

- riak-test
before_script:
- composer self-update
- composer install --prefer-source
- curl -s https://packagecloud.io/install/repositories/basho/riak/script.deb.sh | sudo bash
- sudo apt-get install riak=2.1.4-1
- echo 'search = on' | sudo tee -a /etc/riak/riak.conf
- echo 'nodename = [email protected]' | sudo tee -a /etc/riak/riak.conf
- echo 'storage_backend = multi' | sudo tee -a /etc/riak/riak.conf
- echo 'multi_backend.default = leveldb_backend' | sudo tee -a /etc/riak/riak.conf
- echo 'multi_backend.bitcask_backend.storage_backend = bitcask' | sudo tee -a /etc/riak/riak.conf
- echo 'multi_backend.bitcask_backend.bitcask.data_root = $(platform_data_dir)/bitcask' | sudo tee -a /etc/riak/riak.conf
- echo 'multi_backend.bitcask_backend.bitcask.io_mode = erlang' | sudo tee -a /etc/riak/riak.conf
- echo 'multi_backend.leveldb_backend.storage_backend = leveldb' | sudo tee -a /etc/riak/riak.conf
- echo 'multi_backend.leveldb_backend.leveldb.data_root = $(platform_data_dir)/leveldb' | sudo tee -a /etc/riak/riak.conf
- echo 'multi_backend.leveldb_backend.leveldb.maximum_memory.percent = 30' | sudo tee -a /etc/riak/riak.conf
- echo 'multi_backend.mem_backend.storage_backend = memory' | sudo tee -a /etc/riak/riak.conf
- echo 'multi_backend.mem_backend.memory_backend.ttl = 10s' | sudo tee -a /etc/riak/riak.conf
- echo 'multi_backend.mem_backend.memory_backend.max_memory_per_vnode = 4MB' | sudo tee -a /etc/riak/riak.conf
- sudo riak start
- sudo riak-admin bucket-type create phptest_counters '{"props":{"datatype":"counter"}}'
- sudo riak-admin bucket-type create phptest_maps '{"props":{"datatype":"map"}}'
- sudo riak-admin bucket-type create phptest_sets '{"props":{"datatype":"set"}}'
- sudo riak-admin bucket-type create phptest_search '{"props":{}}'
- sudo riak-admin bucket-type create phptest_leveldb '{"props":{"backend":"leveldb_backend"}}'
- sudo riak-admin bucket-type activate phptest_counters
- sudo riak-admin bucket-type activate phptest_maps
- sudo riak-admin bucket-type activate phptest_sets
- sudo riak-admin bucket-type activate phptest_search
- sudo riak-admin bucket-type activate phptest_leveldb

- phpenv config-rm xdebug.ini
- composer self-update
- composer install --prefer-source
- sudo ./tools/travis-ci/riak-install
- sudo ./tools/devrel/riak-cluster-config "$(which riak-admin)" 8098 false false
- riak version
notifications:
webhooks: http://basho-engbot.herokuapp.com/travis?key=8d594c660ec46f616e37e24fd941c0ea1fc67963
email: [email protected]
slack:
secure: 1i+11wGT6fqJvR+7dWCC449HrxnB+2UvEReZQe/PretyiqY0+qjNWXA9+7rc8tjPfkAJpD89lDzekcFYQwTrsouliNM4FK7Ibb5n4iNjHww4KTFn8lnB2Ywy5wwex7L55kDrNgYrNaqcSoJcXDDlFJpsXZKo/Yaq0/w4Wu8cyCU=

secure: ZtgcjTxhTxrzWW6MIHLRtucW/BMm42RKS3nGRtSfgER9rx7oJ0Y9gOYkh1FM0GsM7Z11Q/iDhWs/8WTccAV0PrMZ6KHaq54wGmfYyqwPM4YreUwQ87PnOW4wZbl0TJTeWutasEwZvnVJ8VEyyQcS2PHt0zlsENn0XWvobvaZ+FM=
script: "./vendor/bin/phpunit --coverage-text"

matrix:
allow_failures:
- php: 7.1

- php: 7.1
24 changes: 11 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ The most immediately helpful way you can benefit this project is by forking the

### Pull Request Process

Heres how to get started:
Here's how to get started:

* Fork the appropriate sub-projects that are affected by your change.
* Create a topic branch for your change and checkout that branch.
`git checkout -b some-topic-branch`
* Make your changes and run the test suite if one is provided. (see below)
* Commit your changes and push them to your fork.
* Open pull requests for the appropriate projects.
* Contributors will review your pull request, suggest changes, and merge it when its ready and/or offer feedback.
* Contributors will review your pull request, suggest changes, and merge it when it's ready and/or offer feedback.

### Coding Standards
Here are the standards we expect to see when considering pull requests
Expand Down Expand Up @@ -100,17 +100,15 @@ You can execute code coverage analysis along side the test run by appending ` --
Please note, that the Functional and Scenario tests require a live Riak instance to test against. Also, the following bucket types to be created and activated on the Riak instance. If using the [riak-clients-vagrant](https://github.com/basho-labs/riak-clients-vagrant) project, the `integration_testing` role creates these bucket types for you.

```bash
riak-admin bucket-type create phptest_counters '{"props":{"datatype":"counter"}}'
riak-admin bucket-type create phptest_sets '{"props":{"datatype":"set"}}'
riak-admin bucket-type create phptest_maps '{"props":{"datatype":"map"}}'
riak-admin bucket-type create phptest_search '{"props":{}}'
riak-admin bucket-type create phptest_leveldb '{"props":{}}'

riak-admin bucket-type activate phptest_counters
riak-admin bucket-type activate phptest_sets
riak-admin bucket-type activate phptest_maps
riak-admin bucket-type activate phptest_search
riak-admin bucket-type activate phptest_leveldb
riak-admin bucket-type create counters '{"props":{"datatype":"counter"}}'
riak-admin bucket-type create sets '{"props":{"datatype":"set"}}'
riak-admin bucket-type create maps '{"props":{"datatype":"map"}}'
riak-admin bucket-type create yokozuna '{"props":{}}'

riak-admin bucket-type activate counters
riak-admin bucket-type activate sets
riak-admin bucket-type activate maps
riak-admin bucket-type activate yokozuna
```

## Thank You
Expand Down
10 changes: 5 additions & 5 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase
const TEST_NODE_HTTP_PORT = 8098;
const TEST_NODE_SECURE_PORT = 10011;

const SEARCH_BUCKET_TYPE = 'phptest_search';
const COUNTER_BUCKET_TYPE = 'phptest_counters';
const MAP_BUCKET_TYPE = 'phptest_maps';
const SET_BUCKET_TYPE = 'phptest_sets';
const SEARCH_BUCKET_TYPE = 'yokozuna';
const COUNTER_BUCKET_TYPE = 'counters';
const MAP_BUCKET_TYPE = 'maps';
const SET_BUCKET_TYPE = 'sets';
const HLL_BUCKET_TYPE = 'hlls';
const LEVELDB_BUCKET_TYPE = 'phptest_leveldb';
const LEVELDB_BUCKET_TYPE = 'plain';

/**
* @var \Basho\Riak|null
Expand Down
1 change: 1 addition & 0 deletions tools
Submodule tools added at 16a6c5

0 comments on commit 7d0045b

Please sign in to comment.