Skip to content

Commit

Permalink
test: make the check_connection test use the local ssh setup
Browse files Browse the repository at this point in the history
With GitHub shutting down user/pass for Git access, let's take the opportunity
to fix this failing test by using our own local setup instead of having to write
down a password to an account.
  • Loading branch information
carlosmn committed Sep 1, 2021
1 parent 063b32d commit d3e86f1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/remote_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ def test_remote_check_connection_push
end

def test_remote_check_connection_push_credentials
skip_if_unreachable
remote = @repo.remotes.create_anonymous('https://github.com/libgit2-push-test/libgit2-push-test.git')
credentials = Rugged::Credentials::UserPassword.new(username: "libgit2-push-test", password: "123qwe123")
assert remote.check_connection(:push, credentials: credentials)
skip unless Rugged.features.include?(:ssh) && ssh_creds?

url = ENV['GITTEST_REMOTE_SSH_URL']
remote = @repo.remotes.create_anonymous(url)
assert remote.check_connection(:push, credentials: ssh_key_credential)
end

def test_remote_check_connection_invalid
Expand Down

0 comments on commit d3e86f1

Please sign in to comment.