1. 13 Jan, 2012 9 commits
  2. 08 Dec, 2011 2 commits
    • Iustin Pop's avatar
      Some small test simplifications · ba1260ba
      Iustin Pop authored
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      ba1260ba
    • Iustin Pop's avatar
      Cleanup hlint errors · 3603605a
      Iustin Pop authored
      
      
      First, we update the recommended hlint version to what I used to get a
      clean output (1.8.15). Most of the changes are:
      
      - remove unneeded parentheses
      - some simplifications (intercalate " " → unwords, maybe … id →
        fromMaybe, etc.)
      - removal of some duplicate code (in previous patches)
      
      There are still some warnings which I didn't clean out but plain
      ignored:
      
      - 'Eta reduce' in some specific files, because the type inference
        specialises the function on the first call, and annotating the type
        properly would be too verbose
      - use of 'first', 'comparing', and 'on', since these don't seem to be
        widely or consistently used (outside ganeti/htools, I mean)
      - use of Control.Exception.catch, as we only care about I/O errors; at
        one point yes, we will need to transition to this new API
      - 'Reduce duplication', since hlint warns even for 3 duplicate lines,
        and abstracting that away seems overkill to me
      
      After this patch, make hlint is clean and doesn't exit with an error
      anymore; we could enable it automatically on 'make lint' if hlint is
      detected (future patch).
      
      Note that we explicitly skip the THH.hs file from checking because it
      seems that hlint doesn't parse correctly for now the splice notation.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarAgata Murawska <agatamurawska@google.com>
      3603605a
  3. 17 Nov, 2011 2 commits
  4. 16 Nov, 2011 4 commits
  5. 26 Oct, 2011 1 commit
  6. 03 Oct, 2011 3 commits
  7. 29 Sep, 2011 1 commit
    • Iustin Pop's avatar
      Change type of Cluster.AllocSolution · 129734d3
      Iustin Pop authored
      Originally, this data type was used both by instance allocation (1
      result), and by instance relocation (many results, one per
      instance). As such, the field 'asSolutions' was a list, and the
      various code paths checked whether the length of the list matches the
      current mode. This is very ugly, as we can't guarantee this matching
      via the type system; hence the FIXME in the code.
      
      However, commit 6804faa0
      
       removed the instance evacuation code, and thus
      we now always use just one allocation solution. Hence we can change
      the data type to a simply Maybe type, and get rid of many 'otherwise
      barf out' conditions.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarAgata Murawska <agatamurawska@google.com>
      129734d3
  8. 14 Sep, 2011 1 commit
  9. 22 Jul, 2011 1 commit
  10. 21 Jul, 2011 2 commits
  11. 19 Jul, 2011 1 commit
    • Iustin Pop's avatar
      htools: import the program modules in QC.hs · 33b9d92d
      Iustin Pop authored
      
      
      This adds the binaries code to the coverage, and thus the coverage
      finally shows the real coverage over all logic code (except for the
      htools.hs code, which is not logic code related to the algorithms, so
      it doesn't matter — plus it's also very small).
      
      Next steps will be to actually add coverage for this code, especially
      for hbal and hspace, which are relatively big compared to hail and
      hscan (around 800 expressions versus 200-300 expressions).
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      33b9d92d
  12. 15 Jul, 2011 2 commits
  13. 14 Jul, 2011 2 commits
    • Iustin Pop's avatar
      Fix htool unittest failure due to invalid prereqs · 3158250d
      Iustin Pop authored
      
      
      Currently, the test prop_Node_rMem does some reserved memory checks on
      nodes, and for the test to work correctly (can add more instances) we
      require that the node free memory is greater than zero via a
      prerequisite.
      
      However, if the node free memory is exactly 1, the call to
      setInstanceSmallerThanNode will set the instance memory to "free
      memory `div` 2", and since this is integer division, the instance
      memory will get set to 0. Which means that the node reserved memory
      will not increase when we add this instance as secondary.
      
      To work around, we simply require that the node memory is high enough
      (we use our 'base' unit of memory).
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      3158250d
    • Iustin Pop's avatar
      htools: add parseUnit function · 1cb92fac
      Iustin Pop authored
      
      
      This is similar, but not identical, to Utils.ParseUnit. The biggest
      difference is that we don't round up/down; as we only use integral
      types, the result will always be rounded down.
      
      Moreover, since (real-world) disk sizes come in SI units, the function
      differentiates between SI and binary prefixes, using lower-case for
      binary and upper-case for SI (similar to lvm usage). This distinction
      should be ported to the Python code.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      1cb92fac
  14. 13 Jul, 2011 8 commits
  15. 28 Jun, 2011 1 commit