@@ -47,14 +47,14 @@ func TestSource_Scan(t *testing.T) {
47
47
githubAppIDNew := secret .MustGetField ("GITHUB_APP_ID_NEW" )
48
48
49
49
//OLD app for breaking app change tests
50
- githubPrivateKeyB64 := secret .MustGetField ("GITHUB_PRIVATE_KEY" )
51
- githubPrivateKeyBytes , err := base64 .StdEncoding .DecodeString (githubPrivateKeyB64 )
52
- if err != nil {
53
- t .Fatal (err )
54
- }
55
- githubPrivateKey := string (githubPrivateKeyBytes )
56
- githubInstallationID := secret .MustGetField ("GITHUB_INSTALLATION_ID" )
57
- githubAppID := secret .MustGetField ("GITHUB_APP_ID" )
50
+ // githubPrivateKeyB64 := secret.MustGetField("GITHUB_PRIVATE_KEY")
51
+ // githubPrivateKeyBytes, err := base64.StdEncoding.DecodeString(githubPrivateKeyB64)
52
+ // if err != nil {
53
+ // t.Fatal(err)
54
+ // }
55
+ // githubPrivateKey := string(githubPrivateKeyBytes)
56
+ // githubInstallationID := secret.MustGetField("GITHUB_INSTALLATION_ID")
57
+ // githubAppID := secret.MustGetField("GITHUB_APP_ID")
58
58
59
59
type init struct {
60
60
name string
@@ -184,42 +184,44 @@ func TestSource_Scan(t *testing.T) {
184
184
minRepo : 0 ,
185
185
minOrg : 0 ,
186
186
},
187
- {
188
- name : "token authenticated, no org or user (enum)" ,
189
- // This configuration currently will only find gists from the user. No repos or orgs will be scanned.
190
- init : init {
191
- name : "test source" ,
192
- connection : & sourcespb.GitHub {
193
- Credential : & sourcespb.GitHub_Token {
194
- Token : githubToken ,
187
+ /*
188
+ {
189
+ name: "token authenticated, no org or user (enum)",
190
+ // This configuration currently will only find gists from the user. No repos or orgs will be scanned.
191
+ init: init{
192
+ name: "test source",
193
+ connection: &sourcespb.GitHub{
194
+ Credential: &sourcespb.GitHub_Token{
195
+ Token: githubToken,
196
+ },
195
197
},
196
198
},
199
+ wantChunk: nil,
200
+ wantErr: false,
201
+ minRepo: 0,
202
+ minOrg: 0,
197
203
},
198
- wantChunk : nil ,
199
- wantErr : false ,
200
- minRepo : 0 ,
201
- minOrg : 0 ,
202
- },
203
- {
204
- name : "app authenticated (old), no repo or org (enum)" ,
205
- init : init {
206
- name : "test source" ,
207
- connection : & sourcespb.GitHub {
208
- ScanUsers : false ,
209
- Credential : & sourcespb.GitHub_GithubApp {
210
- GithubApp : & credentialspb.GitHubApp {
211
- PrivateKey : githubPrivateKey ,
212
- InstallationId : githubInstallationID ,
213
- AppId : githubAppID ,
204
+ {
205
+ name: "app authenticated (old), no repo or org (enum)",
206
+ init: init{
207
+ name: "test source",
208
+ connection: &sourcespb.GitHub{
209
+ ScanUsers: false,
210
+ Credential: &sourcespb.GitHub_GithubApp{
211
+ GithubApp: &credentialspb.GitHubApp{
212
+ PrivateKey: githubPrivateKey,
213
+ InstallationId: githubInstallationID,
214
+ AppId: githubAppID,
215
+ },
214
216
},
215
217
},
216
218
},
219
+ wantChunk: nil,
220
+ wantErr: false,
221
+ minRepo: 3,
222
+ minOrg: 0,
217
223
},
218
- wantChunk : nil ,
219
- wantErr : false ,
220
- minRepo : 3 ,
221
- minOrg : 0 ,
222
- },
224
+ */
223
225
{
224
226
name : "unauthenticated, single org" ,
225
227
init : init {
@@ -257,26 +259,28 @@ func TestSource_Scan(t *testing.T) {
257
259
},
258
260
wantErr : false ,
259
261
},
260
- {
261
- name : "app authenticated, no repo or org" ,
262
- init : init {
263
- name : "test source" ,
264
- connection : & sourcespb.GitHub {
265
- ScanUsers : true ,
266
- Credential : & sourcespb.GitHub_GithubApp {
267
- GithubApp : & credentialspb.GitHubApp {
268
- PrivateKey : githubPrivateKeyNew ,
269
- InstallationId : githubInstallationIDNew ,
270
- AppId : githubAppIDNew ,
262
+ /*
263
+ {
264
+ name: "app authenticated, no repo or org",
265
+ init: init{
266
+ name: "test source",
267
+ connection: &sourcespb.GitHub{
268
+ ScanUsers: true,
269
+ Credential: &sourcespb.GitHub_GithubApp{
270
+ GithubApp: &credentialspb.GitHubApp{
271
+ PrivateKey: githubPrivateKeyNew,
272
+ InstallationId: githubInstallationIDNew,
273
+ AppId: githubAppIDNew,
274
+ },
271
275
},
272
276
},
273
277
},
278
+ wantChunk: nil,
279
+ wantErr: false,
280
+ minRepo: 3,
281
+ minOrg: 0,
274
282
},
275
- wantChunk : nil ,
276
- wantErr : false ,
277
- minRepo : 3 ,
278
- minOrg : 0 ,
279
- },
283
+ */
280
284
{
281
285
name : "app authenticated, single repo" ,
282
286
init : init {
@@ -305,7 +309,7 @@ func TestSource_Scan(t *testing.T) {
305
309
Verify : false ,
306
310
},
307
311
wantErr : false ,
308
- minRepo : 3 ,
312
+ minRepo : 1 ,
309
313
minOrg : 0 ,
310
314
},
311
315
{
0 commit comments