Allow overriding git credentials in shell integration tests
What does this MR do?
Some shell integration tests interact with GitLab.com repositories and require authentication. Previously, these tests hard-coded the username as 'gitlab-ci-token', making it impossible to run them locally without a CI job token.
This commit introduces the GITLAB_TEST_USERNAME environment variable to allow developers to override the username for local testing. When set along with GITLAB_TOKEN, developers can now run shell integration tests locally using their own credentials.
Changes:
- Modified getGitCred() to use GITLAB_TEST_USERNAME env var with fallback to 'gitlab-ci-token'.
- Modified setGitCred() to use the same environment variable
- Added documentation in docs/development/_index.md with usage examples
Example usage:
export GITLAB_TEST_USERNAME="your-username"
export GITLAB_TOKEN="your-personal-access-token"
go test -count=1 -v -run TestGitIncludePaths --tags=integration ./executors/shell
This was needed for local testing of !5977 (merged), which requires running integration tests with relative builds_dir configurations.
Why was this MR needed?
What's the best way to test this MR?
What are the relevant issue numbers?
Edited by Stan Hu