Conversation
| chrome: stable | ||
| language: ruby | ||
|
|
||
| notifications: |
There was a problem hiding this comment.
This is dead configuration, overridden by lines 34-37 below, and has been cruft for 7 years.
|
|
||
| jdk: openjdk11 | ||
| env: | ||
| global: |
There was a problem hiding this comment.
This appears to be the modern way to specify global environment variables.
| - ENGINE_CART_RAILS_OPTIONS='--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test' | ||
| - CC_TEST_REPORTER_ID=5042c7358c96b0b926088a4cda3e132fffe7a66ce8047cdb1dc6f0b4b6676b79 | ||
|
|
||
| jdk: openjdk11 |
There was a problem hiding this comment.
Don't need JDK anymore if spinning up Solr via Travis's docker infrastructure and our docker-compose configuration.
| Rake::Task["spec"].invoke | ||
| end | ||
|
|
||
| desc "Create the test rails app" |
There was a problem hiding this comment.
Unclear why this is needed; looks like cruft from the pre-EngineCart days. Found no references to it anywhere on the open web, so I removed it.
There was a problem hiding this comment.
I think this is needed because blacklight is a rails engine too and to test that functionality the engine_cart is used.
There was a problem hiding this comment.
Removing this doesn't seem to have caused any ill effects, FWIW.
| task seed: ['engine_cart:generate'] do | ||
| within_test_app do | ||
| system "bundle exec rake blacklight:index:seed" | ||
| system "bin/rake blacklight:index:seed" |
There was a problem hiding this comment.
Use generated binstubs. See https://github.com/rails/rails/blob/v6.0.2.1/railties/lib/rails/app_loader.rb#L13-L14
Not necessary for this work, so I'm happy to undo this if folks would prefer.
67ae211 to
a2b5b18
Compare
| - $PWD/lib/generators/blacklight/templates/solr/conf:/opt/solr/conf | ||
| ports: | ||
| - "8983:8983" | ||
| - "${SOLR_PORT}:8983" |
There was a problem hiding this comment.
I really like the use of SOLR_PORT environment variable here.
|
@mjgiarlo I wonder whether (if it's possible) for us to also incorporate the docker app in the travis build in order to avoid issues where the Dockerfile gets broken or stale. |
|
Totally open to that, @dkinzer. Do you have any ideas for what to test? Could try to build the image and fail unless it returns a zero exit code? Or maybe there's a smarter thing to do? |
|
@mjgiarlo , maybe we can run the blacklight tests within the app for one of the ruby versions? Unfortunately when I try that on my local I get an error so it's likely not an easy thing to setup: |
|
I was able to run the tests using |
681c5d6 to
4dee61f
Compare
| @@ -1,5 +0,0 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
I essentially moved this file into .docker/app/ and renamed it to make its intent clearer.
41ed549 to
777f8b7
Compare
|
This will need to be rebased too I think to get the latest changes that were merged after this was created. |
|
@cdmo my resource of choice are the docker docs (dark mode theme turned on of course): https://docs.docker.com/compose/ |
|
@cdmo some resources I recommend: |
|
Slick. Thanks @jcoyne |
777f8b7 to
2e184dd
Compare
|
@cdmo 💬
I'm very nearly ready to mark this PR as ready for review but the big need I see is some shared sense of where to document this stuff. See the |
2e184dd to
eefb6b1
Compare
| nodejs yarn build-essential libpq-dev \ | ||
| && apt-get clean | ||
| RUN gem install bundler | ||
| ARG ALPINE_RUBY_VERSION |
There was a problem hiding this comment.
I'm using ALPINE_RUBY_VERSION because RUBY_VERSION is already in use elsewhere, e.g., by RVM. This allows switching the version of Ruby used in the app image via environment variable:
$ ALPINE_RUBY_VERSION=2.7 docker-compose up --build app
mejackreed
left a comment
There was a problem hiding this comment.
I've left a few comments on here, but overall it feels like its shaping up nicely.
It is not clear to me where information like this is currently documented. The README is short and sweet, and for this reason I suspect it is not a good place for such internal development documentation to live. Other options include CONTRIBUTING.md, but that is more focused on higher-level contribution process than particular technical steps.
Maybe we could/should just add a new wiki page for Blacklight development contribution?
The webpacker thing also has me :sad_trombone: (with regard to developer experience). Maybe we can look at that somewhere else to get that resolved?
tasks/blacklight.rake
Outdated
| desc "Run test suite" | ||
| task ci: ['blacklight:generate'] do | ||
| task :ci do | ||
| system "docker-compose up -d solr" |
There was a problem hiding this comment.
I ran into an issue where I pulled this branch and all of the feature tests failed for me. bundle exec rake ci
tasks/blacklight.rake
Outdated
| desc "Run test suite" | ||
| task ci: ['blacklight:generate'] do | ||
| task :ci do | ||
| system "docker-compose up -d solr" |
There was a problem hiding this comment.
Also, I noticed that this is both in the ci task and the travis file. Is this needed in both placed?
|
Sorry adding one more thing I noticed in another comment. Strange, when I run |
|
@mjgiarlo I ran The errors I ran into earlier were all related to solr not being available |
|
FYI, we were having some webpacker issues on our docker instance and moving to node 8.x fixed it for us. |
|
Did I miss something, what's the |
I was going to ask about this. In Travis engine_cart runs the various versions of ruby and rails. Locally it does too. Will this PR replace engine_cart for local and just test against one version of ruby? Thanks for all the contributions and conversations. |
|
I think this PR should be merged ASAP since the current state of the docker environment on the master branch is broken. We can iterate on the merged changes in the future if need be. |
|
@cdmo yes, that was a reference to the features specs not working (when testing locally)... I'm pretty sure issue happens because app fails to load due to webpacker problems. Also we are not seeing the errors that cause this because they are being hidden. If I have time later on today, I'll try to push a PR against this branch. |
I renamed an existing page, updated its link on the main wiki page, and will use it to stash this information: https://github.com/projectblacklight/blacklight/wiki/Testing-and-Developing-Blacklight 🆒 ❓ |
eefb6b1 to
f00337b
Compare
|
@cdmo 💬
No, I don't think it will. That's part of why it's an awkward pairing. But I believe the docker componentry does give you the ability to specify Ruby and Rails versions to do whatever you'd like. For a working set of steps, here's what I just did: https://github.com/projectblacklight/blacklight/wiki/Testing-and-Developing-Blacklight |
|
@mejackreed can you try again following the guide I wrote up here: https://github.com/projectblacklight/blacklight/wiki/Testing-and-Developing-Blacklight |
446a58d to
47a5302
Compare
47a5302 to
49599a2
Compare
mejackreed
left a comment
There was a problem hiding this comment.
Thanks for the work on this @mjgiarlo . Just for others who come across this, locally creating and running an app with Rails > 6 will still fail. But we should deal with that separately.
👏
|
Heh 😅 I dont know if I really ought to be reviewing this, kinda just wanted to see how I could help / be a tester. It all seems fine to me I suppose! I am checking out learndocker.online, thanks again for that. I ran the wiki page instructions and hit a couple minor snags. First, running just |
|
@cdmo 💬
OK, no problem. Cool!
I just added some text to the Testing & Developing Blacklight wiki page about prefixing with No idea about the failing spec. That's weird that it doesn't also fail in CI. Agree w/ you that it's unrelated to this PR, at least. |
|
Let's wait for one more ✔️ before merging. @jcoyne ❓ |
Fixes #2195
Fixes #2231
Closes #2256
Summary
In this way, we are using docker-compose for development and testing of the Blacklight gem itself, not for downstream purposes such as generation of new Blacklight applications, which will continue to use solr_wrapper. Also includes: using a lighter base image for the app.
This supersedes #2256.
Open Question (Now Closed)
I put the documentation here: https://github.com/projectblacklight/blacklight/wiki/Testing-and-Developing-Blacklight
It is not clear to me where information like this is currently documented. The README is short and sweet, and for this reason I suspect it is not a good place for such internal development documentation to live. Other options includeCONTRIBUTING.md, but that is more focused on higher-level contribution process than particular technical steps.Note, I also don't think the Quickstart is the right place, so this ticket has nothing to do with #2183, which I think we should either close as awontfixper my comment or discuss what the right way to move forward is particularly w/r/t how much we continue to generate for downstream BL apps: i.e., if we don't give them a working SolrWrapper, do we generate/ship a working docker-compose configuration? Or do we get out of that business entirely? This is beyond the scope of this PR.For this reason, perhaps the best place is somewhere on the project wiki. Happy to take suggestions on this.Webpack(er) Broken (But Not Related)
I believe this may be solved by #2266. Thanks, @mejackreed!
Note that this PR changes theblacklight:serverrake task to usedocker-composefor Solr but I was unable to see this working---with Ruby 2.6 and Rails 6, but other combinations will yield different results---because when Blacklight uses EngineCart to generate the test app, there's a problem with webpack(er). If you generate without the--skip-webpack-installflag being passed to therails newcommand, the Rails webpack generator runs and fails because the dependency is not declared. If you skip webpack installation, Rails generates an app that still containswebpackerin its Gemfile, and it's a multi-step process to strip out webpack(er) and use Sprockets in its stead (1, 2, 3). That said, I did not alter this behavior or attempt to fix the underlying problem since it is orthogonal to how we spin up Solr for CI/testing of Blacklight.