Skip to content

Commit

Permalink
Start Guard instead of sleeping
Browse files Browse the repository at this point in the history
  • Loading branch information
top4ek committed Feb 29, 2024
1 parent 4762f79 commit 58353ef
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ group :test do
gem 'rack-test', '~> 2.1.0'
gem 'shoulda-context', '~> 2.0'

# Run specs with guard
gem "guard"
gem "guard-rspec"

# Test prof provides factories from code
# and other niceties
gem 'test-prof', '~> 1.3.0'
Expand Down
22 changes: 22 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,20 @@ GEM
grape
rack
gravatar_image_tag (1.2.0)
guard (2.18.1)
formatador (>= 0.2.4)
listen (>= 2.7, < 4.0)
lumberjack (>= 1.0.12, < 2.0)
nenv (~> 0.1)
notiffany (~> 0.0)
pry (>= 0.13.0)
shellany (~> 0.0)
thor (>= 0.18.1)
guard-compat (1.2.1)
guard-rspec (4.7.3)
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
hana (1.3.7)
hashdiff (1.1.0)
hashery (2.1.2)
Expand Down Expand Up @@ -692,6 +706,7 @@ GEM
view_component (>= 2.0)
yard (~> 0.9.25)
zeitwerk (~> 2.5)
lumberjack (1.2.10)
mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
Expand All @@ -718,6 +733,7 @@ GEM
mustermann-grape (1.0.2)
mustermann (>= 1.0.0)
mutex_m (0.2.0)
nenv (0.3.0)
net-http (0.4.1)
uri
net-imap (0.4.10)
Expand All @@ -734,6 +750,9 @@ GEM
nokogiri (1.16.2)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
notiffany (0.1.3)
nenv (~> 0.1)
shellany (~> 0.0)
oj (3.16.3)
bigdecimal (>= 3.0)
okcomputer (1.18.5)
Expand Down Expand Up @@ -1009,6 +1028,7 @@ GEM
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
semantic (1.6.1)
shellany (0.0.1)
shoulda-context (2.0.0)
shoulda-matchers (6.1.0)
activesupport (>= 5.2.0)
Expand Down Expand Up @@ -1185,6 +1205,8 @@ DEPENDENCIES
grape (~> 2.0.0)
grape_logging (~> 1.8.4)
grids!
guard
guard-rspec
html-pipeline (~> 2.14.0)
htmldiff
httpx
Expand Down
2 changes: 1 addition & 1 deletion Guardfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++

guard :rspec do # , :cli => "--drb" do
guard :rspec, cmd: 'rspec --format d' do # , :cli => "--drb" do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { 'spec' }
Expand Down
5 changes: 5 additions & 0 deletions docker-compose.override.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ services:
backend:
environment:
OPENPROJECT_CLI_PROXY: "http://localhost:${PORT}"
DISABLE_PRY_RAILS: 0
ports:
- "3000:3000"

backend-test:
environment:
START_GUARD: 0

frontend:
ports:
- "${PORT}:4200"
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ services:
build:
<<: *build
target: test
tty: true
stdin_open: true
command: setup-tests
hostname: backend-test
networks:
Expand Down
9 changes: 7 additions & 2 deletions docker/dev/backend/scripts/setup-tests
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,10 @@ echo "to start the full suite, or "
echo " bin/compose exec backend-test bundle exec rspec path/to/some_spec.rb"
echo "to run a subset"

# Keep this container online
while true; do sleep 1000; done;
if [ ${START_GUARD} = "1" ]; then
echo "or use Guard gem events to run a specific tests.\n"
bundle exec guard start --no-bundler-warning
else
# Keep this container online
while true; do sleep 1000; done;
fi

0 comments on commit 58353ef

Please sign in to comment.