Skip to content

Commit

Permalink
[Fix] detector's integration tests starting with alphabet 'g' (#3765)
Browse files Browse the repository at this point in the history
* fix geocodio detector test

* fix github detector test

* fix githubapp detector test

* fix gitlab v2 detector

* fix godaddy v1 detector test
  • Loading branch information
abmussani authored Dec 11, 2024
1 parent b26aa17 commit c24b4d5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/detectors/geocodio/geocodio_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ func TestGeocodio_FromChunk(t *testing.T) {
t.Fatalf("no raw secret present: \n %+v", got[i])
}
got[i].Raw = nil
if len(got[i].RawV2) == 0 {
t.Fatalf("no raw v2 secret present: \n %+v", got[i])
}
got[i].RawV2 = nil
}
if diff := pretty.Compare(got, tt.want); diff != "" {
t.Errorf("Geocodio.FromData() %s diff: (-got +want)\n%s", tt.name, diff)
Expand Down
3 changes: 3 additions & 0 deletions pkg/detectors/github/v2/github_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ func TestGitHub_FromChunk(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
s := Scanner{}
s.UseCloudEndpoint(true)
s.SetCloudEndpoint(s.CloudEndpoint())
got, err := s.FromData(tt.args.ctx, tt.args.verify, tt.args.data)
if (err != nil) != tt.wantErr {
t.Errorf("GitHub.FromData() error = %v, wantErr %v", err, tt.wantErr)
Expand All @@ -215,6 +217,7 @@ func TestGitHub_FromChunk(t *testing.T) {
t.Fatal("no raw secret present")
}
got[i].Raw = nil
got[i].AnalysisInfo = nil
}
if diff := pretty.Compare(got, tt.want); diff != "" {
t.Errorf("GitHub.FromData() %s diff: (-got +want)\n%s", tt.name, diff)
Expand Down
1 change: 1 addition & 0 deletions pkg/detectors/githubapp/githubapp_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ func TestGitHubApp_FromChunk(t *testing.T) {
t.Fatalf("no raw secret present: \n %+v", got[i])
}
got[i].Raw = nil
got[i].ExtraData = nil
}
if diff := pretty.Compare(got, tt.want); diff != "" {
t.Errorf("GitHubApp.FromData() %s diff: (-got +want)\n%s", tt.name, diff)
Expand Down
2 changes: 2 additions & 0 deletions pkg/detectors/gitlab/v2/gitlab_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ func TestGitlabV2_FromChunk(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
tt.s.UseCloudEndpoint(true)
tt.s.SetCloudEndpoint(tt.s.CloudEndpoint())
got, err := tt.s.FromData(tt.args.ctx, tt.args.verify, tt.args.data)
if (err != nil) != tt.wantErr {
t.Errorf("Gitlab.FromData() error = %v, wantErr %v", err, tt.wantErr)
Expand Down
1 change: 1 addition & 0 deletions pkg/detectors/godaddy/v1/godaddy_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ func TestGoDaddy_FromChunk(t *testing.T) {
t.Fatalf("no raw secret present: \n %+v", got[i])
}
got[i].Raw = nil
got[i].ExtraData = nil
}
if diff := pretty.Compare(got, tt.want); diff != "" {
t.Errorf("GoDaddy.FromData() %s diff: (-got +want)\n%s", tt.name, diff)
Expand Down

0 comments on commit c24b4d5

Please sign in to comment.