Skip to content

Commit

Permalink
Merge pull request #2971 from nebulab/elia/move-script-files-to-bin
Browse files Browse the repository at this point in the history
Move script files to bin + documentation
  • Loading branch information
kennyadsl authored Nov 26, 2018
2 parents fa85e05 + 0b3409e commit 8c6b41c
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

- run:
name: Run Tests
command: ./build-ci.rb test
command: ./bin/build-ci test

- store_artifacts:
path: /tmp/test-artifacts
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
.loadpath
.project
.ruby-version
bin/*
doc
Gemfile.lock
Gemfile-custom
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Here's a quick guide:
2. Run the tests. We only take pull requests with passing tests, and it's great
to know that you have a clean slate:

$ bash build.sh
$ bin/build

3. Create new branch then make changes and add tests for your changes. Only
refactoring and documentation changes require no new tests. If you are adding
Expand Down
40 changes: 24 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,16 @@ Use at own risk.

* Clone the Git repo

```bash
git clone git://github.com/solidusio/solidus.git
cd solidus
```
```bash
git clone git://github.com/solidusio/solidus.git
cd solidus
```

* Install the gem dependencies

```bash
bundle install
```
```bash
bundle install
```

### Sandbox

Expand All @@ -188,10 +188,10 @@ data already loaded.

* Start the server

```bash
cd sandbox
rails server
```
```bash
cd sandbox
rails server
```

### Tests

Expand All @@ -211,16 +211,24 @@ You can see the build statuses at
[ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/home) is
required to run the frontend and backend test suites.

To execute all of the test specs, run the `build.sh` script at the root of the Solidus project:
To execute all of the test specs, run the `bin/build` script at the root of the Solidus project:

```bash
createuser --superuser --echo postgres # only the first time
bin/build
```

The `bin/build` script runs using PostgreSQL by default, but it can be overridden by setting the DB environment variable to `DB=sqlite` or `DB=mysql`. For example:

```bash
bash build.sh
env DB=mysql bin/build
```

The `build.sh` script runs using PostgreSQL by default, but it can be overridden by setting the DB environment variable to `DB=sqlite` or `DB=mysql`. For example:
If the command fails with MySQL related errors you can try creating a user with this command:

```bash
DB=mysql bash build.sh
# Creates a user with the same name as the current user and no restrictions.
mysql --user="root" --execute="CREATE USER '$USER'@'localhost'; GRANT ALL PRIVILEGES ON * . * TO '$USER'@'localhost';"
```

#### Run an individual test suite
Expand All @@ -236,7 +244,7 @@ By default, `rspec` runs the tests for SQLite 3. If you would like to run specs
against another database you may specify the database in the command:

```bash
DB=postgresql bundle exec rspec
env DB=postgresql bundle exec rspec
```

#### Code coverage reports
Expand Down
4 changes: 2 additions & 2 deletions build.sh → bin/build
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
#!/usr/bin/env bash

set -e

# Target postgresql. Override with: `DB=sqlite bash build.sh`
# Target postgresql. Override with: `env DB=sqlite bin/build`
export DB=${DB:-postgresql}

# Solidus defaults
Expand Down
File renamed without changes.
14 changes: 7 additions & 7 deletions guides/source/developers/getting-started/develop-solidus.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ You can prepend `DB=mysql` or `DB=postgresql` to the command in order use those
databases instead of the default SQLite 3 database. For example:

```bash
DB=postgresql bundle exec rake sandbox
env DB=postgresql bundle exec rake sandbox
```

After the sandbox has been generated, you can change into its directory and
Expand Down Expand Up @@ -68,19 +68,19 @@ You can see the build statuses [on our CircleCI status page][circleci].

### Run all Solidus test suites

To execute all of the test specs, run the `build.sh` script at the root of the
To execute all of the test specs, run the `bin/build` script at the root of the
Solidus project:

```bash
bash build.sh
bin/build
```

The `build.sh` script runs using PostgreSQL by default, but it can be overridden
The `bin/build` script runs using PostgreSQL by default, but it can be overridden
by setting the `DB` environment variable to `DB=sqlite` or `DB=mysql`. For
example:

```bash
DB=mysql bash build.sh
env DB=mysql bin/build
```

Note that this will fail if you have not installed ChromeDriver on your system.
Expand All @@ -99,7 +99,7 @@ By default, the tests run against the default SQLite 3 database. You can instead
specify `DB=mysql` or `DB=postgresql` by prepending it to the command:

```bash
DB=postgresql bundle exec rspec
env DB=postgresql bundle exec rspec
```

### Generate a code coverage report
Expand All @@ -108,7 +108,7 @@ You can generate a [SimpleCov][simplecov] code
coverage report by prepending `COVERAGE=true` to the `rspec` command:

```bash
COVERAGE=true bundle exec rspec
env COVERAGE=true bundle exec rspec
```

[simplecov]: https://github.com/colszowka/simplecov
Expand Down

0 comments on commit 8c6b41c

Please sign in to comment.