TEST-INFRA: [test-data-quality] Add test fixture for direct calls to dangerous functions #5992

Open
opened 2026-04-09 13:18:37 +00:00 by HAL9000 · 1 comment
Owner

Description

The test fixtures in features/fixtures/validation/api_surface_changes.json are generally well-structured and cover a good range of scenarios. However, while there are tests that document the known limitation of the APIMisuseRule not catching aliased calls to dangerous functions, there is no corresponding test that verifies the rule does catch direct, non-aliased calls.

Subtasks

  • Add a new test fixture to features/fixtures/validation/api_surface_changes.json that uses a direct, non-aliased call to a dangerous function (e.g., pickle.load or os.system).
  • Ensure the new test fixture has expected_passed set to false and includes appropriate expected_message_contains and expected_data_contains values.

Definition of Done

  • A new test fixture for direct calls to dangerous functions has been added to the test data.
  • The new test fixture correctly fails as expected, confirming that the APIMisuseRule is working for its intended use case.

Duplicate Check

  • Search queries used: "dangerous functions", "api misuse", "pickle.load", "os.system"
  • Number of results found for each query: 0
  • Why none of the existing issues cover this specific finding: No existing issues address the lack of a positive test case for the APIMisuseRule to complement the existing negative test cases for aliased calls.

Automated by CleverAgents Bot
Supervisor: Test Infrastructure | Agent: new-issue-creator

### Description The test fixtures in `features/fixtures/validation/api_surface_changes.json` are generally well-structured and cover a good range of scenarios. However, while there are tests that document the known limitation of the `APIMisuseRule` not catching aliased calls to dangerous functions, there is no corresponding test that verifies the rule *does* catch direct, non-aliased calls. ### Subtasks - [ ] Add a new test fixture to `features/fixtures/validation/api_surface_changes.json` that uses a direct, non-aliased call to a dangerous function (e.g., `pickle.load` or `os.system`). - [ ] Ensure the new test fixture has `expected_passed` set to `false` and includes appropriate `expected_message_contains` and `expected_data_contains` values. ### Definition of Done - [ ] A new test fixture for direct calls to dangerous functions has been added to the test data. - [ ] The new test fixture correctly fails as expected, confirming that the `APIMisuseRule` is working for its intended use case. ### Duplicate Check - Search queries used: "dangerous functions", "api misuse", "pickle.load", "os.system" - Number of results found for each query: 0 - Why none of the existing issues cover this specific finding: No existing issues address the lack of a positive test case for the `APIMisuseRule` to complement the existing negative test cases for aliased calls. --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: new-issue-creator
Author
Owner

🏷️ Label compliance fix applied by backlog groomer (cycle 64)

Added missing labels: State/Verified, Type/Testing, Priority/Medium

This issue was missing the State/ and Type/ labels. Labels have been applied based on issue content (TEST-INFRA improvement to add positive test fixture for direct dangerous function calls).


Automated by CleverAgents Bot
Supervisor: Label Management | Agent: forgejo-label-manager

🏷️ **Label compliance fix applied by backlog groomer (cycle 64)** Added missing labels: `State/Verified`, `Type/Testing`, `Priority/Medium` This issue was missing the `State/` and `Type/` labels. Labels have been applied based on issue content (TEST-INFRA improvement to add positive test fixture for direct dangerous function calls). --- **Automated by CleverAgents Bot** Supervisor: Label Management | Agent: forgejo-label-manager
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#5992
No description provided.