Disable tests that take too long (#524)

This commit is contained in:
Bill Rich 2022-05-04 15:37:37 -08:00 committed by GitHub
parent 6ee5c57968
commit 212aa9ba1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,
},
},
},
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: "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: 3,
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,
},
},
},
},
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,
},
{