History | View | Annotate | Download (9.6 kB)
Remove superfluous typing to Int
Forgot to fix that after the review of patch"Haskell/python compatibility test for networks".
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Haskell/python compatibility test for networks
This patch contains the HUnit test that checks the compatibilityof Haskell-generated networks with the python code. For that thegeneration of test instances of networks was enhanced to meetthe validation steps of the python implementation. Also, so far...
Generalise the test helper 'genUniquesList'
Instead of always using "arbitrary", make it require a generator (thatcan then use more complex rules for building the list elements), andalso convert it to use a temporary set instead of list membership.
Signed-off-by: Iustin Pop <iustin@google.com>...
make genMaybe more Just
There is a common conception that Just something is more worth thanNothing. So we're biasing our tests towards that. As such let's generateNothing fewer times, and Just subgen more times. The values were copiedfrom the "official" maybe generator....
Reduce hostname length in tests and opcode py_compat count
This improves Issue 325 - new runtime and memory consumption is about1/10 compared to before.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Make QuickCheck generator names more uniform
Due to lack of attention, we have two styles for generators ofarbitrary values: get* and gen* (e.g. getFQDN and genDiskIndices). Inorder to make this more obvious that we deal with a function in theGen monad, let's rename all get* functions to gen*....
Add an arbitrary set generator helper
This makes it easy to generate sets of "things" that don't even needto have arbitrary instances, but which have bounded/enum instances.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Adeodato Simo <dato@google.com>
Simplify a few test helpers
Use more monadic combinators instead of explicit code.
Add Utility functions for loading data from test files
They mimic their python counterparts.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Fix display of results in ==? operator
Doh, this is exactly the opposite of what we wanted… good thing notest failed so far :)
Improve message for (==?) operator
After seeing how nice HUnit formats the error message on failed'assertEqual', I think we can do better with ==?. Currently it says(on one line): "Expected equality, but 1 /= 2".
This patch changes the code to format it similar to HUnit:...
Annotated inequality operator for unit test properties
This includes: * The operator (/=?), which checks for inequality and prints an error message if it encounters equality. (Basically the negation of the (==?) operator). * Application of this operator in the test property...
Generalise the Result type
Currently, our error monad—Result—has a plain string error type. Thisis not good, as we don't have structured errors, we can't pass backproper error information to Python code, etc.
To solve this, we generalise this type as 'GenericResult a', and make...
Further hlint fixes
Commit 2cdaf22, “Re-enable standard hlint warnings”, got it almostright. The only problem is that (confusingly) the default set of hintsis not in HLint.Default, but in HLint.HLint (it includes Default andsome built-ins).
After changing the lint file to correctly include the defaults, we had...
Add a small 'passTest' helper
This is symmetric to failTest, and allows us to use it in cases wherewe need to return a property.
While replacing 'property True' with it, I saw a case where we cansimplify the use and thus reworked that check.
Add some unittests for node queries
These new tests check that:
- no known fields return unknown- any unknown field returns unknown- the type of the fields is consistent between the getters and the field definition- the length of each result row corresponds with the number of fields...
Add a test helper for simple JSON serialisation testing
While adding yet another JSON serialisation test, I realised that thiscan be trivially abstracted; hence this patch, replacing both simpleversions (readJSON . showJSON == id) and the standard version (with...
Split most HTools test code into separate files
Except for Ganeti.HTools.JSON, which needs rename, we split all theother test suites into separate files.
We have to add another common test helper, due to import dependencies(sigh), but otherwise this split is pretty straightforward....
Split Luxi, Qlang, Ssconf and OpCodes tests
… from QC.hs into their own files, again mirroring the production codesource tree.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Split Rpc tests from QC
This required lots of other code moves, so I created it as astandalone patch.
Split one more module out of QC and add test helpers
This splits the confd/utils tests, and adds the TestCommon module forshared test code.