Commit 7c1e22f8 authored by Aanand Prasad's avatar Aanand Prasad
Browse files

Reorganise scripts

- Move bin/ci-test to script/ci-test
- Move bin/test to script/test
- Split bin/start test case out into bin/test
parent 0bb442a2
......@@ -7,4 +7,4 @@ test:
script:
- docker info
- docker-compose --version
- ./bin/ci-test
- ./script/ci-test
......@@ -22,10 +22,10 @@ The INK API is now running. See [ink-client](https://gitlab.coko.foundation/INK/
## Run tests
Run `bin/test` to run the tests in a Docker container. You can pass files or directories as arguments to scope the run to particular tests:
Run `script/test` to run the tests in a Docker container. You can pass files or directories as arguments to scope the run to particular tests:
bin/test spec/models
bin/test spec/controllers/v1/admin_controller_spec.rb
script/test spec/models
script/test spec/controllers/v1/admin_controller_spec.rb
## Setup gitlab CI
......
#!/usr/bin/env bash
set -ex
if [[ $RAILS_ENV == 'test' ]]; then
./bin/rake db:create
./bin/bundle exec rspec "$@"
else
./bin/rails s -p 3000 -b 0.0.0.0
fi
./bin/rails s -p 3000 -b 0.0.0.0
#!/bin/bash
set -ex
#!/usr/bin/env bash
set -e
export COMPOSE_FILE=docker-compose.yml:docker-compose.test.yml
export RAILS_ENV=test
docker-compose up -d postgres redis
docker-compose run -v "$PWD:/app" -v "gems:/gems" ink "$@"
./bin/rake db:create
./bin/bundle exec rspec "$@"
......@@ -11,4 +11,4 @@ services:
depends_on:
- postgres
- redis
entrypoint: ['./bin/wait-for-it', 'postgres:5432', '-s', '-t', '40', '--', './bin/start']
entrypoint: ['./bin/wait-for-it', 'postgres:5432', '-s', '-t', '40', '--', './bin/test']
#!/bin/sh
set -ex
set -e
RED='\033[0;31m'
GREEN='\033[0;32m'
......
#!/usr/bin/env bash
set -e
export COMPOSE_FILE=docker-compose.yml:docker-compose.test.yml
export RAILS_ENV=test
docker-compose up -d postgres redis
docker-compose run -v "$PWD:/app" -v "gems:/gems" ink "$@"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment