Merge lp://staging/~elachuni/txstatsd/straight into lp://staging/txstatsd

Proposed by Anthony Lenton
Status: Merged
Approved by: Anthony Lenton
Approved revision: 101
Merged at revision: 99
Proposed branch: lp://staging/~elachuni/txstatsd/straight
Merge into: lp://staging/txstatsd
Diff against target: 318 lines (+169/-109)
3 files modified
txstatsd/client.py (+11/-109)
txstatsd/protocol.py (+131/-0)
txstatsd/tests/test_client.py (+27/-0)
To merge this branch: bzr merge lp://staging/~elachuni/txstatsd/straight
Reviewer Review Type Date Requested Status
Sidnei da Silva Approve
Review via email: mp+114879@code.staging.launchpad.net

Commit message

Made it possible to use the non-twisted client code even if twisted is unavailable.

Description of the change

This branch makes it possible to import the non-twisted client code without having twisted installed.

It also adds a test that ensures this can be installed, by marking everything twisted-ish as unavailable and then reloading the txstats client and metrics modules.

The code works as intended afaict, and the test fails if you add a random import twisted.something anywhere in txstatsd.client or txstatsd.metrics, but I'm still unsure if it's the best way to test. I tried a couple of permutations with import hooks, but that was even messier.

To post a comment you must log in.
Revision history for this message
Sidnei da Silva (sidnei) wrote :

[1] Please add the license header to protocol.py

[2] The restore_modules cleanup should reload() the modules again after restoring the unloaded twisted modules.

Once you fix those, set a commit message and flip the MP to approved, and tarmac will take care of landing it.

Thanks!

review: Approve
Revision history for this message
Anthony Lenton (elachuni) wrote :

Thanks Sidnei!
Fixes pushed up in rev. 100, marking as approved

Revision history for this message
Ubuntu One Server Tarmac Bot (ubuntuone-server-tarmac) wrote :
Download full text (19.6 KiB)

The attempt to merge lp:~elachuni/txstatsd/straight into lp:txstatsd failed. Below is the output from the failed tests.

txstatsd.tests.metrics.test_distinct
  TestDistinct
    test_all ... [OK]
  TestDistinctMetricReporter
    test_reports ... [OK]
  TestHash
    test_chi_square ... [SKIPPED]
    test_hash_chars ... [OK]
  TestPlugin
    test_factory ... [OK]
  TestZeros
    test_zeros ... [OK]
txstatsd.tests.metrics.test_histogrammetric
  TestHistogramReporterMetric
    test_histogram_histogram ... [OK]
    test_histogram_of_numbers_1_through_10000 ... [OK]
    test_histogram_with_zero_recorded_values ... [OK]
txstatsd.tests.metrics.test_metermetric
  TestDeriveMetricReporter
    test_fastpoll ... [OK]
    test_interface ... [OK]
txstatsd.tests.metrics.test_sli
  TestConditions
    test_above ... [OK]
    test_above_linear ... [OK]
    test_below ... [OK]
    test_below_linear ... [OK]
    test_between ... [OK]
  TestFactory
    test_configure ... [OK]
    test_configure_linear ... [OK]
  TestMetric
    test_clear ... [OK]
    test_count_all ... [OK]
    test_count_error ... [OK]
    test_count_threshold ... [OK]
    test_reports ... [OK]
  TestMetricLinear
    test_count_threshold ... [OK]
  TestParsing
    test_parse ... [OK]
txstatsd.tests.metrics.test_timermetric
  TestBlankTimerMetric
    test_count ... [OK]
    test_max ... [OK]
    test_mean ... [OK]
    test_min ... [OK]
    test_no_values ... [OK]
    test_percentiles ... [OK]
    test_rate ... [OK]
    test_std_dev ... [OK]
  TestTim...

101. By Anthony Lenton

Avoid using assertIsNone in tests, as the trial version on tarmac doesn't have that available.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches