ci: Another attempt at reducing

This commit is contained in:
Antoine Aflalo
2024-08-28 14:22:25 -04:00
parent ce365a6bdf
commit f89974ac79

View File

@@ -22,14 +22,14 @@ func TestConvertChapter(t *testing.T) {
}{ }{
{ {
name: "All split pages", name: "All split pages",
genTestChapter: genHugePages, genTestChapter: genHugePage,
split: true, split: true,
expectFailure: []constant.ConversionFormat{}, expectFailure: []constant.ConversionFormat{},
expectPartialSuccess: []constant.ConversionFormat{}, expectPartialSuccess: []constant.ConversionFormat{},
}, },
{ {
name: "Big Pages, no split", name: "Big Pages, no split",
genTestChapter: genHugePages, genTestChapter: genHugePage,
split: false, split: false,
expectFailure: []constant.ConversionFormat{constant.WebP}, expectFailure: []constant.ConversionFormat{constant.WebP},
expectPartialSuccess: []constant.ConversionFormat{}, expectPartialSuccess: []constant.ConversionFormat{},
@@ -116,7 +116,7 @@ func TestConvertChapter(t *testing.T) {
} }
} }
func genHugePages(path string) (*manga.Chapter, error) { func genHugePage(path string) (*manga.Chapter, error) {
file, err := os.Open(path) file, err := os.Open(path)
if err != nil { if err != nil {
return nil, err return nil, err
@@ -124,7 +124,7 @@ func genHugePages(path string) (*manga.Chapter, error) {
defer file.Close() defer file.Close()
var pages []*manga.Page var pages []*manga.Page
for i := 0; i < 5; i++ { // Assuming there are 5 pages for the test for i := 0; i < 1; i++ { // Assuming there are 5 pages for the test
img := image.NewRGBA(image.Rect(0, 0, 1, 17000)) img := image.NewRGBA(image.Rect(0, 0, 1, 17000))
buf := new(bytes.Buffer) buf := new(bytes.Buffer)
err := jpeg.Encode(buf, img, nil) err := jpeg.Encode(buf, img, nil)