generated from dxw/rails-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker compose can be asked to run the test suite
Include these instructions as the first option as they are the most convenient way for new people to get the tests running. For people developing and running the test suite often, non Docker is much faster. Included some explanation of trade-offs to help the person make the right decision.
- Loading branch information
Showing
7 changed files
with
121 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,36 @@ | ||
version: "3.8" | ||
services: | ||
test: | ||
build: | ||
context: . | ||
args: | ||
RAILS_ENV: "test" | ||
BUNDLE_EXTRA_GEM_GROUPS: "test" | ||
command: bundle exec rake | ||
ports: | ||
- "3000:3000" | ||
depends_on: | ||
- test-db | ||
env_file: | ||
- .env.test | ||
environment: | ||
DATABASE_URL: postgres://postgres:password@test-db:5432/buy-for-your-school-test | ||
DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL: "true" | ||
networks: | ||
- test | ||
|
||
test-db: | ||
image: postgres | ||
volumes: | ||
- db-data:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: password | ||
POSTGRES_HOST_AUTH_METHOD: trust | ||
networks: | ||
- test | ||
|
||
networks: | ||
test: | ||
volumes: | ||
db-data: |
This file contains 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,39 @@ | ||
version: "3.8" | ||
services: | ||
test: | ||
build: | ||
context: . | ||
args: | ||
RAILS_ENV: "test" | ||
command: bundle exec rake | ||
ports: | ||
- "3000:3000" | ||
depends_on: | ||
- test-db | ||
env_file: | ||
- .env.test | ||
environment: | ||
DATABASE_URL: postgres://postgres:password@test-db:5432/buy-for-your-school-test | ||
DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL: "true" | ||
volumes: | ||
- .:/srv/app | ||
tty: true | ||
stdin_open: true | ||
networks: | ||
- test | ||
|
||
test-db: | ||
image: postgres | ||
volumes: | ||
- db-data:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: password | ||
POSTGRES_HOST_AUTH_METHOD: trust | ||
networks: | ||
- test | ||
|
||
networks: | ||
test: | ||
volumes: | ||
db-data: |
This file contains 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 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,8 @@ | ||
#!/bin/sh | ||
|
||
# script/server: Launch the application and any extra required processes | ||
# locally. | ||
|
||
set -e | ||
|
||
bundle exec rake |