Bug 1383613 - ruby sdk types should implement structural equality
Summary: ruby sdk types should implement structural equality
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine-sdk-ruby
Classification: oVirt
Component: Core
Version: 4.0.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.1.0-rc
: 4.1.0.alpha2
Assignee: Juan Hernández
QA Contact: Aleksei Slaikovskii
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-11 08:58 UTC by Martin Betak
Modified: 2017-02-01 14:37 UTC (History)
4 users (show)

Fixed In Version: 4.1.0.alpha2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-01 14:37:42 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-4.1+
mgoldboi: planning_ack+
juan.hernandez: devel_ack+
lsvaty: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 65340 0 master MERGED Implement == and eql? for types 2016-10-18 08:24:31 UTC
oVirt gerrit 65533 0 sdk_4.0 MERGED Implement == and eql? for types 2016-10-18 09:32:36 UTC

Description Martin Betak 2016-10-11 08:58:57 UTC
Description of problem:

when writing tests that assert interactions using the ruby sdk it is often necessary to compare the Types present in the sdk for (structural) equality. 

However currently the `==` ruby comparison operator is not implemented for the generated Types and e.g. even a basic comparison of
> OvirtSDK4::Vm.new(name: 'foo') ==  OvirtSDK4::Vm.new(name: 'foo')
currently returns false. 

This of course applies to all generated Types and for complex types the structural equality should be implemented recursively - i.e. that also
> OvirtSDK4::ExternalVmImport.new(vm: { name: 'foo' }) == OvirtSDK4::ExternalVmImport.new(vm: { name: 'foo' })
would return true

Comment 1 Juan Hernández 2016-10-18 12:54:50 UTC
Version 4.0.6 of the SDK, containing the fix for this bug, has been published to rubygems.org:

  https://rubygems.org/gems/ovirt-engine-sdk/versions/4.0.6

Comment 2 Juan Hernández 2016-11-25 11:25:05 UTC
The new version of the SDK, 4.0.6, is intended to support a slightly newer version of the engine than what is included in the ovirt-4.0.6 release: the SDK uses version 4.0.37 of the specification of the API, but the engine uses version 4.0.36. So I am moving the bug to the next release of the oVirt project.

Comment 3 Sandro Bonazzola 2017-01-25 07:56:26 UTC
4.0.6 has been the last oVirt 4.0 release, please re-target this bug.

Comment 4 Aleksei Slaikovskii 2017-01-30 08:57:49 UTC
Verified on ovirt-engine-sdk version 4.1.0.alpha3.

[6] pry(main)> OvirtSDK4::Vm.new(name: 'foo') ==  OvirtSDK4::Vm.new(name: 'foo')
=> true
[7] pry(main)> OvirtSDK4::ExternalVmImport.new(vm: { name: 'foo' }) == OvirtSDK4::ExternalVmImport.new(vm: { name: 'foo' })
=> true


Note You need to log in before you can comment on or make changes to this bug.