8000 Cleaner test application setup by deivid-rodriguez · Pull Request #5797 · activeadmin/activeadmin · GitHub
[go: up one dir, main page]

Skip to content

Cleaner test application setup #5797

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 13 commits into from
Jul 12, 2019
Merged

Conversation

deivid-rodriguez
Copy link
Member

This a some work I made for #5563. The idea was to be able to have a separate Gemfile including turbolinks, run tests against it, and be able to write a regression spec for #5563 against that Gemfile. I managed to run tests against a turbolinks-enabled application, but I'm not sure why the bug didn't reproduce there either.

The previous setup didn't work for the previously mentioned purpose because the test application folder name was based off the Rails version, not the gemfile name, so the different test applications for each Gemfile would collide if they used the same Rails version. This doesn't happen with the new setup and we could potentially run tests against two different Gemfiles using the same Rails version.

Since I could make having this turbolinks gemfile useful to catch the bug in #5563, this PR is not really necessary, but I guess it makes the setup more generic, so we could merge it in case we need something like this in the future.

@deivid-rodriguez deivid-rodriguez force-pushed the cleaner_test_application_setup branch 9 times, most recently from 6f2bf8c to 7633787 Compare July 9, 2019 13:03
@deivid-rodriguez deivid-rodriguez requested a review from a team July 9, 2019 13:47
@deivid-rodriguez
Copy link
Member Author

I introduced a few extra changes here:

  • Track coverage for the test application's code. I did this because the coverage check failed, and it seems like a good way to ensure that we don't leave dead code in there.

  • Add tasks to regenerate the test application "forcefully", because many times I find myself running rm -rf tmp/rails/rails52 && bin/rake setup, and the new task bin/rake setup:force provides a handy shortcut for it.

So we can ask any information about the generated application that we
need.
Since it's used for more than generating the application, but also for
asking information about it.
I find myself running `rm -rf tmp/rails/rails_52` or whatever and then
running `bin/rake setup` to recreate the test application. Now I can do
`bin/rake setup:force`.
Otherwise we will accidentally restore coverage files created by the
test app creation jobs, and that will cause conflicts.
@deivid-rodriguez deivid-rodriguez force-pushed the cleaner_test_application_setup branch from 7633787 to a0bb67f Compare July 11, 2019 16:20
Copy link
Member
@javierjulio javierjulio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for doing this! ❤️ I'm fine with this as is but did you want this to go in before or after we do a 2.2.0 release?

8000
Copy link
Member
@javierjulio javierjulio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I meant to approve this at first!

@deivid-rodriguez
Copy link
Member Author

It doesn't matter since it's just about the dev environment, but let's merge it!

@deivid-rodriguez deivid-rodriguez merged commit ffeee5d into master Jul 12, 2019
@deivid-rodriguez deivid-rodriguez deleted the cleaner_test_application_setup branch July 12, 2019 15:28
@deivid-rodriguez
Copy link
Member Author

Thanks @javierjulio! ❤️

@javierjulio
Copy link
Member

No problem, anytime! Thanks for making regular improvements with this. Always appreciated.

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
0