-
-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates for v0.4.0 release. Slight refactor/organization.
- Loading branch information
Showing
10 changed files
with
204 additions
and
105 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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package collector | ||
|
||
import ( | ||
"github.com/stretchr/testify/require" | ||
"net/url" | ||
"testing" | ||
) | ||
|
||
func TestApiEndpointParse(t *testing.T) { | ||
baseURL, _ := url.Parse("http://localhost:8080/") | ||
|
||
url1, _ := baseURL.Parse("d/e") | ||
require.Equal(t, "http://localhost:8080/d/e", url1.String()) | ||
|
||
url2, _ := baseURL.Parse("/d/e") | ||
require.Equal(t, "http://localhost:8080/d/e", url2.String()) | ||
} | ||
|
||
func TestApiEndpointParse_WithBasepathWithoutTrailingSlash(t *testing.T) { | ||
baseURL, _ := url.Parse("http://localhost:8080/scrutiny") | ||
|
||
//This testcase is unexpected and can cause issues. We need to ensure the apiEndpoint always has a trailing slash. | ||
url1, _ := baseURL.Parse("d/e") | ||
require.Equal(t, "http://localhost:8080/d/e", url1.String()) | ||
|
||
url2, _ := baseURL.Parse("/d/e") | ||
require.Equal(t, "http://localhost:8080/d/e", url2.String()) | ||
} | ||
|
||
func TestApiEndpointParse_WithBasepathWithTrailingSlash(t *testing.T) { | ||
baseURL, _ := url.Parse("http://localhost:8080/scrutiny/") | ||
|
||
url1, _ := baseURL.Parse("d/e") | ||
require.Equal(t, "http://localhost:8080/scrutiny/d/e", url1.String()) | ||
|
||
url2, _ := baseURL.Parse("/d/e") | ||
require.Equal(t, "http://localhost:8080/d/e", url2.String()) | ||
} |
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 |
---|---|---|
|
@@ -20,7 +20,7 @@ COPY webapp/frontend /opt/scrutiny/src | |
RUN npm install -g @angular/[email protected] && \ | ||
mkdir -p /opt/scrutiny/dist && \ | ||
npm install && \ | ||
ng build --output-path=/opt/scrutiny/dist --deploy-url="/web/" --base-href="/web/" --prod | ||
ng build --output-path=/opt/scrutiny/dist --prod | ||
|
||
|
||
######## | ||
|
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
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
Oops, something went wrong.