Skip to content

Conversation

@krishnasharma4415
Copy link

Overview

Closes #105

This PR adds comprehensive test coverage for the parameter_extraction_cache_capacity configuration parameter, addressing the bug that was fixed in commit c7496f6.

Background

Issue #105 reported that users encountered a TypeError: '>' not supported between instances of 'int' and 'str' when setting parameter_extraction_cache_capacity. While this was fixed in April 2024, there were no tests to prevent this bug from reoccurring.

Changes

This PR adds the following test cases:

  • Integer value handling: Ensures the parameter correctly accepts integer values
  • Type validation: Confirms the stored value is of type int
  • String-to-int conversion: Tests backwards compatibility if string values are passed
  • Edge cases: Validates behavior with 0, large numbers, and boundary conditions
  • Config file parsing: Ensures proper parsing when loading from configuration files
  • Comparison operations: Verifies that comparison operations work correctly (the original bug involved a > comparison)

Testing

All tests pass locally:

pytest tests/test_template_miner.py -v

Existing test suite continues to pass:

pytest tests/ -v

Motivation

As someone who has used Drain3 extensively for processing log data in my anomaly detection projects, I understand the importance of reliable configuration handling. This test coverage ensures that the fix remains stable and prevents regression, improving the developer experience for future users.

Related Issues

   Addresses logpai#109 by adding comprehensive test cases for the fix
   implemented in commit c7496f6. Tests ensure:
   - Integer values are handled correctly
   - String-to-int conversion works as expected
   - Edge cases are covered
   - Prevents regression of the original TypeError bug

   This provides quality assurance for configuration parameter
   handling and prevents the issue from reoccurring.
   Addresses logpai#105 by adding comprehensive test cases for the fix
   implemented in commit c7496f6. Tests ensure:
   - Integer values are handled correctly
   - String-to-int conversion works as expected
   - Edge cases are covered
   - Prevents regression of the original TypeError bug

   This provides quality assurance for configuration parameter
   handling and prevents the issue from reoccurring.
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.

Issue with setting value for parameter extraction cache capacity

1 participant