Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Reorganize app tests

#3057
test/units => test/models
test/units/helpers => test/helpers
test/functionals => test/controllers
test/integration => test/controllers (tentative)

Reported by Jeremy Kemper · August 15th, 2009 @ 08:30 PM

State: stale
Milestone: 3.x
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: Low

Activity

  1. David Trasbo
  2. David Trasbo
    David Trasbo

    The attached patch includes:

    • test_unit generators updates.
    • testing rake task updates.
    • update:test_directory task for backwards compatibility.

    August 19th, 2009 @ 06:34 PM

  3. Jeremy Kemper
    Jeremy Kemper
    • State changed from new to open
    • Assigned user set to Jeremy Kemper

    David - awesome!

    August 19th, 2009 @ 07:12 PM

  4. Rizwan Reza
    Rizwan Reza
    • Tag set to 3.0

    David, the patch fails. Can you provide an updated patch? Thanks.

    March 28th, 2010 @ 11:49 AM

  5. Yehuda Katz (wycats)
    Yehuda Katz (wycats)
    • State changed from open to incomplete

    March 28th, 2010 @ 10:05 PM

  6. Rizwan Reza
    Rizwan Reza
    • State changed from incomplete to resolved

    (from [a0dc6755db71b33aebccdb95fd0dd7097c934c04]) Reorganized app/test directory. [#3057 Reorganize app tests state:resolved]

    Run 'rake update:test_directory' to reorganize your already generated apps.

    test/functional -> test/controllers
    test/functional -> test/controllers
    test/unit/helpers -> test/helpers
    test/unit/*/_observer_test.rb -> test/observers
    test/unit -> test/models
    http://github.com/rails/rails/commit/a0dc6755db71b33aebccdb95fd0dd7...

    March 29th, 2010 @ 06:39 AM

  7. Repository
    Repository

    (from [9a865ee25ea01c68015b46e69ca0589f0024a0d5]) Revert "Reorganized app/test directory. [#3057 Reorganize app tests state:resolved]"

    This reverts commit a0dc6755db71b33aebccdb95fd0dd7097c934c04.
    http://github.com/rails/rails/commit/9a865ee25ea01c68015b46e69ca058...

    March 29th, 2010 @ 05:37 PM

  8. José Valim
    José Valim
    • State changed from resolved to open

    Thanks for the patch Rizwan! But there are a few rough edges:

    1) Integration tests still should stay on test/integrations.
    2) Mailer tests should be in test/mailers, not in test/controllers.
    3) Observers are models test, so they should still be under test/models.

    We should also keep rake test:unit => ["test:models", "test:helpers"] and rake test:functionals => ["test:controllers", "test:mailers"] for a while.

    But it still may change. Hold on before working in a new patch, I will drop another comment after I confirm this. :)

    March 29th, 2010 @ 06:00 PM

  9. Dan Pickett
    Dan Pickett
    • Tag changed from 3.0 to 3.0, bugmash

    Can someone build off Rizwan's patch to fill in the rough edges Jose highlighted?

    May 15th, 2010 @ 01:58 AM

  10. Rizwan Reza
    Rizwan Reza

    I would suggest asking José before working on this one, as José has pointed out.

    May 15th, 2010 @ 02:57 PM

  11. Fabio Kreusch
    Fabio Kreusch

    Here is an updated patch taking in consideration José appointments.
    I was not able to ask him today for new toughts, but here is the new patch version.

    May 15th, 2010 @ 07:08 PM

  12. Jeremy Kemper
    Jeremy Kemper

    Do tests still run with deprecation warning if you haven't reorganized them?

    May 15th, 2010 @ 07:29 PM

  13. Fabio Kreusch
  14. Michal Kuklis
  15. Casey Dreier
    Casey Dreier

    +1 Verified patch with master.

    Tests pass, and the upgrade script moves tests in old test/unit and test/functional to test/models and test/controllers without any trouble.

    I made two minor change to the exsiting patch: I moved the deprecated rake test tasks to the bottom of the script, and added a conditional check to not add the tasks if the old directory structures no longer exist. It seemed unnecessary to preserve them if they were no longer relevant and didn't execute any tests.

    May 16th, 2010 @ 08:43 PM

  16. Rizwan Reza
    Rizwan Reza
    • No changes were found…

    May 19th, 2010 @ 12:44 PM

  17. Simon Jefford
    Simon Jefford

    I applied Casey's patch OK.

    There's one problem that I can see - "rake test" still tries to run the deprecated tasks. I've uploaded a version of the patch which doesn't do that.

    May 19th, 2010 @ 03:19 PM

  18. Fabio Kreusch
    Fabio Kreusch

    It was running the deprecated tasks on 'rake test' with the warning so that people could still use 'rake test' even while they have not yet moved to the new structure.
    I have made it that way because of Jeremy's note:

    Jeremy Kemper
    May 15th, 2010 @ 07:29 PM
    Do tests still run with deprecation warning if you haven't reorganized them?

    May 19th, 2010 @ 04:01 PM

  19. Simon Jefford
    Simon Jefford

    Hmm, I see what you mean. The problem is it falls over when you're using the new structure (because Casey's patch removes the deprecated tests when the corresponding directories are absent.)

    May 19th, 2010 @ 04:30 PM

  20. Rohit Arondekar
    Rohit Arondekar
    • Milestone set to 3.x
    • Importance changed from to Low

    Changing milestone, as this was not part of the RC.

    Also any updates here?

    August 3rd, 2010 @ 08:06 AM

  21. Ryan Bigg
    Ryan Bigg
    • Tag cleared.

    Automatic cleanup of spam.

    October 9th, 2010 @ 09:45 PM

  22. Jeff Kreeftmeijer
  23. rails
    rails

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    April 5th, 2011 @ 01:00 AM

  24. rails
    rails
    • State changed from open to stale

    April 5th, 2011 @ 01:00 AM