FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

32 bit CI does not like 500 meg buffers. · nodegit/nodegit@658f5b7 · GitHub

Repository navigation

Commit 658f5b7

Browse files
committed
32 bit CI does not like 500 meg buffers.
1 parent 1cb96b4 commit 658f5b7

1 file changed

Lines changed: 54 additions & 50 deletions

File tree

‎test/tests/filter.js‎

Lines changed: 54 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ describe("Filter", function() {
8383
.then(function(emptyRepo) {
8484
test.emptyRepo = emptyRepo;
8585
return fse.writeFile(
86-
path.join(reposPath, ".gitattributes"),
86+
path.join(reposPath, ".gitattributes"),
8787
"*.md filter=" + filterName + " -text",
8888
{ encoding: "utf-8" }
8989
);
@@ -153,7 +153,7 @@ describe("Filter", function() {
153153

154154
it("cannot unregister the filter twice", function() {
155155
return Registry.unregister(filterName)
156-
.then(function(result) {
156+
.then(function(result) {
157157
assert.strictEqual(result, NodeGit.Error.CODE.OK);
158158
return Registry.unregister(filterName);
159159
})
@@ -185,7 +185,7 @@ describe("Filter", function() {
185185
})
186186
.then(function() {
187187
return fse.writeFile(
188-
packageJsonPath,
188+
packageJsonPath,
189189
"Changing content to trigger checkout"
190190
);
191191
})
@@ -219,7 +219,7 @@ describe("Filter", function() {
219219
global.gc();
220220

221221
return fse.writeFile(
222-
packageJsonPath,
222+
packageJsonPath,
223223
"Changing content to trigger checkout"
224224
);
225225
})
@@ -253,7 +253,7 @@ describe("Filter", function() {
253253
})
254254
.then(function() {
255255
return fse.writeFile(
256-
packageJsonPath,
256+
packageJsonPath,
257257
"Changing content to trigger checkout"
258258
);
259259
})
@@ -289,7 +289,7 @@ describe("Filter", function() {
289289
.then(function(result) {
290290
assert.strictEqual(result, NodeGit.Error.CODE.OK);
291291
return fse.writeFile(
292-
packageJsonPath,
292+
packageJsonPath,
293293
"Changing content to trigger checkout",
294294
{ encoding: "utf-8" }
295295
);
@@ -309,7 +309,7 @@ describe("Filter", function() {
309309
assert.strictEqual(shutdown, true);
310310
});
311311
});
312-
312+
313313
it("filter successfully shuts down on garbage collect", function() {
314314
var test = this;
315315
var shutdown = false;
@@ -325,7 +325,7 @@ describe("Filter", function() {
325325
.then(function(result) {
326326
assert.strictEqual(result, NodeGit.Error.CODE.OK);
327327
return fse.writeFile(
328-
packageJsonPath,
328+
packageJsonPath,
329329
"Changing content to trigger checkout",
330330
{ encoding: "utf-8" }
331331
);
@@ -363,7 +363,7 @@ describe("Filter", function() {
363363
.then(function(result) {
364364
assert.strictEqual(result, NodeGit.Error.CODE.OK);
365365
return fse.writeFile(
366-
packageJsonPath,
366+
packageJsonPath,
367367
"Changing content to trigger checkout",
368368
{ encoding: "utf-8" }
369369
);
@@ -389,7 +389,7 @@ describe("Filter", function() {
389389
});
390390

391391
describe("Apply", function() {
392-
before(function() {
392+
before(function() {
393393
var test = this;
394394
return fse.readFile(readmePath, "utf8")
395395
.then((function(content) {
@@ -410,7 +410,7 @@ describe("Filter", function() {
410410
it("should not apply when check returns GIT_PASSTHROUGH", function(){
411411
var test = this;
412412
var applied = false;
413-
413+
414414
return Registry.register(filterName, {
415415
apply: function() {
416416
applied = true;
@@ -422,7 +422,7 @@ describe("Filter", function() {
422422
.then(function(result) {
423423
assert.strictEqual(result, NodeGit.Error.CODE.OK);
424424
return fse.writeFile(
425-
packageJsonPath,
425+
packageJsonPath,
426426
"Changing content to trigger checkout",
427427
{ encoding: "utf-8" }
428428
);
@@ -454,8 +454,8 @@ describe("Filter", function() {
454454
.then(function(result) {
455455
assert.strictEqual(result, NodeGit.Error.CODE.OK);
456456
return fse.writeFile(
457-
packageJsonPath,
458-
"Changing content to trigger checkout",
457+
packageJsonPath,
458+
"Changing content to trigger checkout",
459459
{ encoding: "utf-8" }
460460
);
461461
})
@@ -490,13 +490,13 @@ describe("Filter", function() {
490490
})
491491
.then(function() {
492492
var readmeContent = fse.readFileSync(
493-
packageJsonPath,
493+
packageJsonPath,
494494
"utf-8"
495495
);
496496
assert.notStrictEqual(readmeContent, message);
497497

498498
return fse.writeFile(
499-
packageJsonPath,
499+
packageJsonPath,
500500
"Changing content to trigger checkout"
501501
);
502502
})
@@ -509,7 +509,7 @@ describe("Filter", function() {
509509
})
510510
.then(function() {
511511
var postInitializeReadmeContents = fse.readFileSync(
512-
readmePath,
512+
readmePath,
513513
"utf-8"
514514
);
515515

@@ -536,7 +536,7 @@ describe("Filter", function() {
536536
})
537537
.then(function() {
538538
var readmeContent = fse.readFileSync(
539-
readmePath,
539+
readmePath,
540540
"utf-8"
541541
);
542542
assert.notStrictEqual(readmeContent, message);
@@ -550,30 +550,33 @@ describe("Filter", function() {
550550
})
551551
.then(function() {
552552
var postInitializeReadmeContents = fse.readFileSync(
553-
readmePath,
553+
readmePath,
554554
"utf-8"
555555
);
556556

557557
assert.strictEqual(postInitializeReadmeContents, message);
558558
});
559559
});
560560

561-
it("applies the massive filter data on checkout", function() {
562-
this.timeout(350000);
563-
var test = this;
564-
var largeBuffer = Buffer.alloc(largeBufferSize, "a");
565-
566-
return Registry.register(filterName, {
567-
apply: function(to, from, source) {
568-
return to.set(largeBuffer, largeBufferSize)
561+
// this test is useless on 32 bit CI, because we cannot construct
562+
// a buffer big enough to test anything of significance :)...
563+
if (process.arch === "x64") {
564+
it("applies the massive filter data on checkout", function() {
565+
this.timeout(350000);
566+
var test = this;
567+
var largeBuffer = Buffer.alloc(largeBufferSize, "a");
568+
569+
return Registry.register(filterName, {
570+
apply: function(to, from, source) {
571+
return to.set(largeBuffer, largeBufferSize)
569572
.then(function() {
570573
return NodeGit.Error.CODE.OK;
571574
});
572-
},
573-
check: function(src, attr) {
574-
return NodeGit.Error.CODE.OK;
575-
}
576-
}, 0)
575+
},
576+
check: function(src, attr) {
577+
return NodeGit.Error.CODE.OK;
578+
}
579+
}, 0)
577580
.then(function(result) {
578581
assert.strictEqual(result, 0);
579582
})
@@ -615,7 +618,8 @@ describe("Filter", function() {
615618
largeBufferSize
616619
);
617620
});
618-
});
621+
});
622+
}
619623

620624
it("applies the filter data on checkout with gc", function() {
621625
var test = this;
@@ -636,7 +640,7 @@ describe("Filter", function() {
636640
})
637641
.then(function() {
638642
var readmeContent = fse.readFileSync(
639-
readmePath,
643+
readmePath,
640644
"utf-8"
641645
);
642646
assert.notStrictEqual(readmeContent, message);
@@ -651,7 +655,7 @@ describe("Filter", function() {
651655
})
652656
.then(function() {
653657
var postInitializeReadmeContents = fse.readFileSync(
654-
readmePath,
658+
readmePath,
655659
"utf-8"
656660
);
657661

@@ -670,7 +674,7 @@ describe("Filter", function() {
670674
});
671675
},
672676
check: function(src, attr) {
673-
return src.path() === "README.md" ?
677+
return src.path() === "README.md" ?
674678
0 : NodeGit.Error.CODE.PASSTHROUGH;
675679
},
676680
cleanup: function() {}
@@ -680,14 +684,14 @@ describe("Filter", function() {
680684
})
681685
.then(function() {
682686
var readmeContent = fse.readFileSync(
683-
readmePath,
687+
readmePath,
684688
"utf-8"
685689
);
686690
assert.notStrictEqual(readmeContent, "testing commit contents");
687691
})
688692
.then(function() {
689-
return commitFile(test.repository, "README.md",
690-
"testing commit contents",
693+
return commitFile(test.repository, "README.md",
694+
"testing commit contents",
691695
"test commit"
692696
);
693697
})
@@ -696,7 +700,7 @@ describe("Filter", function() {
696700
})
697701
.then(function(commit) {
698702
var postInitializeReadmeContents = fse.readFileSync(
699-
readmePath,
703+
readmePath,
700704
"utf-8"
701705
);
702706

@@ -738,14 +742,14 @@ describe("Filter", function() {
738742
})
739743
.then(function() {
740744
var readmeContent = fse.readFileSync(
741-
readmePath,
745+
readmePath,
742746
"utf-8"
743747
);
744748
assert.notStrictEqual(readmeContent, "testing commit contents");
745749
})
746750
.then(function() {
747-
return commitFile(test.repository, "README.md",
748-
"testing commit contents",
751+
return commitFile(test.repository, "README.md",
752+
"testing commit contents",
749753
"test commit"
750754
);
751755
})
@@ -755,7 +759,7 @@ describe("Filter", function() {
755759
})
756760
.then(function(commit) {
757761
var postInitializeReadmeContents = fse.readFileSync(
758-
readmePath,
762+
readmePath,
759763
"utf-8"
760764
);
761765

@@ -806,7 +810,7 @@ describe("Filter", function() {
806810
assert.notEqual(packageContent, "");
807811

808812
return fse.writeFile(
809-
packageJsonPath,
813+
packageJsonPath,
810814
"Changing content to trigger checkout",
811815
{ encoding: "utf-8" }
812816
);
@@ -845,14 +849,14 @@ describe("Filter", function() {
845849
})
846850
.then(function() {
847851
var packageContent = fse.readFileSync(
848-
packageJsonPath,
852+
packageJsonPath,
849853
"utf-8"
850854
);
851855
assert.notEqual(packageContent, "");
852856

853857
global.gc();
854858
return fse.writeFile(
855-
packageJsonPath,
859+
packageJsonPath,
856860
"Changing content to trigger checkout",
857861
{ encoding: "utf-8" }
858862
);
@@ -892,11 +896,11 @@ describe("Filter", function() {
892896
})
893897
.then(function() {
894898
var packageContent = fse.readFileSync(
895-
packageJsonPath,
899+
packageJsonPath,
896900
"utf-8"
897901
);
898902
var readmeContent = fse.readFileSync(
899-
readmePath,
903+
readmePath,
900904
"utf-8"
901905
);
902906

@@ -905,7 +909,7 @@ describe("Filter", function() {
905909
})
906910
.then(function() {
907911
return fse.writeFile(
908-
packageJsonPath,
912+
packageJsonPath,
909913
"Changing content to trigger checkout",
910914
{ encoding: "utf-8" }
911915
);

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL