Skip to content

Commit

Permalink
Correct the fixtures for scoring of bug 2627
Browse files Browse the repository at this point in the history
* The integration test was using as a fixture measurement from
  before the incident
(https://explorer.ooni.org/m/20210427000432.751743_AU_signal_490428d8ebc76e6b),
but was expecting it to be marked as failed
* The unit test was using a measurement that was from a newer version of
  probe
(https://explorer.ooni.org/measurement/20221118T104419Z_signal_IT_30722_n1_Q02UUAiiHlVU0VE6),
which should not be marked as failed either

As part of #831 we improved the
logic for scoring to be more precise and so these checks were now
failing.

We now use in both cases a correct "bad case" and in the unit test we
also include the previous case as a "good case".
  • Loading branch information
hellais committed Apr 24, 2024
1 parent 78527f0 commit 57a02b2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions fastpath/fastpath/tests/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -1148,12 +1148,12 @@ def test_score_http_invalid_request_line():


def test_score_signal():
for can_fn, msm in minicans("signal", date(2021, 4, 27), date(2021, 4, 27), 1):
for can_fn, msm in minicans("signal", date(2022, 10, 27), date(2022, 10, 27), 1):
assert msm["test_name"] == "signal"
scores = fp.score_measurement(msm)
assert scores
rid = msm["report_id"]
if rid == "20210427T000430Z_signal_AU_45671_n1_Zq1z77FuiG2IkqqC":
if rid == "20221027T000314Z_signal_AM_44395_n1_2Tjx8RckKKKGB5Fv":
# Failed due to https://github.com/ooni/probe/issues/2627
assert scores == {
"accuracy": 0.0,
Expand Down
12 changes: 11 additions & 1 deletion fastpath/fastpath/tests/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ def test_score_http_requests():
def test_score_signal_2627():
# https://explorer.ooni.org/measurement/20221118T104419Z_signal_IT_30722_n1_Q02UUAiiHlVU0VE6
# Failed due to https://github.com/ooni/probe/issues/2627
msm = loadj("signal_022")
msm = loadj("signal_2627")
scores = fp.score_measurement(msm)
assert scores == {
"accuracy": 0.0,
Expand All @@ -585,6 +585,16 @@ def test_score_signal_2627():
"blocking_local": 0.0,
}

msm = loadj("signal_022")
scores = fp.score_measurement(msm)
assert scores == {
"blocking_country": 0.0,
"blocking_general": 0.0,
"blocking_global": 0.0,
"blocking_isp": 0.0,
"blocking_local": 0.0,
}


def test_score_signal_679():
# https://explorer.ooni.org/m/20230530180835.892478_US_signal_b091ac0f3794bbcd
Expand Down

0 comments on commit 57a02b2

Please sign in to comment.