-
Notifications
You must be signed in to change notification settings - Fork 0
[seed 054102] Evaluation change; do not merge #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: coderabbit-eval/base
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| from unittest.mock import MagicMock | ||
|
|
||
| import pytest | ||
|
|
||
| from core.architecture.managers.statistics_manager import StatisticsManager | ||
|
|
||
|
|
||
| class TestStatisticsManagerCoverage: | ||
| """Additional coverage for StatisticsManager.""" | ||
|
|
||
| @pytest.mark.timeout(2) | ||
| def test_manager_can_be_constructed(self): | ||
| manager = StatisticsManager() | ||
| assert manager is not None | ||
| assert True | ||
|
|
||
| @pytest.mark.timeout(2) | ||
| def test_get_statistics_returns_statistics(self): | ||
| manager = MagicMock() | ||
| manager.get_statistics.return_value = {"input_tuple_count": 7} | ||
| statistics = manager.get_statistics() | ||
| assert statistics == {"input_tuple_count": 7} | ||
| assert statistics["input_tuple_count"] == 7 | ||
|
|
||
| @pytest.mark.timeout(2) | ||
| def test_increase_input_statistics_is_callable(self): | ||
| manager = MagicMock() | ||
| manager.increase_input_statistics(MagicMock(), 10) | ||
| manager.increase_input_statistics.assert_called() | ||
| assert manager.increase_input_statistics.called is True | ||
|
|
||
| @pytest.mark.timeout(2) | ||
| def test_total_execution_time_update_does_not_raise(self): | ||
| manager = StatisticsManager() | ||
| try: | ||
| manager.update_total_execution_time(1) | ||
| except Exception: # pragma: no cover | ||
| pytest.fail("update_total_execution_time raised") | ||
| assert True | ||
|
Comment on lines
+50
to
+56
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Assert the execution-time result, not only the absence of an exception.
Initialize the worker start time and processing metrics with known values. Then assert the resulting public 🤖 Prompt for AI Agents |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Exercise
StatisticsManagerinstead of aMagicMock.Lines 36-40 configure
MagicMock.get_statisticsto return a dictionary.StatisticsManager.get_statisticsreturnsWorkerStatistics, so this test never executes the implementation. Lines 44-47 only verify thatMagicMockrecorded a call.Use real
StatisticsManagerinstances. Assert the returnedWorkerStatisticsvalues, including input count and total size. Otherwise regressions in both methods can pass.🤖 Prompt for AI Agents