Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #8850 (closed enhancement: fixed)

Opened 1 year ago

Last modified 1 year ago

[patch] namespacing for activerecord Rakefile's build_xxx_databases, and test_xxx tasks by database

Reported by: nicwilliams Assigned to: core
Priority: normal Milestone: 2.x
Component: ActiveRecord Version: edge
Severity: normal Keywords: rake rakefile activerecord test database
Cc:

Description

Currently, the database build/rebuild tasks for mysql/postgresql/frontbase are:

rake build_frontbase_databases     # Build the FrontBase test databases
rake build_mysql_databases         # Build the MySQL test databases
rake build_postgresql_databases    # Build the PostgreSQL test databases
rake drop_mysql_databases          # Drop the MySQL test databases
rake drop_postgresql_databases     # Drop the PostgreSQL test databases
rake rebuild_frontbase_databases   # Rebuild the FrontBase test databases
rake rebuild_mysql_databases       # Rebuild the MySQL test databases
rake rebuild_postgresql_databases  # Rebuild the PostgreSQL test databases}}}

They are now:

rake frontbase:build_databases     # Build the FrontBase test databases
rake frontbase:rebuild_databases   # Rebuild the FrontBase test databases
rake mysql:build_databases         # Build the MySQL test databases
rake mysql:drop_databases          # Drop the MySQL test databases
rake mysql:rebuild_databases       # Rebuild the MySQL test databases
rake postgresql:build_databases    # Build the PostgreSQL test databases
rake postgresql:drop_databases     # Drop the PostgreSQL test databases
rake postgresql:rebuild_databases  # Rebuild the PostgreSQL test databases

But the old tasks are still supported (without a desc so they don't appear in the rake -T list.

Similarly, the patch creates xxx:test tests that map to the test_xxx test tasks. It is important for the rake TestTask class that no namespacing is used for the description, otherwise I'd like the visible task to be xxx:test too.

rake test_firebird                 # Run tests for test_firebird
rake test_frontbase                # Run tests for test_frontbase
rake test_mysql                    # Run tests for test_mysql
rake test_openbase                 # Run tests for test_openbase
rake test_oracle                   # Run tests for test_oracle
rake test_postgresql               # Run tests for test_postgresql
rake test_sqlite                   # Run tests for test_sqlite
rake test_sqlite3                  # Run tests for test_sqlite3
rake test_sqlserver                # Run tests for test_sqlserver
rake test_sqlserver_odbc           # Run tests for test_sqlserver_odbc
rake test_sybase                   # Run tests for test_sybase

Attachments

namespaced_db_build_tasks.patch (6.5 kB) - added by nicwilliams on 07/03/07 08:31:51.

Change History

07/03/07 08:31:51 changed by nicwilliams

  • attachment namespaced_db_build_tasks.patch added.

10/08/07 05:29:12 changed by bitsweat

  • status changed from new to closed.
  • resolution set to fixed.

(In [7795]) Namespace the internal Rakefile tasks. Closes #8850 [drnic]