-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Spring, spring-watcher-listen, and Listen #824
Conversation
Spring is a Rails-maintained gem for quicker development Listen allows it to work more efficiently Versions locked to work with Rails 5.2
I'd love it to have some time shaved off test runs. But I'm seeing some issues:
vagrant@ubuntu-focal /vagrant/mushroom-observer (nimmo-add-spring-listen)
$ grep "config.cache_classes" config/environments/test.rb
# config.cache_classes = true
config.cache_classes = false
vagrant@ubuntu-focal /vagrant/mushroom-observer (nimmo-add-spring-listen)
vagrant@ubuntu-focal /vagrant/mushroom-observer (nimmo-add-spring-listen)
$ rails t
...
vagrant@ubuntu-focal /vagrant/mushroom-observer (nimmo-add-spring-listen)
$ spring status
Spring is not running. Compare to https://github.com/rails/spring#usage. (I'll try to see if I'm doing something wrong.)
vagrant@ubuntu-focal /vagrant/mushroom-observer (nimmo-add-spring-listen)
$ rails t
/vagrant/mushroom-observer/app/classes/map_collapsible.rb:49: warning: already initialized constant CollapsibleCollectionOfMappableObjects::PRECISION
/vagrant/mushroom-observer/app/classes/map_collapsible.rb:49: warning: previous definition of PRECISION was here
/vagrant/mushroom-observer/app/classes/map_collapsible.rb:70: warning: already initialized constant CollapsibleCollectionOfMappableObjects::MAX_PRECISION
/vagrant/mushroom-observer/app/classes/map_collapsible.rb:70: warning: previous definition of MAX_PRECISION was here
/vagrant/mushroom-observer/app/classes/map_collapsible.rb:71: warning: already initialized constant CollapsibleCollectionOfMappableObjects::MIN_PRECISION
/vagrant/mushroom-observer/app/classes/map_collapsible.rb:71: warning: previous definition of MIN_PRECISION was here
Started with run options --seed 40014 |
I don't know why it was locked at 3.1.5, the version of spring-watcher-listen supports < Listen 4.0
Code Climate has analyzed commit e4cd6f7 and detected 0 issues on this pull request. View more on Code Climate. |
The MIN_MAX_PRECISION are constants I probably added incorrectly to the map
stuff. I bet there's a better way of doing it. So you can probably add
that to the "uncovering hidden bugs" column.
…On Tue, Jan 18, 2022 at 5:32 PM codeclimate[bot] ***@***.***> wrote:
Code Climate has analyzed commit e4cd6f7
<e4cd6f7>
and detected *0 issues* on this pull request.
View more on Code Climate
<https://codeclimate.com/repos/58cfc16d1035280287001d93/pull/824>.
—
Reply to this email directly, view it on GitHub
<#824 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAYTNNJY2STFV5K5IMZFARLUWXS67ANCNFSM5MGFY23A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I've merged this into the mo-docker branch and everything seems to be working. Like Joe, I see not speed improvements running the tests, but I also see no downside. I'm fine merging it into master. |
@mo-nathan: Can you run tests in the mo-docker branch? |
That was a dumb question. You said you were running them. |
More important question: |
It's just me; the "already initialized constant" warnings are just on my desktop, not on my laptop. |
In order to fix this, I had to rebuild my vm, starting from cloning the repo. |
Using Spring in test environment
Without Spring:
With Spring:
|
Hi Joe - sorry to take awhile to get back to these questions, I couldn't remember how i had it set up. I realize it's merged...
|
Neither. |
Another development-only tool that i'm finding helpful.
Spring is a Rails-maintained application preloader. "It speeds up development by keeping your application running in the background, so you don't need to boot it every time you run a test, rake task or migration."
Listen allows Spring to work more efficiently by sending it notifications of directory changes. It can also be used independently, but this PR does not implement it outside of Spring.
spring-watcher-listen connects the two.
Versions of all three locked to work with Rails 5.2 and each other.
Spring (v4) is, bundled and active by default in Rails 6 (this PR is for Spring v3, the last version that works with Rails 5). It's back to inactive by default in Rails 7 (because "computers are faster" they say), but it's still bundled with Rails 7 currently.
If anyone objects for any reason, no problem. I'm open to using it local-only.