hugolib: Disable shaky leaktest on CI

This commit is contained in:
Bjørn Erik Pedersen 2017-06-13 21:22:47 +02:00
parent 95386544e8
commit 5103935ae8
2 changed files with 8 additions and 2 deletions

View file

@ -392,8 +392,10 @@ func doTestMultiSitesBuild(t *testing.T, configTemplate, configSuffix string) {
func TestMultiSitesRebuild(t *testing.T) { func TestMultiSitesRebuild(t *testing.T) {
// t.Parallel() not supported, see https://github.com/fortytw2/leaktest/issues/4 // t.Parallel() not supported, see https://github.com/fortytw2/leaktest/issues/4
// This leaktest seems to be a little bit shaky on Travis.
if !isCI() {
defer leaktest.CheckTimeout(t, 30*time.Second)() defer leaktest.CheckTimeout(t, 30*time.Second)()
}
siteConfig := testSiteConfig{Fs: afero.NewMemMapFs(), DefaultContentLanguage: "fr", DefaultContentLanguageInSubdir: true} siteConfig := testSiteConfig{Fs: afero.NewMemMapFs(), DefaultContentLanguage: "fr", DefaultContentLanguageInSubdir: true}
sites := createMultiTestSites(t, siteConfig, multiSiteTOMLConfigTemplate) sites := createMultiTestSites(t, siteConfig, multiSiteTOMLConfigTemplate)
fs := sites.Fs fs := sites.Fs

View file

@ -208,3 +208,7 @@ func writeSourcesToSource(t *testing.T, base string, fs *hugofs.Fs, sources ...s
writeSource(t, fs, filepath.Join(base, src.Name), string(src.Content)) writeSource(t, fs, filepath.Join(base, src.Name), string(src.Content))
} }
} }
func isCI() bool {
return os.Getenv("CI") != ""
}