Skip to content

Fix data providers don't work when changing directory in setup#531

Merged
Chemaclass merged 1 commit intomainfrom
fix/529-provider-dont-work-when-cd
Dec 4, 2025
Merged

Fix data providers don't work when changing directory in setup#531
Chemaclass merged 1 commit intomainfrom
fix/529-provider-dont-work-when-cd

Conversation

@Chemaclass
Copy link
Copy Markdown
Member

@Chemaclass Chemaclass commented Dec 4, 2025

📚 Description

Fixes #529 - Data providers now work correctly when set_up_before_script changes the working directory.

When a test file uses set_up_before_script to change directories (e.g., cd "$(temp_dir)"), data providers were failing because the script path became relative to the new directory instead of the original working directory.

🔖 Changes

  • Added BASHUNIT_WORKING_DIR environment variable to capture the original working directory at startup
  • Updated helper::get_provider_data() to resolve script paths against the original working directory when relative paths fail
  • Updated helper::check_duplicate_functions() with the same path resolution fix
  • Added functional test to verify data providers work after directory changes

✅ To-do list

  • I updated the CHANGELOG.md to reflect the new feature or fix
  • I updated the documentation to reflect the changes (N/A - bug fix with no user-facing API changes)

…irectory

       When set_up_before_script uses cd to change the working directory,
       relative test file paths become invalid for file operations like
       grep. This caused data providers to silently fail because the script
       file couldn't be found
@Chemaclass Chemaclass added the bug Something isn't working label Dec 4, 2025
@Chemaclass Chemaclass self-assigned this Dec 4, 2025
@Chemaclass Chemaclass changed the title Provider dont work when cd Fix data providers don't work when changing directory in setup Dec 4, 2025
@TypedDevs TypedDevs deleted a comment from chatgpt-codex-connector Bot Dec 4, 2025
@Chemaclass Chemaclass merged commit 090f2c4 into main Dec 4, 2025
15 checks passed
@Chemaclass Chemaclass deleted the fix/529-provider-dont-work-when-cd branch December 4, 2025 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Data providers don't work when changing directory in set_up_before_script

1 participant