Skip to content

1250 enhance testing logic in abm#1276

Merged
DavidKerkmann merged 40 commits intomainfrom
1250-enhance-testing-logic-in-abm
Jul 28, 2025
Merged

1250 enhance testing logic in abm#1276
DavidKerkmann merged 40 commits intomainfrom
1250-enhance-testing-logic-in-abm

Conversation

@xsaschako
Copy link
Member

@xsaschako xsaschako commented May 15, 2025

Changes and Information

Please briefly list the changes (main added features, changed items, or corrected bugs) made:

  • Enhance logic, readability and access time
  • Simplify: dont update activity status -> error prone and not better runtime

If need be, add additional information and what the reviewer should look out for in particular:

Merge Request - Guideline Checklist

Please check our git workflow. Use the draft feature if the Pull Request is not yet ready to review.

Checks by code author

  • Every addressed issue is linked (use the "Closes #ISSUE" keyword below)
  • New code adheres to coding guidelines
  • No large data files have been added (files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.)
  • Tests are added for new functionality and a local test run was successful (with and without OpenMP)
  • Appropriate documentation for new functionality has been added (Doxygen in the code and Markdown files if necessary)
  • Proper attention to licenses, especially no new third-party software with conflicting license has been added
  • (For ABM development) Checked benchmark results and ran and posted a local test above from before and after development to ensure performance is monitored.

Checks by code reviewer(s)

  • Corresponding issue(s) is/are linked and addressed
  • Code is clean of development artifacts (no deactivated or commented code lines, no debugging printouts, etc.)
  • Appropriate unit tests have been added, CI passes, code coverage and performance is acceptable (did not decrease)
  • No large data files added in the whole history of commits(files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.)
  • On merge, add 2-5 lines with the changes (main added features, changed items, or corrected bugs) to the merge-commit-message. This can be taken from the briefly-list-the-changes above (best case) or the separate commit messages (worst case).

@xsaschako xsaschako linked an issue May 15, 2025 that may be closed by this pull request
2 tasks
@xsaschako xsaschako marked this pull request as ready for review May 16, 2025 11:44
@xsaschako xsaschako requested a review from Copilot May 16, 2025 11:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the testing logic for the ABM by simplifying testing criteria, updating the API for testing schemes, and improving serialization. Key changes include:

  • Replacing previous testing scheme APIs (e.g. run_scheme) with new methods (run_scheme_and_check_if_test_positive and is_active with time parameter).
  • Updating functions to add testing schemes by location type or id.
  • Adapting tests and serialization accordingly.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
cpp/tests/test_abm_testing_strategy.cpp Refactored test cases to use new testing scheme API and updated evaluation logic.
cpp/tests/test_abm_serialization.cpp Updated reference JSON keys to match the new serialization format.
cpp/tests/test_abm_model.cpp Modified test scenarios to use the new location-based testing scheme assignment.
cpp/models/graph_abm/graph_abmodel.h Updated testing scheme call to use the new run_strategy_and_check_if_entry_allowed API.
cpp/models/abm/testing_strategy.h Removed outdated functions and updated API for adding testing schemes.
cpp/models/abm/testing_strategy.cpp Changes to testing scheme activation and strategy evaluation logic.
cpp/models/abm/model.cpp Modified integration of testing strategy in mobility methods.
cpp/benchmarks/abm.cpp Replaced old API calls with the new testing scheme API for location types.

@codecov
Copy link

codecov bot commented May 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.25%. Comparing base (b738898) to head (2575aef).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1276      +/-   ##
==========================================
- Coverage   97.32%   97.25%   -0.07%     
==========================================
  Files         174      174              
  Lines       15122    15105      -17     
==========================================
- Hits        14718    14691      -27     
- Misses        404      414      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xsaschako xsaschako requested a review from DavidKerkmann June 21, 2025 14:30
@xsaschako xsaschako self-assigned this Jun 23, 2025
Copy link
Member

@DavidKerkmann DavidKerkmann left a comment

Choose a reason for hiding this comment

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

Thanks for the improvements and also the nice new tests!
There are only a couple of remarks and inquiries.

@xsaschako xsaschako requested a review from DavidKerkmann July 26, 2025 08:52
@xsaschako xsaschako force-pushed the 1250-enhance-testing-logic-in-abm branch from 6549172 to 2f6f889 Compare July 28, 2025 09:25
@DavidKerkmann DavidKerkmann merged commit 1b251d9 into main Jul 28, 2025
56 of 57 checks passed
@DavidKerkmann DavidKerkmann deleted the 1250-enhance-testing-logic-in-abm branch July 28, 2025 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance testing logic in ABM

3 participants