From 6b168d4a148453b348509d98a47fd8a372a19131 Mon Sep 17 00:00:00 2001 From: Helga Velroyen <helgav@google.com> Date: Wed, 15 May 2013 15:01:28 +0200 Subject: [PATCH] Annotate every arbitrary instance field The Arbitrary instance of the 'Instance' object is written using the <*> syntax. Since it often uses the 'arbitrary' generator for the instance's fields it is hard to figure out which 'arbitrary' fills which instance field. This patch annotates all fields with their name to make maintenance of this code easier. Signed-off-by: Helga Velroyen <helgav@google.com> Reviewed-by: Klaus Aehlig <aehlig@google.com> --- test/hs/Test/Ganeti/Objects.hs | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/test/hs/Test/Ganeti/Objects.hs b/test/hs/Test/Ganeti/Objects.hs index 9fdaec4b3..da4a89d82 100644 --- a/test/hs/Test/Ganeti/Objects.hs +++ b/test/hs/Test/Ganeti/Objects.hs @@ -107,13 +107,31 @@ $(genArbitrary ''PartialNic) instance Arbitrary Instance where arbitrary = Instance - <$> genFQDN <*> genFQDN <*> genFQDN -- OS name, but... + -- name + <$> genFQDN + -- primary node + <*> genFQDN + -- OS + <*> genFQDN + -- hypervisor <*> arbitrary + -- hvparams -- FIXME: add non-empty hvparams when they're a proper type - <*> pure (GenericContainer Map.empty) <*> arbitrary - -- ... and for OSParams - <*> pure (GenericContainer Map.empty) <*> arbitrary <*> arbitrary - <*> arbitrary <*> arbitrary <*> arbitrary + <*> pure (GenericContainer Map.empty) + -- beparams + <*> arbitrary + -- osparams + <*> pure (GenericContainer Map.empty) + -- admin_state + <*> arbitrary + -- nics + <*> arbitrary + -- disks + <*> arbitrary + -- disk template + <*> arbitrary + -- network port + <*> arbitrary -- ts <*> arbitrary <*> arbitrary -- uuid -- GitLab