Skip to content

Commit

Permalink
Merge pull request #72 from nyctef/sleekxmpp-to-slixmpp
Browse files Browse the repository at this point in the history
Migrate from sleekxmpp to slixmpp
  • Loading branch information
nyctef authored Jun 2, 2022
2 parents e306361 + b3ab0da commit 378fe20
Show file tree
Hide file tree
Showing 26 changed files with 1,172 additions and 882 deletions.
8 changes: 3 additions & 5 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ pytz = "==2016.4"
redis = "==2.10.1"
psycopg2-binary = "*"
# connect to jabber
sleekxmpp = "==1.3.1"
slixmpp = "==1.7.0"
# azure logging
azure = "==0.8.1"
# note these lines are disabled for now since they bring in pyasn1, which breaks sleekxmpp:
# https://github.com/fritzy/SleekXMPP/issues/477#issuecomment-349638055
# opencensus-ext-azure = "==1.0.4"
# opencensus-ext-logging = "==0.1.0"
opencensus-ext-azure = "==1.0.4"
opencensus-ext-logging = "==0.1.0"
# misc
laboratory = "*"

Expand Down
312 changes: 305 additions & 7 deletions Pipfile.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

```powershell
pipenv --python 3.8
pipenv install --dev
pipenv shell
./run-tests.ps1
Expand Down
14 changes: 13 additions & 1 deletion modules/Experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,19 @@
class LoggingExperiment(laboratory.Experiment):
def publish(self, result):
if not result.match:
logging.error("Result mismatch!: " + pformat(result))
try:
logging.error(f"Experiment mismatch: output from {result.candidates[0].name} did not match {result.control.name}",
extra={
'custom_dimensions': {
'expected_value': pformat(result.control.value),
'actual_value': pformat(result.candidates[0].value),
'actual_exception': pformat(result.candidates[0].exception),
}
})
except Exception as e:
# if the detailed reporting fails for some reason, make sure we fall back to something
# simpler that won't throw and interfere with the rest of the app
logging.error("Experiment mismatch!: " + pformat(result), extra={'custom_dimensions': {'exception': pformat(e)}})


def method_missing(method_name, type_name):
Expand Down
Loading

0 comments on commit 378fe20

Please sign in to comment.