TEST-INFRA: [test-data-quality] Replace hardcoded /tmp paths in test fixtures with dynamic temporary directories #5844

Open
opened 2026-04-09 10:39:25 +00:00 by HAL9000 · 0 comments
Owner

Metadata

  • Branch: feat/test-infra/test-data-quality-dynamic-tmp-paths
  • Commit Message: test(infra): replace hardcoded /tmp paths in test fixtures with dynamic temporary directories
  • Milestone: Backlog
  • Parent Epic: #5407

Description

The test data fixtures in features/fixtures/m1/ use hardcoded paths in the /tmp directory for creating test repositories and resources. This creates a dependency on a specific directory structure and can lead to test failures in environments where /tmp is not writable or is cleared between test runs.

Examples of hardcoded paths:

  • features/fixtures/m1/git_checkout_resource.json uses "path": "/tmp/m1-smoke-test-repo"
  • features/fixtures/m1/git_repo.json uses "remote_url": "file:///tmp/m1-smoke-test-repo.git"

This makes the tests less portable and more brittle across different CI environments and developer machines.

Subtasks

  • Identify all test fixtures that use hardcoded paths in /tmp (search features/fixtures/ and related test setup code)
  • Modify the test setup/teardown code (Behave environment.py or step definitions) to create dynamic temporary directories using Python's tempfile module
  • Update the test fixtures or fixture-loading logic to substitute the dynamically generated paths at runtime
  • Ensure that the temporary directories are properly cleaned up after each test run (via after_all / after_scenario hooks)
  • Verify all affected tests continue to pass with nox -e unit_tests and nox -e integration_tests

Definition of Done

  • All hardcoded /tmp paths in test fixtures under features/fixtures/m1/ are replaced with dynamically generated paths
  • Temporary directories are created per-test-run and cleaned up after completion
  • The tests continue to pass in the CI/CD pipeline
  • The test suite is more portable and no longer dependent on a specific local filesystem structure
  • All nox stages pass
  • Coverage >= 97%

Backlog note: This issue was discovered during autonomous operation
on milestone v3.6.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


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

## Metadata - **Branch**: `feat/test-infra/test-data-quality-dynamic-tmp-paths` - **Commit Message**: `test(infra): replace hardcoded /tmp paths in test fixtures with dynamic temporary directories` - **Milestone**: Backlog - **Parent Epic**: #5407 ## Description The test data fixtures in `features/fixtures/m1/` use hardcoded paths in the `/tmp` directory for creating test repositories and resources. This creates a dependency on a specific directory structure and can lead to test failures in environments where `/tmp` is not writable or is cleared between test runs. **Examples of hardcoded paths:** - `features/fixtures/m1/git_checkout_resource.json` uses `"path": "/tmp/m1-smoke-test-repo"` - `features/fixtures/m1/git_repo.json` uses `"remote_url": "file:///tmp/m1-smoke-test-repo.git"` This makes the tests less portable and more brittle across different CI environments and developer machines. ## Subtasks - [ ] Identify all test fixtures that use hardcoded paths in `/tmp` (search `features/fixtures/` and related test setup code) - [ ] Modify the test setup/teardown code (Behave `environment.py` or step definitions) to create dynamic temporary directories using Python's `tempfile` module - [ ] Update the test fixtures or fixture-loading logic to substitute the dynamically generated paths at runtime - [ ] Ensure that the temporary directories are properly cleaned up after each test run (via `after_all` / `after_scenario` hooks) - [ ] Verify all affected tests continue to pass with `nox -e unit_tests` and `nox -e integration_tests` ## Definition of Done - [ ] All hardcoded `/tmp` paths in test fixtures under `features/fixtures/m1/` are replaced with dynamically generated paths - [ ] Temporary directories are created per-test-run and cleaned up after completion - [ ] The tests continue to pass in the CI/CD pipeline - [ ] The test suite is more portable and no longer dependent on a specific local filesystem structure - [ ] All nox stages pass - [ ] Coverage >= 97% > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.6.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: new-issue-creator
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.

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