[Ovirt-devel] [PATCH server] Test/fixture revamp.

Mohammed Morsi mmorsi at redhat.com
Wed Nov 19 19:25:29 UTC 2008


Jason Guiditta wrote:
> NOTE: This patch relies on previous one that changes int size of db tables.
>
>
> Redoing the test fixtures to take advantage of rails 2.1 'foxy fixtures'.
> This means very few ids, except for a couple special cases.  This not only
> gets us closer to current rails standards, but makes the fixtures more readable
> and maintainable, which hopefully translates into making it less painful to
> write comprehensive tests for new code (and build out better tests for
> existing code).
>
> A side effect of this is that I have been trimming unneeded fixture entries
> and renaming many of the ones we are keeping so it is more clear what they are,
> as well as general cleanup of incorrect things like quotes where they shouldn't
> be.
>
> Signed-off-by: Jason Guiditta <jguiditt at redhat.com>
> ---
>  src/test/fixtures/bondings.yml                    |   26 ++--
>  src/test/fixtures/bondings_nics.yml               |   15 --
>  src/test/fixtures/cpus.yml                        |   44 ++---
>  src/test/fixtures/hosts.yml                       |  221 ++++++++++-----------
>  src/test/fixtures/ip_addresses.yml                |   40 +----
>  src/test/fixtures/networks.yml                    |   36 ++--
>  src/test/fixtures/nics.yml                        |   94 +++------
>  src/test/fixtures/permissions.yml                 |  200 ++++---------------
>  src/test/fixtures/pools.yml                       |  163 +++++++---------
>  src/test/fixtures/quotas.yml                      |   88 +++------
>  src/test/fixtures/storage_pools.yml               |   81 ++------
>  src/test/fixtures/storage_volumes.yml             |   82 ++++----
>   
>  src/test/fixtures/tasks.yml                       |  115 +----------
>  src/test/fixtures/vms.yml                         |  174 +++++-----------
>  src/test/functional/host_controller_test.rb       |   36 ++--
>  src/test/functional/nic_controller_test.rb        |    8 +-
>  src/test/functional/permission_controller_test.rb |   42 +++--
>  src/test/functional/quota_controller_test.rb      |   45 +++--
>  src/test/functional/resources_controller_test.rb  |   42 +++--
>  src/test/functional/storage_controller_test.rb    |   40 +++--
>  src/test/functional/task_controller_test.rb       |    4 +-
>  src/test/functional/vm_controller_test.rb         |   41 +++--
>  src/test/unit/active_record_env_test.rb           |   10 +-
>  src/test/unit/host_browser_awaken_test.rb         |    3 +-
>  src/test/unit/ip_address_test.rb                  |   13 +-
>  src/test/unit/permission_test.rb                  |   12 +-
>  src/test/unit/pool_test.rb                        |    8 +-
>  src/test/unit/storage_pool_test.rb                |    5 +-
>  src/test/unit/storage_volume_test.rb              |    4 +-
>  src/test/unit/task_test.rb                        |   11 +-
>  src/test/unit/vm_test.rb                          |    4 +
>  31 files changed, 641 insertions(+), 1066 deletions(-)
>  delete mode 100644 src/test/fixtures/bondings_nics.yml
>
>   
Sorry for taking so long to get to this, but in the meantime Scott
committed a change to the storage pools / volumes fixures, adding a
'state' field which causes conflicts in this commit.

I removed those bits from this patch, applied it, and then manually
copied your changes over, integrating scott's updates in as well, then
tested it.

Everything works great, including the unit and functional tests, and I
scanned the code and nothing looks off.

So ACK pending the resolution of that storage_pools / volumes issue and
everything still works after.

Great work.

   -Mo




More information about the ovirt-devel mailing list