forked from camilo/lhm
-
Notifications
You must be signed in to change notification settings - Fork 25
Run tests for LHM with dev and shopify-build
#32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| v1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| containers: | ||
| default: | ||
| docker: circleci/ruby:2.5.1 | ||
|
|
||
| steps: | ||
| - label: Tests | ||
| timeout: 15m | ||
| cache: | ||
| - /usr/local/bundle | ||
| - /app/dbdeployer/binaries | ||
| run: | ||
| - bundle check || bundle install | ||
| - sudo apt-get update | ||
| - sudo apt-get install numactl libaio-dev | ||
| - ./dbdeployer/install.sh | ||
| - bundle exec rake integration | ||
| - bundle exec rake unit | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| PATH | ||
| remote: . | ||
| specs: | ||
| lhm (3.0.0.alpha) | ||
|
|
||
| GEM | ||
| remote: https://rubygems.org/ | ||
| specs: | ||
| activemodel (5.2.0) | ||
| activesupport (= 5.2.0) | ||
| activerecord (5.2.0) | ||
| activemodel (= 5.2.0) | ||
| activesupport (= 5.2.0) | ||
| arel (>= 9.0) | ||
| activesupport (5.2.0) | ||
| concurrent-ruby (~> 1.0, >= 1.0.2) | ||
| i18n (>= 0.7, < 2) | ||
| minitest (~> 5.1) | ||
| tzinfo (~> 1.1) | ||
| arel (9.0.0) | ||
| concurrent-ruby (1.0.5) | ||
| domain_name (0.5.20180417) | ||
| unf (>= 0.0.5, < 1.0.0) | ||
| highline (1.6.20) | ||
| http-cookie (1.0.3) | ||
| domain_name (~> 0.5) | ||
| i18n (1.0.1) | ||
| concurrent-ruby (~> 1.0) | ||
| json_pure (1.8.1) | ||
| metaclass (0.0.4) | ||
| mime-types (3.1) | ||
| mime-types-data (~> 3.2015) | ||
| mime-types-data (3.2016.0521) | ||
| minitest (5.11.3) | ||
| mocha (1.5.0) | ||
| metaclass (~> 0.0.1) | ||
| mysql2 (0.5.2) | ||
| netrc (0.11.0) | ||
| package_cloud (0.3.05) | ||
| highline (= 1.6.20) | ||
| json_pure (= 1.8.1) | ||
| rainbow (= 2.2.2) | ||
| rest-client (~> 2.0) | ||
| thor (~> 0.18) | ||
| rainbow (2.2.2) | ||
| rake | ||
| rake (12.3.1) | ||
| rest-client (2.0.2) | ||
| http-cookie (>= 1.0.2, < 2.0) | ||
| mime-types (>= 1.16, < 4.0) | ||
| netrc (~> 0.8) | ||
| thor (0.20.0) | ||
| thread_safe (0.3.6) | ||
| tzinfo (1.2.5) | ||
| thread_safe (~> 0.1) | ||
| unf (0.1.4) | ||
| unf_ext | ||
| unf_ext (0.0.7.5) | ||
|
|
||
| PLATFORMS | ||
| ruby | ||
|
|
||
| DEPENDENCIES | ||
| activerecord | ||
| lhm! | ||
| minitest | ||
| mocha | ||
| mysql2 | ||
| package_cloud | ||
| rake | ||
|
|
||
| BUNDLED WITH | ||
| 1.16.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { | ||
| "version": "1.8.0", | ||
| "sandbox-home": "./dbdeployer/sandboxes", | ||
| "sandbox-binary": "./dbdeployer/binaries", | ||
| "use-sandbox-catalog": true, | ||
| "master-slave-base-port": 11000, | ||
| "group-replication-base-port": 12000, | ||
| "group-replication-sp-base-port": 13000, | ||
| "fan-in-replication-base-port": 14000, | ||
| "all-masters-replication-base-port": 15000, | ||
| "multiple-base-port": 16000, | ||
| "group-port-delta": 125, | ||
| "mysqlx-port-delta": 10000, | ||
| "master-name": "master", | ||
| "master-abbr": "m", | ||
| "node-prefix": "node", | ||
| "slave-prefix": "slave", | ||
| "slave-abbr": "s", | ||
| "sandbox-prefix": "msb_", | ||
| "master-slave-prefix": "rsandbox_", | ||
| "group-prefix": "group_msb_", | ||
| "group-sp-prefix": "group_sp_msb_", | ||
| "multiple-prefix": "multi_msb_", | ||
| "fan-in-prefix": "fan_in_msb_", | ||
| "all-masters-prefix": "all_masters_msb_", | ||
| "reserved-ports": [ | ||
| 1186, | ||
| 3306, | ||
| 33060 | ||
| ], | ||
| "timestamp": "Mon Jul 16 17:36:55 AST 2018" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| set -e | ||
| mkdir -p ./dbdeployer/sandboxes | ||
| mkdir -p ./dbdeployer/binaries | ||
|
|
||
| if [ -z "$(uname | grep Darwin)" ]; then | ||
| OS=linux | ||
| set -x | ||
| else | ||
| OS=osx | ||
| fi | ||
|
|
||
| echo "Checking if dbdeployer is installed" | ||
| if ! [ -x "$(command -v ./bin/dbdeployer)" ]; then | ||
| echo "Not installed...starting install" | ||
| VERSION=1.8.0 | ||
| origin=https://github.com/datacharmer/dbdeployer/releases/download/$VERSION | ||
| filename=dbdeployer-$VERSION.$OS | ||
| wget -q $origin/$filename.tar.gz | ||
| tar -xzf $filename.tar.gz | ||
| chmod +x $filename | ||
| sudo mv $filename ./bin/dbdeployer | ||
| rm $filename.tar.gz | ||
| else | ||
| echo "Installation found!" | ||
| fi | ||
|
|
||
|
|
||
| echo "Checking if mysql 5.7.22 is available for dbdeployer" | ||
| if [ -z "$(./bin/dbdeployer --config ./dbdeployer/config.json --sandbox-binary "./dbdeployer/binaries" available | grep 5.7.22)" ]; then | ||
| echo "Not found..." | ||
|
|
||
| if [ "$OS" = "linux" ]; then | ||
| MYSQL_FILE=mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz | ||
| else | ||
| MYSQL_FILE=mysql-5.7.22-macos10.13-x86_64.tar.gz | ||
| fi | ||
|
|
||
| if [ ! -f $MYSQL_FILE ]; then | ||
| echo "Downloading $MYSQL_FILE...(this may take a while)" | ||
| wget -q "https://dev.mysql.com/get/Downloads/MySQL-5.7/$MYSQL_FILE" | ||
| fi | ||
|
|
||
| echo "Setting up..." | ||
| ./bin/dbdeployer unpack $MYSQL_FILE --verbosity 0 --config ./dbdeployer/config.json --sandbox-binary "./dbdeployer/binaries" | ||
| rm $MYSQL_FILE | ||
| else | ||
| echo "mysql 5.7.22 found!" | ||
| fi | ||
|
|
||
| echo "Forcing new replication setup..." | ||
| ./bin/dbdeployer deploy replication 5.7.22 --nodes 2 --force --config ./dbdeployer/config.json --sandbox-binary "./dbdeployer/binaries" --sandbox-home "./dbdeployer/sandboxes" | ||
| ./bin/dbdeployer global status --config ./dbdeployer/config.json --sandbox-binary "./dbdeployer/binaries" --sandbox-home "./dbdeployer/sandboxes" | ||
|
|
||
| echo "Setting up database.yml" | ||
| DATABASE_YML=spec/integration/database.yml | ||
| echo "master:" > $DATABASE_YML | ||
| cat ./dbdeployer/sandboxes/rsandbox_5_7_22/master/my.sandbox.cnf | grep -A 4 client | tail -n 4 | sed -e 's/ * = /: /' -e 's/^/ /' >> $DATABASE_YML | ||
|
|
||
| echo "slave:" >> $DATABASE_YML | ||
| cat ./dbdeployer/sandboxes/rsandbox_5_7_22/node1/my.sandbox.cnf | grep -A 4 client | tail -n 4 | sed -e 's/ * = /: /' -e 's/^/ /' >> $DATABASE_YML | ||
|
|
||
| cat $DATABASE_YML | ||
|
|
||
| echo "You are ready to run the integration test suite..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| name: lhm | ||
| up: | ||
| - homebrew: | ||
| - openssl | ||
| - shopify/shopify/mysql-client | ||
| - wget | ||
| - ruby: 2.5.0 | ||
| - bundler | ||
| - custom: | ||
| name: Database | ||
| met?: test -f spec/integration/database.yml && test "$(./dbdeployer/sandboxes/rsandbox_5_7_22/status_all | grep on | wc -l | xargs echo)" = "2" | ||
| meet: ./dbdeployer/install.sh | ||
| down: ./dbdeployer/sandboxes/rsandbox_5_7_22/stop_all | ||
|
|
||
| commands: | ||
| unit: bundle exec rake unit | ||
| int: bundle exec rake integration | ||
| test: bundle exec rake unit && bundle exec rake integration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May want to add a note about how this LHM is a downstream fork for our usages as this is a public repository.