Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isolate functional tests from user Git config #702

Merged
merged 2 commits into from
Aug 21, 2023

Conversation

fbochu
Copy link
Contributor

@fbochu fbochu commented Aug 21, 2023

Some users could have hooks defined in their Git template directory. The content of this directory is copied every time a repository is cloned or created. We have to isolate our functional tests to avoid the user Git config interferes with our tests.

This will allow to debug functional tests more easily.
}

isolate() {
export GIT_CONFIG_GLOBAL=''
export GIT_CONFIG_SYSTEM=''
Copy link
Collaborator

@agateau-gg agateau-gg Aug 21, 2023

Choose a reason for hiding this comment

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

I just found out we already hit that issue once in the past, but it was only fixed for the unittest Makefile target. I think we should unify this and add an autouse fixture to unset the variables in tests/conftest.py instead. This way the fix is also applied when one runs pytest directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is a better way to fix that problem. I have updated the PR.

@fbochu fbochu force-pushed the fbochu/git-isolate-functest branch from 266b5e2 to b984b46 Compare August 21, 2023 12:36
@fbochu fbochu requested a review from agateau-gg August 21, 2023 12:37
@fbochu fbochu force-pushed the fbochu/git-isolate-functest branch 2 times, most recently from d1089b6 to 3a9d9d9 Compare August 21, 2023 12:42
@fbochu fbochu self-assigned this Aug 21, 2023
Some users could have hooks defined in their Git template directory. The
content of this directory is copied every time a repository is cloned or
created. We have to isolate our functional tests to avoid the user
Git config interferes with our tests.
@fbochu fbochu force-pushed the fbochu/git-isolate-functest branch from 3a9d9d9 to f104968 Compare August 21, 2023 12:53
Copy link
Collaborator

@agateau-gg agateau-gg left a comment

Choose a reason for hiding this comment

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

Looks good now, thanks.

@agateau-gg agateau-gg merged commit 04a9c31 into main Aug 21, 2023
@agateau-gg agateau-gg deleted the fbochu/git-isolate-functest branch August 21, 2023 13:09
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.

2 participants