-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ELITERT-1221] Fix crashes with GitHub hosted repos
Fixes an issue that caused Dragnet to crash when generating an HTML report for the results of an execution over a repository hosted on Github. The reason for the crash was that Ruby's URI parser is incapable of parsing a GitHub URL, so, it was replaced by Git's URL.parse method, which is capable of doing it.
- Loading branch information
Sergio Bobillier
committed
Dec 11, 2024
1 parent
fbcb6f8
commit 350488c
Showing
3 changed files
with
53 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,10 +84,12 @@ | |
describe '#remote_uri_path' do | ||
subject(:method_call) { repository.remote_uri_path } | ||
|
||
let(:remote_url) { 'ssh://[email protected]:29418/projects/central/bsw' } | ||
|
||
let(:remote) do | ||
instance_double( | ||
Git::Remote, | ||
url: 'ssh://[email protected]:29418/projects/central/bsw' | ||
url: remote_url | ||
) | ||
end | ||
|
||
|
@@ -109,8 +111,50 @@ | |
method_call | ||
end | ||
|
||
it "returns only the path of the remote's URL" do | ||
expect(method_call).to eq('/projects/central/bsw') | ||
context 'when the URL is a standard SSH url' do | ||
it "returns only the path of the remote's URL" do | ||
expect(method_call).to eq('/projects/central/bsw') | ||
end | ||
end | ||
|
||
context 'when the URL is a Git URL' do | ||
let(:remote_url) { 'git://[email protected]/esrlabs/dox.git' } | ||
|
||
it "returns only the path of the remote's URL" do | ||
expect(method_call).to eq('/esrlabs/dox.git') | ||
end | ||
end | ||
|
||
context 'when the URL is a GitHub URL' do | ||
let(:remote_url) { '[email protected]:esrlabs/dox.git' } | ||
|
||
it "returns only the path of the remote's URL" do | ||
expect(method_call).to eq('/esrlabs/dox.git') | ||
end | ||
end | ||
|
||
context 'when the URL is an HTTPS URL' do | ||
let(:remote_url) { 'https://github.com/esrlabs/dox.git' } | ||
|
||
it "returns only the path of the remote's URL" do | ||
expect(method_call).to eq('/esrlabs/dox.git') | ||
end | ||
end | ||
|
||
context 'when the URL is a file URL' do | ||
let(:remote_url) { '~/Projects/esrlabs/dox' } | ||
|
||
it "returns only the path of the remote's URL" do | ||
expect(method_call).to eq('~/Projects/esrlabs/dox') | ||
end | ||
end | ||
|
||
context 'when the URL is a JOSH URL' do | ||
let(:remote_url) { 'https://[email protected]/bsw.git:/libs.git' } | ||
|
||
it "returns only the path of the remote's URL" do | ||
expect(method_call).to eq('/bsw.git:/libs.git') | ||
end | ||
end | ||
end | ||
|
||
|