Skip to content

Cleanup tests, fix a broken test seed #783

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

Merged
merged 7 commits into from
Sep 20, 2017
Merged

Cleanup tests, fix a broken test seed #783

merged 7 commits into from
Sep 20, 2017

Conversation

BookOfGreg
Copy link
Member

@BookOfGreg BookOfGreg commented Sep 19, 2017

Hi again,

Problem
Noticed when 777 was merged to master, there was one timing problem test where in webpacker 3
it's possible for it to say Webpacker.dev_server.running? == true before it was able to serve assets.

Solution
Check if the file is available in Webpacker 3 by opening it again, same as old method but using the dev_server methods. Also basically rewrote that loop while I was at it since we can just kill the PID and not need to do the lsof scan.

Also used the param: syntax for rails controller tests, it runs in Rails 3 and 5, and it also stops a deprecation warning so thats a freebie.

Also collected all the MAJOR < 3 into one block, still not 100% sure about that patten but it seems to do a good job.

@rmosolgo
Copy link
Member

👍 All sounds good to me! Thanks for taking care of the params: upgrade.

Yeah, the MAJOR < 3 thing is a bit unusual but I can't think of another way to get it done properly.

By the way, what do you think about long-term support for webpacker 1 & 2, should we/can we drop them in the near future, or are people stuck on them?

@BookOfGreg
Copy link
Member Author

BookOfGreg commented Sep 19, 2017

Can't really speak for the whole community, but if we look at the numbers I'm probably say definitely drop 1.1 (I wrote one method specific to that version), maybe 1.2 when 3 picks up.

17,079 downloads https://rubygems.org/gems/webpacker/versions/3.0.1
3,786 downloads https://rubygems.org/gems/webpacker/versions/3.0.0
179,128 downloads https://rubygems.org/gems/webpacker/versions/2.0
59,125 downloads https://rubygems.org/gems/webpacker/versions/1.2
17,494 downloads https://rubygems.org/gems/webpacker/versions/1.1

No idea what I did to break the test suite so thoroughly but at least it looks like some JRuby builds are running now. I'll spend more time on this later, I have to do some work for my company for a few days before I can return to this.

Edit: Actually just upgraded the main application for my day job from Webpacker 1 to 3 in a single hop in a few hours, so it shouldn't be a major problem to my knowledge, that's why I prefer this gem to React On Rails, theirs is too prescriptive and lock you into how they think your webpack should be run, makes it unusable.

Ed2:
Of course if people want to keep using react-rails with Webpacker 1 or 2, bundler will just use the 2.2 series (Assuming the current master becomes a 2.3 or 3.0) so it's generally safe to drop support for older versions of things.

@BookOfGreg BookOfGreg mentioned this pull request Sep 20, 2017
@BookOfGreg
Copy link
Member Author

@rmosolgo The JRuby tests are now green also on this branch. 🚢

@rmosolgo
Copy link
Member

You're amazing!

@rmosolgo rmosolgo merged commit 3ecb225 into reactjs:master Sep 20, 2017
@BookOfGreg BookOfGreg deleted the cleanup-tests branch September 20, 2017 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants