Skip to content

Commit

Permalink
Implement testing.
Browse files Browse the repository at this point in the history
NOTE: Have to change demo test, because game_stats.bumps is now more populated.
  • Loading branch information
DivvyCr committed Aug 4, 2020
1 parent 6922200 commit d847e75
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
16 changes: 16 additions & 0 deletions carball/tests/stats/bump_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from carball.tests.utils import get_raw_replays, run_analysis_test_on_replay

from carball.analysis.analysis_manager import AnalysisManager


class Test_Bumps:
def test_calculate_bumps_correctly(self, replay_cache):
def test(analysis: AnalysisManager):
proto_game = analysis.get_protobuf_data()
count_bumps = 0
for i in proto_game.game_stats.bumps:
if not i.is_demo:
count_bumps += 1
assert count_bumps == 3

run_analysis_test_on_replay(test, get_raw_replays()["3_BUMPS"], cache=replay_cache)
7 changes: 5 additions & 2 deletions carball/tests/stats/demo_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ class Test_Demos:
def test_calculate_demos_correctly(self, replay_cache):
def test(analysis: AnalysisManager):
proto_game = analysis.get_protobuf_data()
bumps = proto_game.game_stats.bumps
assert len(bumps) == 1
count_demo_bumps = 0
for i in proto_game.game_stats.bumps:
if i.is_demo:
count_demo_bumps += 1
assert count_demo_bumps == 1

run_analysis_test_on_replay(test, get_raw_replays()["1_DEMO"], cache=replay_cache)

8 comments on commit d847e75

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Carball Benchmarks short_sample

Benchmark suite Current: d847e75 Previous: 07297fe Ratio
carball/tests/benchmarking/benchmarking.py::test_short_sample 0.8899420459896918 iter/sec (stddev: 0.0076660387915816666) 0.8667843933942438 iter/sec (stddev: 0.033132074823376975) 0.97

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Carball Benchmarks short_dropshot

Benchmark suite Current: d847e75 Previous: 07297fe Ratio
carball/tests/benchmarking/benchmarking.py::test_short_dropshot 0.6450726278782577 iter/sec (stddev: 0.007818805208221768) 0.6623984673004569 iter/sec (stddev: 0.010878172765054418) 1.03

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Carball Benchmarks intensive_oce_rlcs

Benchmark suite Current: d847e75 Previous: 07297fe Ratio
carball/tests/benchmarking/benchmarking.py::test_intensive_oce_rlcs 0.04866375884272862 iter/sec (stddev: 0.17427904502022393) 0.06152116311170856 iter/sec (stddev: 0.20006056624924776) 1.26

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Carball Benchmarks short_dropshot

Benchmark suite Current: d847e75 Previous: 07297fe Ratio
carball/tests/benchmarking/benchmarking.py::test_short_dropshot 0.7464159294068589 iter/sec (stddev: 0.020956533462322714) 0.6623984673004569 iter/sec (stddev: 0.010878172765054418) 0.89

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Carball Benchmarks short_sample

Benchmark suite Current: d847e75 Previous: 07297fe Ratio
carball/tests/benchmarking/benchmarking.py::test_short_sample 0.7875227416259548 iter/sec (stddev: 0.008320096492018795) 0.8667843933942438 iter/sec (stddev: 0.033132074823376975) 1.10

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Carball Benchmarks intensive_oce_rlcs

Benchmark suite Current: d847e75 Previous: 07297fe Ratio
carball/tests/benchmarking/benchmarking.py::test_intensive_oce_rlcs 0.05323882937352437 iter/sec (stddev: 0.2413201506665877) 0.06152116311170856 iter/sec (stddev: 0.20006056624924776) 1.16

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Carball Benchmarks full_rumble

Benchmark suite Current: d847e75 Previous: 07297fe Ratio
carball/tests/benchmarking/benchmarking.py::test_full_rumble 0.06392008834999224 iter/sec (stddev: 0.23286256799022634) 0.06434159662703988 iter/sec (stddev: 0.16290135322043248) 1.01

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Carball Benchmarks oce_rlcs

Benchmark suite Current: d847e75 Previous: 07297fe Ratio
carball/tests/benchmarking/benchmarking.py::test_oce_rlcs 0.05411210599228413 iter/sec (stddev: 0.8947510556145823) 0.07512800799461093 iter/sec (stddev: 0.15956780047878102) 1.39

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.