Skip to content

Commit

Permalink
Make sure bundle install is run before tests in docker
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisrlc committed Oct 2, 2024
1 parent b07cf1c commit f8b68be
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ FROM dev_base as test
ENV RAILS_ENV=test \
APP_PATH=/exhibits

# Install application gems
WORKDIR $APP_PATH
COPY Gemfile Gemfile.lock ./
RUN bundle install

COPY . .

ENTRYPOINT [ "docker/build_test.sh" ]
Expand Down
5 changes: 4 additions & 1 deletion docker/build_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

set -e

# Install gems
bundle install

# Prepare DB (Migrate if exists; else Create db & Migrate)
sh ./docker/db_prepare.sh

# Run the command defined in compose.test.yaml
# Run commands
exec "$@"
2 changes: 1 addition & 1 deletion docker/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ done

if [ $interactive = true ]
then
docker compose -p exhibits-test -f compose.test.yaml run --entrypoint=bash webapp
docker compose -p exhibits-test -f compose.test.yaml run webapp bash
else
docker compose -p exhibits-test -f compose.test.yaml run webapp bundle exec rspec
fi
Expand Down

0 comments on commit f8b68be

Please sign in to comment.