Add integration test script and fix Forgejo clone auth#208
Merged
amitsaha merged 2 commits intoamitsaha:masterfrom Feb 25, 2026
Merged
Add integration test script and fix Forgejo clone auth#208amitsaha merged 2 commits intoamitsaha:masterfrom
amitsaha merged 2 commits intoamitsaha:masterfrom
Conversation
- Add integration test script (test/integration-test.sh) that tests fresh clone, update, bare clone, and ignore-private across all services (GitHub, GitLab, Bitbucket, Forgejo) for both SSH and HTTPS - Add -v/--verbose flag to control output verbosity - Fix Forgejo HTTPS clone auth: set gitHostToken, add getUsername() support, and use getCloneURL() to respect SSH/HTTPS flag - Update Forgejo test fixtures with separate clone_url and ssh_url fields - Update Bitbucket scope docs in INTEGRATION_TESTING.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sorry, as I wrote this I may have fixed a couple of things here and there and probably should have done it in a separate commit but kind of wanted to get it over with. The maint gist of this script is that I wanted to test all services with both https and ssh by creating two repos
gitbackup-test-privateandgitbackup-test-publicin each of the services and then testing they were properly found. You can run the command and specify the service you want to test or you can just test all of them and whatever credentials are foundtest/.envare run. If something's missing, it's skipped. You can output in verbose mode which includes the command's output or you can just print pass/fails.This is a preview of what the integration script looks like:
Summary
test/integration-test.sh) for verifying gitbackup works against GitHub, GitLab, Bitbucket, and Forgejo (you can pass the names of the ones you want to test in)-v/--verboseflag for full gitbackup output + summary, quiet mode by defaultignore-privatetest verifies private repos are correctly skipped.env.exampleincludedForgejo clone auth fix:
client.go: SetgitHostTokeninnewForgejoClient()so HTTPS clone URLs get credentialshelpers.go: Add"forgejo"case togetUsername()viaGetMyUserInfo()forgejo.go: UsegetCloneURL(repo.CloneURL, repo.SSHURL)instead of hardcodedrepo.CloneURLrepositories_test.go: Update test fixtures with separateclone_urlandssh_urlfieldsTest plan
go test ./...passesbash test/integration-test.sh bitbucket— 6/6 passbash test/integration-test.sh forgejo— SSH and HTTPS both passbash test/integration-test.sh githubbash test/integration-test.sh gitlab