質問編集履歴
2
不要な記述の削除
title
CHANGED
File without changes
|
body
CHANGED
@@ -53,39 +53,8 @@
|
|
53
53
|
password: <%= ENV['APP_NAME_AR_DATABASE_PASSWORD'] %>
|
54
54
|
|
55
55
|
```
|
56
|
-
###### Dockerfile
|
57
56
|
|
58
|
-
```
|
59
|
-
FROM node:10.13.0 as node
|
60
|
-
FROM ruby:2.5.0
|
61
57
|
|
62
|
-
ENV ENTRYKIT_VERSION 0.4.0
|
63
|
-
|
64
|
-
RUN wget https://github.com/progrium/entrykit/releases/download/v${ENTRYKIT_VERSION}/entrykit_${ENTRYKIT_VERSION}_Linux_x86_64.tgz \
|
65
|
-
&& tar -xvzf entrykit_${ENTRYKIT_VERSION}_Linux_x86_64.tgz \
|
66
|
-
&& rm entrykit_${ENTRYKIT_VERSION}_Linux_x86_64.tgz \
|
67
|
-
&& mv entrykit /bin/entrykit \
|
68
|
-
&& chmod +x /bin/entrykit \
|
69
|
-
&& entrykit --symlink
|
70
|
-
|
71
|
-
ENV YARN_VERSION 1.10.1
|
72
|
-
|
73
|
-
COPY --from=node /opt/yarn-v$YARN_VERSION /opt/yarn
|
74
|
-
COPY --from=node /usr/local/bin/node /usr/local/bin/
|
75
|
-
|
76
|
-
RUN ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \
|
77
|
-
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg
|
78
|
-
|
79
|
-
WORKDIR /app
|
80
|
-
|
81
|
-
RUN bundle config build.nokogiri --use-system-libraries
|
82
|
-
|
83
|
-
ENTRYPOINT [ \
|
84
|
-
"prehook", "bundle install -j3", "--", \
|
85
|
-
"prehook", "yarn install", "--"]
|
86
|
-
|
87
|
-
```
|
88
|
-
|
89
58
|
###### docker-compose.yml
|
90
59
|
|
91
60
|
```
|
@@ -148,53 +117,4 @@
|
|
148
117
|
bundle:
|
149
118
|
node_modules:
|
150
119
|
|
151
|
-
```
|
152
|
-
|
153
|
-
###### spec_helper.rb
|
154
|
-
```
|
155
|
-
require 'simplecov'
|
156
|
-
|
157
|
-
RSpec.configure do |config|
|
158
|
-
ENV['RAILS_ENV'] = 'test'
|
159
|
-
config.expect_with :rspec do |expectations|
|
160
|
-
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
161
|
-
end
|
162
|
-
|
163
|
-
config.mock_with :rspec do |mocks|
|
164
|
-
mocks.verify_partial_doubles = true
|
165
|
-
end
|
166
|
-
config.shared_context_metadata_behavior = :apply_to_host_groups
|
167
|
-
config.before(:all) do
|
168
|
-
FactoryBot.reload
|
169
|
-
end
|
170
|
-
if ENV['CIRCLE_ARTIFACTS']
|
171
|
-
dir = File.join(ENV['CIRCLE_ARTIFACTS'], 'coverage')
|
172
|
-
SimpleCov.coverage_dir(dir)
|
173
|
-
end
|
174
|
-
|
175
|
-
SimpleCov.start
|
176
|
-
end
|
177
|
-
|
178
|
-
```
|
179
|
-
|
180
|
-
### 試したこと①
|
181
|
-
spec_helper.rbの ENV['RAILS_ENV'] = 'test' をコメントアウトしたら実行できます(ただしdevelop環境での実行になってしまいます)
|
182
|
-
|
183
|
-
### 試したこと②
|
184
|
-
https://shinkufencer.hateblo.jp/entry/2018/11/06/225439
|
185
|
-
こちらを参考にspec/rails_helper.rbにあった
|
186
|
-
```
|
187
|
-
begin
|
188
|
-
ActiveRecord::Migration.maintain_test_schema!
|
189
|
-
rescue ActiveRecord::PendingMigrationError => e
|
190
|
-
puts e.to_s.strip
|
191
|
-
exit 1
|
192
|
-
end
|
193
|
-
```
|
194
|
-
をそのままコメントアウトしたあとに再び$docker-compose run web rspecを実行したら以下のエラーが出ました
|
195
|
-
```
|
196
|
-
Failure/Error: connect user, pass, host, port, database, socket, flags, conn_attrs
|
197
|
-
|
198
|
-
Mysql2::Error::ConnectionError:
|
199
|
-
Access denied for user 'app_name'@'%' to database 'app_name_test'
|
200
120
|
```
|
1
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -177,5 +177,24 @@
|
|
177
177
|
|
178
178
|
```
|
179
179
|
|
180
|
-
### 試したこと
|
180
|
+
### 試したこと①
|
181
|
-
spec_helper.rbの ENV['RAILS_ENV'] = 'test' をコメントアウトしたら実行できます(ただしdevelop環境での実行になってしまいます)
|
181
|
+
spec_helper.rbの ENV['RAILS_ENV'] = 'test' をコメントアウトしたら実行できます(ただしdevelop環境での実行になってしまいます)
|
182
|
+
|
183
|
+
### 試したこと②
|
184
|
+
https://shinkufencer.hateblo.jp/entry/2018/11/06/225439
|
185
|
+
こちらを参考にspec/rails_helper.rbにあった
|
186
|
+
```
|
187
|
+
begin
|
188
|
+
ActiveRecord::Migration.maintain_test_schema!
|
189
|
+
rescue ActiveRecord::PendingMigrationError => e
|
190
|
+
puts e.to_s.strip
|
191
|
+
exit 1
|
192
|
+
end
|
193
|
+
```
|
194
|
+
をそのままコメントアウトしたあとに再び$docker-compose run web rspecを実行したら以下のエラーが出ました
|
195
|
+
```
|
196
|
+
Failure/Error: connect user, pass, host, port, database, socket, flags, conn_attrs
|
197
|
+
|
198
|
+
Mysql2::Error::ConnectionError:
|
199
|
+
Access denied for user 'app_name'@'%' to database 'app_name_test'
|
200
|
+
```
|