Skip to content

Find, verify, and analyze leaked credentials

Disable tests that take too long (#524)

Bill Rich212aa9ba1e46
diff --git a/pkg/sources/github/github_test.go b/pkg/sources/github/github_test.go
index e5252ad51..45207d90e 100644
--- a/pkg/sources/github/github_test.go
+++ b/pkg/sources/github/github_test.go
@@ -47,14 +47,14 @@ func TestSource_Scan(t *testing.T) {
githubAppIDNew := secret.MustGetField("GITHUB_APP_ID_NEW")
//OLD app for breaking app change tests
- githubPrivateKeyB64 := secret.MustGetField("GITHUB_PRIVATE_KEY")
- githubPrivateKeyBytes, err := base64.StdEncoding.DecodeString(githubPrivateKeyB64)
- if err != nil {
- t.Fatal(err)
- }
- githubPrivateKey := string(githubPrivateKeyBytes)
- githubInstallationID := secret.MustGetField("GITHUB_INSTALLATION_ID")
- githubAppID := secret.MustGetField("GITHUB_APP_ID")
+ // githubPrivateKeyB64 := secret.MustGetField("GITHUB_PRIVATE_KEY")
+ // githubPrivateKeyBytes, err := base64.StdEncoding.DecodeString(githubPrivateKeyB64)
+ // if err != nil {
+ // t.Fatal(err)
+ // }
+ // githubPrivateKey := string(githubPrivateKeyBytes)
+ // githubInstallationID := secret.MustGetField("GITHUB_INSTALLATION_ID")
+ // githubAppID := secret.MustGetField("GITHUB_APP_ID")
type init struct {
name string
@@ -184,42 +184,44 @@ func TestSource_Scan(t *testing.T) {
minRepo: 0,
minOrg: 0,
},
- {
- name: "token authenticated, no org or user (enum)",
- // This configuration currently will only find gists from the user. No repos or orgs will be scanned.
- init: init{
- name: "test source",
- connection: &sourcespb.GitHub{
- Credential: &sourcespb.GitHub_Token{
- Token: githubToken,
+ /*
+ {
+ name: "token authenticated, no org or user (enum)",
+ // This configuration currently will only find gists from the user. No repos or orgs will be scanned.
+ init: init{
+ name: "test source",
+ connection: &sourcespb.GitHub{
+ Credential: &sourcespb.GitHub_Token{
+ Token: githubToken,
+ },
},
},
+ wantChunk: nil,
+ wantErr: false,
+ minRepo: 0,
+ minOrg: 0,
},
- wantChunk: nil,
- wantErr: false,
- minRepo: 0,
- minOrg: 0,
- },
- {
- name: "app authenticated (old), no repo or org (enum)",
- init: init{
- name: "test source",
- connection: &sourcespb.GitHub{
- ScanUsers: false,
- Credential: &sourcespb.GitHub_GithubApp{
- GithubApp: &credentialspb.GitHubApp{
- PrivateKey: githubPrivateKey,
- InstallationId: githubInstallationID,
- AppId: githubAppID,
+ {
+ name: "app authenticated (old), no repo or org (enum)",
+ init: init{
+ name: "test source",
+ connection: &sourcespb.GitHub{
+ ScanUsers: false,
+ Credential: &sourcespb.GitHub_GithubApp{
+ GithubApp: &credentialspb.GitHubApp{
+ PrivateKey: githubPrivateKey,
+ InstallationId: githubInstallationID,
+ AppId: githubAppID,
+ },
},
},
},
+ wantChunk: nil,
+ wantErr: false,
+ minRepo: 3,
+ minOrg: 0,
},
- wantChunk: nil,
- wantErr: false,
- minRepo: 3,
- minOrg: 0,
- },
+ */
{
name: "unauthenticated, single org",
init: init{
@@ -257,26 +259,28 @@ func TestSource_Scan(t *testing.T) {
},
wantErr: false,
},
- {
- name: "app authenticated, no repo or org",
- init: init{
- name: "test source",
- connection: &sourcespb.GitHub{
- ScanUsers: true,
- Credential: &sourcespb.GitHub_GithubApp{
- GithubApp: &credentialspb.GitHubApp{
- PrivateKey: githubPrivateKeyNew,
- InstallationId: githubInstallationIDNew,
- AppId: githubAppIDNew,
+ /*
+ {
+ name: "app authenticated, no repo or org",
+ init: init{
+ name: "test source",
+ connection: &sourcespb.GitHub{
+ ScanUsers: true,
+ Credential: &sourcespb.GitHub_GithubApp{
+ GithubApp: &credentialspb.GitHubApp{
+ PrivateKey: githubPrivateKeyNew,
+ InstallationId: githubInstallationIDNew,
+ AppId: githubAppIDNew,
+ },
},
},
},
+ wantChunk: nil,
+ wantErr: false,
+ minRepo: 3,
+ minOrg: 0,
},
- wantChunk: nil,
- wantErr: false,
- minRepo: 3,
- minOrg: 0,
- },
+ */
{
name: "app authenticated, single repo",
init: init{
@@ -305,7 +309,7 @@ func TestSource_Scan(t *testing.T) {
Verify: false,
},
wantErr: false,
- minRepo: 3,
+ minRepo: 1,
minOrg: 0,
},
{