Test that the shipped data stays under 100 MiB and that publish_release.py stops on a tag at another commit, both in the gate
This commit is contained in:
@@ -2,6 +2,7 @@ package fejkdata
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"os"
|
||||
"reflect"
|
||||
"slices"
|
||||
"strings"
|
||||
@@ -18,6 +19,27 @@ func TestABareNewFailsNamingWithDataFS(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestShippedDataStaysUnder100MiB(t *testing.T) {
|
||||
var size int64
|
||||
err := fs.WalkDir(os.DirFS("data"), ".", func(path string, d fs.DirEntry, err error) error {
|
||||
if err != nil || d.IsDir() {
|
||||
return err
|
||||
}
|
||||
info, err := d.Info()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
size += info.Size()
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if size > 100<<20 {
|
||||
t.Errorf("data/ holds %d bytes, over 100 MiB: carry out todo.md item 193, moving the largest packages into nested Go modules", size)
|
||||
}
|
||||
}
|
||||
|
||||
func TestEveryShippedModuleLoads(t *testing.T) {
|
||||
f, err := New(withShipped(), WithSeed(1))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user