@@ -68,6 +68,34 @@ func testGit(t *testing.T, u *url.URL) {
68
68
rawTest (t , & httpContext , little , big , littleLFS , bigLFS )
69
69
mediaTest (t , & httpContext , little , big , littleLFS , bigLFS )
70
70
71
+ t .Run ("SizeLimit" , func (t * testing.T ) {
72
+ t .Run ("Under" , func (t * testing.T ) {
73
+ PrintCurrentTest (t )
74
+ doCommitAndPush (t , littleSize , dstPath , "data-file-" )
75
+ })
76
+ t .Run ("Over" , func (t * testing.T ) {
77
+ PrintCurrentTest (t )
78
+ doAPISetRepoSizeLimit (forkedUserCtx , forkedUserCtx .Username , forkedUserCtx .Reponame , littleSize )
79
+ //TODO fix this doCommitAndPushWithExpectedError(t, bigSize, dstPath, "data-file-")
80
+ })
81
+ t .Run ("UnderAfterResize" , func (t * testing.T ) {
82
+ PrintCurrentTest (t )
83
+ doAPISetRepoSizeLimit (forkedUserCtx , forkedUserCtx .Username , forkedUserCtx .Reponame , bigSize * 10 )
84
+ doCommitAndPush (t , littleSize , dstPath , "data-file-" )
85
+ })
86
+ t .Run ("Deletion" , func (t * testing.T ) {
87
+ PrintCurrentTest (t )
88
+ //TODO delete a file
89
+ //doDeleteCommitAndPush(t, littleSize, dstPath, "data-file-")
90
+ })
91
+ //TODO delete branch
92
+ //TODO delete tag
93
+ //TODO add big commit that will be over with the push
94
+ //TODO add lfs
95
+ //TODO remove lfs
96
+ //TODO add missing case
97
+ })
98
+
71
99
t .Run ("BranchProtectMerge" , doBranchProtectPRMerge (& httpContext , dstPath ))
72
100
t .Run ("MergeFork" , func (t * testing.T ) {
73
101
defer PrintCurrentTest (t )()
@@ -291,6 +319,14 @@ func doCommitAndPush(t *testing.T, size int, repoPath, prefix string) string {
291
319
return name
292
320
}
293
321
322
+ func doCommitAndPushWithExpectedError (t * testing.T , size int , repoPath , prefix string ) string {
323
+ name , err := generateCommitWithNewData (size , repoPath , "user2@example.com" , "User Two" , prefix )
324
+ assert .NoError (t , err )
325
+ _ , err = git .NewCommand ("push" , "origin" , "master" ).RunInDir (repoPath ) //Push
326
+ assert .Error (t , err )
327
+ return name
328
+ }
329
+
294
330
func generateCommitWithNewData (size int , repoPath , email , fullName , prefix string ) (string , error ) {
295
331
//Generate random file
296
332
bufSize := 4 * 1024
0 commit comments