Skip to content

Commit 60f0031

Browse files
committed
fixing test dbs
1 parent 41deafc commit 60f0031

File tree

6 files changed

+16
-12
lines changed

6 files changed

+16
-12
lines changed

.github/workflows/dockerpush.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,25 @@ jobs:
99
- uses: actions/checkout@v2
1010
- name: Run tests
1111
run: |
12-
docker-compose run --rm test_6_1_ruby_3_0 bundle exec rake db:migrate
13-
docker-compose run --rm test_6_1_ruby_3_0 bundle exec rspec spec/test
12+
docker-compose run --rm test_6_1_ruby_3_0
1413
test_6_1_ruby_2_7:
1514
runs-on: ubuntu-latest
1615
steps:
1716
- uses: actions/checkout@v2
1817
- name: Run tests
1918
run: |
20-
docker-compose run --rm test_6_1_ruby_2_7 bundle exec rake db:migrate
21-
docker-compose run --rm test_6_1_ruby_2_7 bundle exec rspec spec/test
19+
docker-compose run --rm test_6_1_ruby_2_7
2220
test_6_0_ruby_2_6:
2321
runs-on: ubuntu-latest
2422
steps:
2523
- uses: actions/checkout@v2
2624
- name: Run tests
2725
run: |
28-
docker-compose run --rm test_6_0_ruby_2_6 bundle exec rake db:migrate
29-
docker-compose run --rm test_6_0_ruby_2_6 bundle exec rspec spec/test
26+
docker-compose run --rm test_6_0_ruby_2_6
3027
test_5_2_ruby_2_6:
3128
runs-on: ubuntu-latest
3229
steps:
3330
- uses: actions/checkout@v2
3431
- name: Run tests
3532
run: |
36-
docker-compose run --rm test_5_2_ruby_2_6 bundle exec rake db:migrate
37-
docker-compose run --rm test_5_2_ruby_2_6 bundle exec rspec spec/test
33+
docker-compose run --rm test_5_2_ruby_2_6

Dockerfile.test_5_2_ruby_2_6

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,7 @@ RUN rm Gemfile.lock
4040
RUN mv _Gemfile Gemfile
4141
RUN mv _Gemfile.lock Gemfile.lock
4242

43+
RUN rm /app/spec/dummy/db/schema.rb
44+
4345
RUN rm /app/spec/dummy/config/application.rb
4446
RUN mv /app/spec/dummy/config/application.5.2_rb /app/spec/dummy/config/application.rb

Dockerfile.test_6_0_ruby_2_6

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,7 @@ RUN rm Gemfile.lock
4040
RUN mv _Gemfile Gemfile
4141
RUN mv _Gemfile.lock Gemfile.lock
4242

43+
RUN rm /app/spec/dummy/db/schema.rb
44+
4345
RUN rm /app/spec/dummy/config/application.rb
4446
RUN mv /app/spec/dummy/config/application.6.0_rb /app/spec/dummy/config/application.rb

Dockerfile.test_6_1_ruby_2_7

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,7 @@ RUN rm Gemfile.lock
4040
RUN mv _Gemfile Gemfile
4141
RUN mv _Gemfile.lock Gemfile.lock
4242

43+
RUN rm /app/spec/dummy/db/schema.rb
44+
4345
RUN rm /app/spec/dummy/config/application.rb
4446
RUN mv /app/spec/dummy/config/application.6.1_rb /app/spec/dummy/config/application.rb

Dockerfile.test_6_1_ruby_3_0

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,7 @@ RUN rm Gemfile.lock
4040
RUN mv _Gemfile Gemfile
4141
RUN mv _Gemfile.lock Gemfile.lock
4242

43+
RUN rm /app/spec/dummy/db/schema.rb
44+
4345
RUN rm /app/spec/dummy/config/application.rb
4446
RUN mv /app/spec/dummy/config/application.6.1_rb /app/spec/dummy/config/application.rb

docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ services:
5858
RAILS_ENV: test
5959
links:
6060
- "postgres_test_5_2_ruby_2_6:postgres_test"
61-
command: "bundle exec rspec spec/test"
61+
command: sh -c "bundle exec rake db:drop && bundle exec rake db:create && bundle exec rake db:migrate && bundle exec rspec spec/test"
6262
user: ${CURRENT_UID}
6363

6464
test_6_0_ruby_2_6:
@@ -69,7 +69,7 @@ services:
6969
RAILS_ENV: test
7070
links:
7171
- "postgres_test_6_0_ruby_2_6:postgres_test"
72-
command: "bundle exec rspec spec/test"
72+
command: sh -c "bundle exec rake db:drop && bundle exec rake db:create && bundle exec rake db:migrate && bundle exec rspec spec/test"
7373
user: ${CURRENT_UID}
7474

7575
test_6_1_ruby_2_7:
@@ -80,7 +80,7 @@ services:
8080
RAILS_ENV: test
8181
links:
8282
- "postgres_test_6_1_ruby_2_7:postgres_test"
83-
command: "bundle exec rspec spec/test"
83+
command: sh -c "bundle exec rake db:drop && bundle exec rake db:create && bundle exec rake db:migrate && bundle exec rspec spec/test"
8484
user: ${CURRENT_UID}
8585

8686
test_6_1_ruby_3_0:
@@ -91,7 +91,7 @@ services:
9191
RAILS_ENV: test
9292
links:
9393
- "postgres_test_6_1_ruby_3_0:postgres_test"
94-
command: "bundle exec rspec spec/test"
94+
command: sh -c "bundle exec rake db:drop && bundle exec rake db:create && bundle exec rake db:migrate && bundle exec rspec spec/test"
9595
user: ${CURRENT_UID}
9696

9797
postgres_dummy:

0 commit comments

Comments
 (0)