diff --git a/hugolib/hugo_smoke_test.go b/hugolib/hugo_smoke_test.go index 62bece032..274b1be93 100644 --- a/hugolib/hugo_smoke_test.go +++ b/hugolib/hugo_smoke_test.go @@ -339,20 +339,42 @@ func TestBenchmarkBaseline(t *testing.T) { } func BenchmarkBaseline(b *testing.B) { - cfg := IntegrationTestConfig{ - T: b, - TxtarString: benchmarkBaselineFiles(), - } - builders := make([]*IntegrationTestBuilder, b.N) + b.Run("withrender", func(b *testing.B) { + cfg := IntegrationTestConfig{ + T: b, + TxtarString: benchmarkBaselineFiles(), + } + builders := make([]*IntegrationTestBuilder, b.N) - for i := range builders { - builders[i] = NewIntegrationTestBuilder(cfg) - } + for i := range builders { + builders[i] = NewIntegrationTestBuilder(cfg) + } - b.ResetTimer() - for i := 0; i < b.N; i++ { - builders[i].Build() - } + b.ResetTimer() + for i := 0; i < b.N; i++ { + builders[i].Build() + } + }) + + b.Run("skiprender", func(b *testing.B) { + cfg := IntegrationTestConfig{ + T: b, + TxtarString: benchmarkBaselineFiles(), + BuildCfg: BuildCfg{ + SkipRender: true, + }, + } + builders := make([]*IntegrationTestBuilder, b.N) + + for i := range builders { + builders[i] = NewIntegrationTestBuilder(cfg) + } + + b.ResetTimer() + for i := 0; i < b.N; i++ { + builders[i].Build() + } + }) } func benchmarkBaselineFiles() string { diff --git a/hugolib/integrationtest_builder.go b/hugolib/integrationtest_builder.go index 8bd458bc1..9be3f7c2e 100644 --- a/hugolib/integrationtest_builder.go +++ b/hugolib/integrationtest_builder.go @@ -207,7 +207,7 @@ func (s *IntegrationTestBuilder) BuildE() (*IntegrationTestBuilder, error) { return s, err } - err := s.build(BuildCfg{}) + err := s.build(s.Cfg.BuildCfg) return s, err } @@ -503,4 +503,6 @@ type IntegrationTestConfig struct { NeedsNpmInstall bool WorkingDir string + + BuildCfg BuildCfg }