Skip to content

Commit

Permalink
fix: BundleChange now has percentage_delta
Browse files Browse the repository at this point in the history
Changes to shared include codecov/shared@545fd04
This changed the interface of `BundleChange`, causing some manually created ones in tests to break.
  • Loading branch information
giovanni-guidini committed Sep 18, 2024
1 parent d3519cf commit 359d705
Showing 1 changed file with 44 additions and 11 deletions.
55 changes: 44 additions & 11 deletions services/bundle_analysis/tests/test_bundle_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,22 @@ def hook_mock_pull(mocker, mock_pull):
pytest.param(
[
BundleChange(
"added-bundle", BundleChange.ChangeType.ADDED, size_delta=12345
"added-bundle",
BundleChange.ChangeType.ADDED,
size_delta=12345,
percentage_delta=2.56,
),
BundleChange(
"changed-bundle", BundleChange.ChangeType.CHANGED, size_delta=3456
"changed-bundle",
BundleChange.ChangeType.CHANGED,
size_delta=3456,
percentage_delta=0.35,
),
BundleChange(
"removed-bundle", BundleChange.ChangeType.REMOVED, size_delta=-1234
"removed-bundle",
BundleChange.ChangeType.REMOVED,
size_delta=-1234,
percentage_delta=-1.23,
),
],
5.56,
Expand All @@ -93,13 +102,22 @@ def hook_mock_pull(mocker, mock_pull):
pytest.param(
[
BundleChange(
"added-bundle", BundleChange.ChangeType.ADDED, size_delta=12345
"added-bundle",
BundleChange.ChangeType.ADDED,
size_delta=12345,
percentage_delta=2.56,
),
BundleChange(
"changed-bundle", BundleChange.ChangeType.CHANGED, size_delta=3456
"changed-bundle",
BundleChange.ChangeType.CHANGED,
size_delta=3456,
percentage_delta=2.56,
),
BundleChange(
"removed-bundle", BundleChange.ChangeType.REMOVED, size_delta=-1234
"removed-bundle",
BundleChange.ChangeType.REMOVED,
size_delta=-1234,
percentage_delta=2.56,
),
],
5.56,
Expand All @@ -124,13 +142,22 @@ def hook_mock_pull(mocker, mock_pull):
pytest.param(
[
BundleChange(
"added-bundle", BundleChange.ChangeType.ADDED, size_delta=12345
"added-bundle",
BundleChange.ChangeType.ADDED,
size_delta=12345,
percentage_delta=2.56,
),
BundleChange(
"cached-bundle", BundleChange.ChangeType.CHANGED, size_delta=3456
"cached-bundle",
BundleChange.ChangeType.CHANGED,
size_delta=3456,
percentage_delta=2.56,
),
BundleChange(
"removed-bundle", BundleChange.ChangeType.REMOVED, size_delta=-1234
"removed-bundle",
BundleChange.ChangeType.REMOVED,
size_delta=-1234,
percentage_delta=2.56,
),
],
3.46,
Expand Down Expand Up @@ -162,7 +189,10 @@ def hook_mock_pull(mocker, mock_pull):
pytest.param(
[
BundleChange(
"test-bundle", BundleChange.ChangeType.CHANGED, size_delta=-3456
"test-bundle",
BundleChange.ChangeType.CHANGED,
size_delta=-3456,
percentage_delta=-2.56,
),
],
-0.52,
Expand All @@ -189,7 +219,10 @@ def hook_mock_pull(mocker, mock_pull):
pytest.param(
[
BundleChange(
"test-bundle", BundleChange.ChangeType.CHANGED, size_delta=0
"test-bundle",
BundleChange.ChangeType.CHANGED,
size_delta=0,
percentage_delta=0.0,
),
],
0,
Expand Down

0 comments on commit 359d705

Please sign in to comment.