Skip to content

Refactor survey validators to don't need chdirs#2798

Merged
jsoriano merged 1 commit intoelastic:mainfrom
jsoriano:avoid-chdir-on-tests
Aug 1, 2025
Merged

Refactor survey validators to don't need chdirs#2798
jsoriano merged 1 commit intoelastic:mainfrom
jsoriano:avoid-chdir-on-tests

Conversation

@jsoriano
Copy link
Member

@jsoriano jsoriano commented Aug 1, 2025

After #2796, these would be the last use of chdir in tests.

Chdir can be problematic because it is global, and might affect other tests, or other functions tested in the same test. It is also error-prone as one may forget to go back to the previous working directory.

An object is created now that can keep as context the working directory, and validators are added as members of this object.

@jsoriano jsoriano requested a review from a team August 1, 2025 11:33
@jsoriano jsoriano self-assigned this Aug 1, 2025
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

cc @jsoriano

Copy link
Contributor

@mrodm mrodm left a comment

Choose a reason for hiding this comment

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

Nice! 🚀

@jsoriano jsoriano merged commit 71bbe8e into elastic:main Aug 1, 2025
3 checks passed
@jsoriano jsoriano deleted the avoid-chdir-on-tests branch August 1, 2025 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants