From: "Dr. Tobias Quathamer" Date: Wed, 24 Sep 2025 22:18:30 +0200 Subject: Skip tests that access the Internet during Debian build But let the test run during autopkgtest. Examples include: - TestTransformPostCSS runs "npm install" which accesses the Internet - TestHugoModulesVariants pulls in github.com/gohugoio/hugoTestModule2 - TestEmbeddedShortcodes where {{< tweet >}} shortcode accesses the Internet Origin: vendor Forwarded: not-needed Last-Update: 2021-01-27, 2022-02-23, 2022-06-07, 2022-06-08, 2023-03-09, 2023-07-06, 2023-10-10, 2024-02-23, 2024-07-14, 2024-08-18 --- cache/filecache/filecache_pruner_test.go | 1 + common/hexec/exec_integration_test.go | 1 + hugolib/gitinfo_github_test.go | 6 + hugolib/hugo_modules_test.go | 1 + hugolib/rebuild_test.go | 4 + internal/js/esbuild/batch_integration_test.go | 1 + modules/client_test.go | 3 + modules/modules_integration_test.go | 1 + .../create/create_integration_test.go | 6 + .../babel/babel_integration_test.go | 5 + .../cssjs/postcss_integration_test.go | 23 +++ .../cssjs/tailwindcss_integration_test.go | 25 +++ .../js/js_integration_test.go | 6 + testscripts/commands/hugo__static_issue14507.txt | 27 --- testscripts/commands/mod.txt | 45 ----- testscripts/commands/mod__disable.txt | 15 -- testscripts/commands/mod__hugodirectsum.txt | 15 -- testscripts/commands/mod__hugodirectsum_tamper.txt | 16 -- testscripts/commands/mod__tamper_gosum.txt | 22 --- testscripts/commands/mod_get.txt | 15 -- testscripts/commands/mod_get_u.txt | 22 --- testscripts/commands/mod_npm.txt | 219 --------------------- testscripts/commands/mod_npm__moduleorder.txt | 68 ------- testscripts/commands/mod_npm_withexisting.txt | 62 ------ testscripts/commands/mod_vendor.txt | 29 --- testscripts/commands/mod_vendor__versions.txt | 100 ---------- tpl/css/build_integration_test.go | 1 + tpl/tplimpl/shortcodes_integration_test.go | 2 + 28 files changed, 86 insertions(+), 655 deletions(-) delete mode 100644 testscripts/commands/hugo__static_issue14507.txt delete mode 100644 testscripts/commands/mod.txt delete mode 100644 testscripts/commands/mod__disable.txt delete mode 100644 testscripts/commands/mod__hugodirectsum.txt delete mode 100644 testscripts/commands/mod__hugodirectsum_tamper.txt delete mode 100644 testscripts/commands/mod__tamper_gosum.txt delete mode 100644 testscripts/commands/mod_get.txt delete mode 100644 testscripts/commands/mod_get_u.txt delete mode 100644 testscripts/commands/mod_npm.txt delete mode 100644 testscripts/commands/mod_npm__moduleorder.txt delete mode 100644 testscripts/commands/mod_npm_withexisting.txt delete mode 100644 testscripts/commands/mod_vendor.txt delete mode 100644 testscripts/commands/mod_vendor__versions.txt diff --git a/cache/filecache/filecache_pruner_test.go b/cache/filecache/filecache_pruner_test.go index dc01e41..1e7948e 100644 --- a/cache/filecache/filecache_pruner_test.go +++ b/cache/filecache/filecache_pruner_test.go @@ -87,6 +87,7 @@ func TestPruneCacheEntryWithOtherCaseCaseSensitiveFs(t *testing.T) { } func TestPrune(t *testing.T) { + t.Skip("Skip test until go.mod is supported by dh-golang") t.Parallel() synctest.Test(t, func(t *testing.T) { diff --git a/common/hexec/exec_integration_test.go b/common/hexec/exec_integration_test.go index 3c820b5..14d6dc7 100644 --- a/common/hexec/exec_integration_test.go +++ b/common/hexec/exec_integration_test.go @@ -21,6 +21,7 @@ import ( ) func TestNPMGlobalInstalls(t *testing.T) { + t.Skip("This tests needs internet access") if !htesting.IsRealCI() { t.Skip("We only ever want to run this in CI.") } diff --git a/hugolib/gitinfo_github_test.go b/hugolib/gitinfo_github_test.go index c8a1c3c..956ec7d 100644 --- a/hugolib/gitinfo_github_test.go +++ b/hugolib/gitinfo_github_test.go @@ -15,9 +15,11 @@ package hugolib import ( "testing" + "os" ) func TestGitInfoFromGitModuleWithVersionQuery(t *testing.T) { + t.Skip("This tests needs internet access") t.Parallel() files := ` @@ -65,6 +67,7 @@ List: {{ .Title }} } func TestGitInfoFromGitModuleWithGoMod(t *testing.T) { + t.Skip("This tests needs internet access") t.Parallel() files := ` @@ -98,6 +101,9 @@ module hugotest // See issue 14942. func TestGitInfoFromGitModuleWithGoModInSubdir(t *testing.T) { + if os.Getenv("AUTOPKGTEST_TMP") == "" { + t.Skip("Skip test as network is inaccessible during Debian package build") + } t.Parallel() files := ` diff --git a/hugolib/hugo_modules_test.go b/hugolib/hugo_modules_test.go index cc05aa1..7e5faa7 100644 --- a/hugolib/hugo_modules_test.go +++ b/hugolib/hugo_modules_test.go @@ -271,6 +271,7 @@ Home: {{ .Title }}|{{ .Content }}| // https://github.com/gohugoio/hugo/issues/14543 func TestModulePrivateRepo(t *testing.T) { + t.Skip("This tests needs internet access") t.Parallel() files := ` diff --git a/hugolib/rebuild_test.go b/hugolib/rebuild_test.go index 4a97c8f..f780a8d 100644 --- a/hugolib/rebuild_test.go +++ b/hugolib/rebuild_test.go @@ -2,6 +2,7 @@ package hugolib import ( "fmt" + "os" "path/filepath" "strings" "testing" @@ -1543,6 +1544,9 @@ foo(); } func TestRebuildVariationsAssetsPostCSSImport(t *testing.T) { + if os.Getenv("AUTOPKGTEST_TMP") == "" { + t.Skip("Skip test as network is inaccessible during Debian package build") + } if !htesting.IsCI() { t.Skip("skip CI only") } diff --git a/internal/js/esbuild/batch_integration_test.go b/internal/js/esbuild/batch_integration_test.go index ca85cb4..b2443df 100644 --- a/internal/js/esbuild/batch_integration_test.go +++ b/internal/js/esbuild/batch_integration_test.go @@ -448,6 +448,7 @@ func TestBatchErrorScriptResourceInBundleSyntaxError(t *testing.T) { } func TestBatch(t *testing.T) { + t.Skip("This tests needs npm with internet access") htesting.SkipSlowTestUnlessCI(t) files := ` -- hugo.toml -- diff --git a/modules/client_test.go b/modules/client_test.go index 188646c..876ba51 100644 --- a/modules/client_test.go +++ b/modules/client_test.go @@ -34,6 +34,9 @@ import ( ) func TestClient(t *testing.T) { + if os.Getenv("AUTOPKGTEST_TMP") == "" { + t.Skip("skip test as network access is not allowed during Debian package build") + } htesting.SkipSlowTestUnlessCI(t) modName := "hugo-modules-basic-test" modPath := "github.com/gohugoio/tests/" + modName diff --git a/modules/modules_integration_test.go b/modules/modules_integration_test.go index d3cfc44..a9f6a7b 100644 --- a/modules/modules_integration_test.go +++ b/modules/modules_integration_test.go @@ -20,6 +20,7 @@ import ( ) func TestModuleImportWithVersion(t *testing.T) { + t.Skip("This tests needs internet access") t.Parallel() files := ` diff --git a/resources/resource_factories/create/create_integration_test.go b/resources/resource_factories/create/create_integration_test.go index 783161b..92113d6 100644 --- a/resources/resource_factories/create/create_integration_test.go +++ b/resources/resource_factories/create/create_integration_test.go @@ -18,6 +18,7 @@ import ( "math/rand" "net/http" "net/http/httptest" + "os" "strings" "sync" "testing" @@ -29,6 +30,9 @@ import ( ) func TestGetRemoteHead(t *testing.T) { + if os.Getenv("AUTOPKGTEST_TMP") == "" { + t.Skip("Skip test as network is inaccessible during Debian package build") + } files := ` -- hugo.toml -- [security] @@ -58,6 +62,7 @@ func TestGetRemoteHead(t *testing.T) { } func TestGetRemoteResponseHeaders(t *testing.T) { + t.Skip("This tests needs internet access") files := ` -- hugo.toml -- [security] @@ -86,6 +91,7 @@ func TestGetRemoteResponseHeaders(t *testing.T) { } func TestGetRemoteRetry(t *testing.T) { + t.Skip("This tests needs internet access") t.Parallel() htesting.SkipSlowTestUnlessCI(t) diff --git a/resources/resource_transformers/babel/babel_integration_test.go b/resources/resource_transformers/babel/babel_integration_test.go index a95185f..37037bc 100644 --- a/resources/resource_transformers/babel/babel_integration_test.go +++ b/resources/resource_transformers/babel/babel_integration_test.go @@ -26,6 +26,9 @@ import ( ) func TestTransformBabel(t *testing.T) { + if os.Getenv("AUTOPKGTEST_TMP") == "" { + t.Skip("Skip test as network is inaccessible during Debian package build") + } if !htesting.IsCI() { t.Skip("Skip long running test when running locally") } @@ -92,6 +95,8 @@ Transpiled3: {{ $transpiled.Permalink }} // See Issue 15043. // See Issue 15040. func TestTransformBabelConfigResolution(t *testing.T) { + t.Skip("This tests needs internet access") + if !htesting.IsCI() { t.Skip("Skip long running test when running locally") } diff --git a/resources/resource_transformers/cssjs/postcss_integration_test.go b/resources/resource_transformers/cssjs/postcss_integration_test.go index f3f95e7..d9a9ea7 100644 --- a/resources/resource_transformers/cssjs/postcss_integration_test.go +++ b/resources/resource_transformers/cssjs/postcss_integration_test.go @@ -100,6 +100,9 @@ module.exports = { ` func TestTransformPostCSS(t *testing.T) { + if os.Getenv("AUTOPKGTEST_TMP") == "" { + t.Skip("Skip test as network is inaccessible during Debian package build") + } if !htesting.IsCI() { t.Skip("Skip long running test when running locally") } @@ -138,6 +141,9 @@ Styles Content: Len: 770917| // 9880 func TestTransformPostCSSError(t *testing.T) { + if os.Getenv("AUTOPKGTEST_TMP") == "" { + t.Skip("Skip test as network is inaccessible during Debian package build") + } if !htesting.IsCI() { t.Skip("Skip long running test when running locally") } @@ -158,6 +164,9 @@ func TestTransformPostCSSError(t *testing.T) { // #9895 func TestTransformPostCSSImportError(t *testing.T) { + if os.Getenv("AUTOPKGTEST_TMP") == "" { + t.Skip("Skip test as network is inaccessible during Debian package build") + } if !htesting.IsCI() { t.Skip("Skip long running test when running locally") } @@ -172,6 +181,9 @@ func TestTransformPostCSSImportError(t *testing.T) { } func TestTransformPostCSSImporSkipInlineImportsNotFound(t *testing.T) { + if os.Getenv("AUTOPKGTEST_TMP") == "" { + t.Skip("Skip test as network is inaccessible during Debian package build") + } if !htesting.IsCI() { t.Skip("Skip long running test when running locally") } @@ -188,6 +200,9 @@ func TestTransformPostCSSImporSkipInlineImportsNotFound(t *testing.T) { // Issue 9787 func TestTransformPostCSSResourceCacheWithPathInBaseURL(t *testing.T) { + if os.Getenv("AUTOPKGTEST_TMP") == "" { + t.Skip("Skip test as network is inaccessible during Debian package build") + } if !htesting.IsCI() { t.Skip("Skip long running test when running locally") } @@ -219,6 +234,8 @@ Styles Content: Len: 770917 // See Issue 15039. // See Issue 15040. func TestTransformPostCSSConfigResolution(t *testing.T) { + t.Skip("This tests needs internet access") + if !htesting.IsCI() { t.Skip("Skip long running test when running locally") } @@ -309,6 +326,9 @@ CONFIG_FILE_CONTENT // See Issue 13987. func TestTransformPostCSSESMConfigInModule(t *testing.T) { + if os.Getenv("AUTOPKGTEST_TMP") == "" { + t.Skip("Skip test as network is inaccessible during Debian package build") + } if !htesting.IsCI() { t.Skip("Skip long running test when running locally") } @@ -387,6 +407,8 @@ export default { plugins: [postcssImport()] }; // // See issue 15041. func TestTransformPostCSSESMConfigAccessDenied(t *testing.T) { + t.Skip("This tests needs internet access") + if !htesting.IsCI() { t.Skip("Skip long running test when running locally") } @@ -460,6 +482,7 @@ export default { plugins: [postcssImport()] }; // Node's permission model follows symlinks outside the allowed paths, so Hugo // rejects them before invoking Node. func TestTransformPostCSSSymlinkOutsideAllowRead(t *testing.T) { + t.Skip("This tests needs internet access") if !htesting.IsCI() { t.Skip("Skip long running test when running locally") } diff --git a/resources/resource_transformers/cssjs/tailwindcss_integration_test.go b/resources/resource_transformers/cssjs/tailwindcss_integration_test.go index 702bc2f..dc0dddc 100644 --- a/resources/resource_transformers/cssjs/tailwindcss_integration_test.go +++ b/resources/resource_transformers/cssjs/tailwindcss_integration_test.go @@ -14,6 +14,10 @@ package cssjs_test import ( + "os" + "os/exec" + "runtime" + "strings" "testing" qt "github.com/frankban/quicktest" @@ -22,6 +26,23 @@ import ( ) func TestTailwindV4Basic(t *testing.T) { + if os.Getenv("AUTOPKGTEST_TMP") == "" { + t.Skip("Skip test as network is inaccessible during Debian package build") + } + if !(runtime.GOARCH == "amd64" || runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") { + t.Skipf("Skip test: prebuild of @parcel/watcher is available only for x64 (amd64), arm and arm64; see https://www.npmjs.com/search?q=%%40parcel%%2Fwatcher-linux") + } + if runtime.GOARCH == "arm" { + cmd := exec.Command("/usr/bin/go", "env", "GOARM") + out, err := cmd.Output() + if err != nil { + t.Skipf("Skip test: failed to check GOARM: %v: %v", cmd, err) + } + goarm := strings.TrimSpace(string(out)) + if goarm == "5,softfloat" { + t.Skipf("Skip test: prebuild of @parcel/watcher is available for armhf but not for armel (GOARM=%v); see https://www.npmjs.com/search?q=%%40parcel%%2Fwatcher-linux", goarm) + } + } if !htesting.IsCI() { t.Skip("Skip long running test when running locally") } @@ -67,6 +88,8 @@ CSS: {{ $css.Content | safeCSS }}| // See issue 15103. func TestTailwindCSSImportContext(t *testing.T) { + t.Skip("This test needs npm with internet access") + t.Parallel() htesting.SkipSlowTestUnlessCI(t) @@ -107,6 +130,7 @@ CSS: {{ $css.Content | safeCSS }}| } func TestTailwindCSSNoInlineImportsIssue13719(t *testing.T) { + t.Skip("This tests needs internet access") t.Parallel() htesting.SkipSlowTestUnlessCI(t) @@ -168,6 +192,7 @@ target = 'assets/css' // This tests an internal feature used in the Hugo themes sites building to allow us to build with // default security policy and still get a partial build even for themes using TailwindCSS. func TestTailwindCSSIgnoreSecError(t *testing.T) { + t.Skip("This test needs npm with internet access") if !htesting.IsCI() { t.Skip("Skip long running test when running locally") } diff --git a/resources/resource_transformers/js/js_integration_test.go b/resources/resource_transformers/js/js_integration_test.go index d916f48..3b45cf9 100644 --- a/resources/resource_transformers/js/js_integration_test.go +++ b/resources/resource_transformers/js/js_integration_test.go @@ -116,6 +116,9 @@ COUNT2: {{ len .Data.Artifacts }} } func TestBuildWithModAndNpm(t *testing.T) { + if os.Getenv("AUTOPKGTEST_TMP") == "" { + t.Skip("Skip test as network is inaccessible during Debian package build") + } if !htesting.IsCI() { t.Skip("skip (relative) long running modules test when running locally") } @@ -166,6 +169,9 @@ module.exports = window.ReactDOM; } func TestBuildWithNpm(t *testing.T) { + if os.Getenv("AUTOPKGTEST_TMP") == "" { + t.Skip("Skip test as network is inaccessible during Debian package build") + } if !htesting.IsCI() { t.Skip("skip (relative) long running modules test when running locally") } diff --git a/testscripts/commands/hugo__static_issue14507.txt b/testscripts/commands/hugo__static_issue14507.txt deleted file mode 100644 index 429b9b9..0000000 --- a/testscripts/commands/hugo__static_issue14507.txt +++ /dev/null @@ -1,27 +0,0 @@ -hugo - -# Verify published files are writable. -[!windows] exec sh -c 'test -w public/a.txt' -[!windows] exec sh -c 'test -w public/sitemap.xml' - -[windows] exec cmd /c attrib public\a.txt -[windows] ! stdout 'R.*public' -[windows] exec cmd /c attrib public\sitemap.xml -[windows] ! stdout 'R.*public' - --- hugo.toml -- -baseURL = 'https://example.org/' -disableKinds = ['page','rss','section','sitemap','taxonomy','term'] - -[[module.imports]] -path = 'github.com/gohugoio/hugoTestModule2' --- content/_index.md -- ---- -title: home ---- --- layouts/all.html -- -{{ .Title }} --- go.mod -- -module github.com/gohugoio/tests/testIssue14507 - -go 1.23 diff --git a/testscripts/commands/mod.txt b/testscripts/commands/mod.txt deleted file mode 100644 index ee0a9ad..0000000 --- a/testscripts/commands/mod.txt +++ /dev/null @@ -1,45 +0,0 @@ -# Test the hugo mod commands. - -hugo mod graph -stdout 'empty-hugo' -hugo mod verify -! stderr . -hugo mod get -u -! stderr . -hugo mod get -u ./... -! stderr . -hugo mod vendor -! stderr . -cmp _vendor/modules.txt golden/vendor.txt -hugo mod clean -! stderr . -stdout 'hugo: removed 1 dirs in module cache for \"github.com/bep/empty-hugo-module\"' -hugo mod clean --all -stdout 'Deleted (2|3)\d{2} directories from module cache\.' -cd submod -hugo mod init testsubmod -cmpenv go.mod $WORK/golden/go.mod.testsubmod -hugo mod get -h -stdout 'hugo mod get \[flags\] \[args\]' -hugo mod get --help -stdout 'hugo mod get \[flags\] \[args\]' --- hugo.toml -- -title = "Hugo Modules Test" -[module] -[[module.imports]] -path="github.com/bep/empty-hugo-module" -[[module.imports.mounts]] -source="README.md" -target="content/_index.md" --- go.mod -- -go 1.19 - -module github.com/gohugoio/testmod --- submod/hugo.toml -- -title = "Hugo Sub Module" --- golden/vendor.txt -- -# github.com/bep/empty-hugo-module v1.0.0 --- golden/go.mod.testsubmod -- -module testsubmod - -go ${GOMODVERSION} diff --git a/testscripts/commands/mod__disable.txt b/testscripts/commands/mod__disable.txt deleted file mode 100644 index f2d65dd..0000000 --- a/testscripts/commands/mod__disable.txt +++ /dev/null @@ -1,15 +0,0 @@ -hugo mod graph -stdout 'withhugotoml.*commonmod' - --- hugo.toml -- -title = "Hugo Modules Test" -[module] -[[module.imports]] -path="github.com/gohugoio/hugo-mod-integrationtests/withconfigtoml" -disable = true -[[module.imports]] -path="github.com/gohugoio/hugo-mod-integrationtests/withhugotoml" --- go.mod -- -module foo -go 1.19 - diff --git a/testscripts/commands/mod__hugodirectsum.txt b/testscripts/commands/mod__hugodirectsum.txt deleted file mode 100644 index ce3d3e4..0000000 --- a/testscripts/commands/mod__hugodirectsum.txt +++ /dev/null @@ -1,15 +0,0 @@ -hugo mod graph -stdout 'foo' -grep 'github.com/bep/hugo-mod-nop v1.0.0 h1:NRDMRPCD\+4dw5K8XvaZURvZJCfBMCifkRe6C6x6W4II=' hugo.direct.sum - --- hugo.toml -- -baseURL = "https://example.org" -[[module.imports]] -path = "github.com/bep/hugo-mod-nop" -version = "v1.0.0" --- layouts/all.html -- -All. --- go.mod -- -module foo - -go 1.24.0 \ No newline at end of file diff --git a/testscripts/commands/mod__hugodirectsum_tamper.txt b/testscripts/commands/mod__hugodirectsum_tamper.txt deleted file mode 100644 index e07676d..0000000 --- a/testscripts/commands/mod__hugodirectsum_tamper.txt +++ /dev/null @@ -1,16 +0,0 @@ -! hugo -stderr 'checksum mismatch' - --- hugo.toml -- -baseURL = "https://example.org" -[[module.imports]] -path = "github.com/bep/hugo-mod-nop" -version = "v1.0.0" --- layouts/all.html -- -All. --- go.mod -- -module foo - -go 1.24.0 --- hugo.direct.sum -- -github.com/bep/hugo-mod-nop v1.0.0 h1:NRDMRPCD+4dw5K8XvaZURvZJCfBMCifkRe6C6x6W4Ix= \ No newline at end of file diff --git a/testscripts/commands/mod__tamper_gosum.txt b/testscripts/commands/mod__tamper_gosum.txt deleted file mode 100644 index 8aabba9..0000000 --- a/testscripts/commands/mod__tamper_gosum.txt +++ /dev/null @@ -1,22 +0,0 @@ - -# We're not testing Go's security here, so we just edit the go.sum and verifies that the build fails. - -! hugo -stderr 'checksum mismatch' - - --- hugo.toml -- -baseURL = "https://example.org" -[[module.imports]] -path = "github.com/bep/hugo-mod-nop" --- layouts/all.html -- -All. --- go.mod -- -module foo - -go 1.24.0 - -require github.com/bep/hugo-mod-nop v1.0.0 // indirect --- go.sum -- -github.com/bep/hugo-mod-nop v1.0.0 h1:NRDMRPCD+4dw5K8XvaZURvZJCfBMCifkRe6C6x6W4II= -github.com/bep/hugo-mod-nop v1.0.0/go.mod h1:6cqjOCVJHP6+aQ+5IYvaS9j8BfIVksAct4xzl9OnmIX= \ No newline at end of file diff --git a/testscripts/commands/mod_get.txt b/testscripts/commands/mod_get.txt deleted file mode 100644 index d11d3b8..0000000 --- a/testscripts/commands/mod_get.txt +++ /dev/null @@ -1,15 +0,0 @@ -hugo mod get -stderr 'withhugotoml.*v1.1.0' - --- hugo.toml -- -title = "Hugo Modules Test" -[module] -[[module.imports]] -path="github.com/gohugoio/hugo-mod-integrationtests/withconfigtoml" -disable = true -[[module.imports]] -path="github.com/gohugoio/hugo-mod-integrationtests/withhugotoml" --- go.mod -- -module foo -go 1.20 - diff --git a/testscripts/commands/mod_get_u.txt b/testscripts/commands/mod_get_u.txt deleted file mode 100644 index f3efc0c..0000000 --- a/testscripts/commands/mod_get_u.txt +++ /dev/null @@ -1,22 +0,0 @@ -hugo mod get -u -hugo mod graph -stdout 'commonmod@v1.0.1.*commonmod2@v1.0.2' - --- hugo.toml -- -title = "Hugo Modules Update Test" -theme = ["my-theme"] -[module] -[[module.imports]] -path="github.com/gohugoio/hugo-mod-integrationtests/withconfigtoml" -disable = true -[[module.imports]] -path="github.com/gohugoio/hugo-mod-integrationtests/withhugotoml" --- go.mod -- -module foo -go 1.20 -require ( - github.com/gohugoio/hugo-mod-integrationtests/withhugotoml v1.1.0 // indirect - github.com/gohugoio/hugo-mod-integrationtests/commonmod v0.0.0-20230823103305-919cefe8a425 // indirect -) --- themes/my-theme/dummy.txt -- -MY THEME diff --git a/testscripts/commands/mod_npm.txt b/testscripts/commands/mod_npm.txt deleted file mode 100644 index 136277f..0000000 --- a/testscripts/commands/mod_npm.txt +++ /dev/null @@ -1,219 +0,0 @@ -# Test mod npm pack. - -hugo mod npm pack -cmp packages/hugoautogen/package.json golden1/packages/hugoautogen/package.json -cmp package.json golden1/package.json -cmp packages/hugoautogen/hugo_packagemeta.json golden1/packages/hugoautogen/hugo_packagemeta.json - -# c module commits: -# 324e3adae608ff8b6a52b4630975ffe652859f27: add is-odd -# 40c59ae8595d8ff3f56b87fcf4ba3325649a9a52: replace is-odd with is-even -# 7dd9b2dc7f505508adbb3fdea36c308aad0de3ec: add package.hugo.json with is-number -# bf55e8bb813a7f6cbe6f212bd7e1dd4fb44c79df: update README.md only -# cc5188f671e1852f470df9fed52c7f93d1cab476: Add myworkspace with my-prime (in package.hugo.json) -replace hugo.toml "324e3adae608ff8b6a52b4630975ffe652859f27" "40c59ae8595d8ff3f56b87fcf4ba3325649a9a52" - -hugo mod graph -stderr 'WARN npm dependencies are out of sync' - -hugo mod npm pack -cmp packages/hugoautogen/package.json golden2/packages/hugoautogen/package.json - -replace hugo.toml "40c59ae8595d8ff3f56b87fcf4ba3325649a9a52" "7dd9b2dc7f505508adbb3fdea36c308aad0de3ec" -hugo mod npm pack -cmp packages/hugoautogen/package.json golden3/packages/hugoautogen/package.json - -# This commit only updates README.md, no npm package updates. -replace hugo.toml "7dd9b2dc7f505508adbb3fdea36c308aad0de3ec" "bf55e8bb813a7f6cbe6f212bd7e1dd4fb44c79df" -hugo mod graph -! stderr 'WARN' - -# Add myworkspace with my-prime (in package.hugo.json) -replace hugo.toml "bf55e8bb813a7f6cbe6f212bd7e1dd4fb44c79df" "cc5188f671e1852f470df9fed52c7f93d1cab476" -hugo mod npm pack -cmp packages/hugoautogen/package.json golden4/packages/hugoautogen/package.json - -# usePackageJSON="auto" => usePackageJSON="never" in hugo.toml will effectively disable c's npm deps. -replace hugo.toml "auto" "never" -hugo mod graph -# dependencies are out of sync -stderr 'WARN' -hugo mod npm pack -cmp packages/hugoautogen/package.json golden5/packages/hugoautogen/package.json -# Turn it back on using "always" -replace hugo.toml "never" "always" -hugo mod graph -stderr 'WARN' -hugo mod npm pack -hugo mod graph -! stderr 'WARN' -cmp packages/hugoautogen/package.json golden4/packages/hugoautogen/package.json - -# Now test vendoring.. -hugo mod vendor -# a ab c@cc5188f671e1852f470df9fed52c7f93d1cab476 d -ls _vendor/github.com/gohugoio/hugoTestModsNPMNested/a -stdout 'package.json' -ls _vendor/github.com/gohugoio/hugoTestModsNPMNested/a/packages/aws1 -stdout 'package.json' - -ls _vendor/github.com/gohugoio/hugoTestModsNPMNested/c@cc5188f671e1852f470df9fed52c7f93d1cab476 -stdout 'package.hugo.json' -# package.json is not needed when package.hugo.json exists. -! stdout 'package.json' -! exists _vendor/github.com/gohugoio/hugoTestModsNPMNested/ab/packages/hugoautogen - --- hugo.toml -- -baseURL = "https://example.org/" -[module] -[[module.imports]] -path="github.com/gohugoio/hugoTestModsNPMNested/a" -[[module.imports]] -path="github.com/gohugoio/hugoTestModsNPMNested/c" -version="324e3adae608ff8b6a52b4630975ffe652859f27" -usePackageJSON="auto" --- package.json -- -{ - "workspaces": [ - "packages/hugoautogen" - ], - "name": "npmpack", - "version": "1.0.0", - "dependencies": { - "dedupe": "4.0.3" - } -} --- golden1/packages/hugoautogen/hugo_packagemeta.json -- -{ - "sum": "259f33c1d93dcc01", - "dependencySources": { - "dependencies": { - "count-days-in-month": "github.com/gohugoio/hugoTestModsNPMNested/a", - "fast-cartesian": "github.com/gohugoio/hugoTestModsNPMNested/a", - "is-odd": "github.com/gohugoio/hugoTestModsNPMNested/c", - "is-sorted": "github.com/gohugoio/hugoTestModsNPMNested/a", - "once": "github.com/gohugoio/hugoTestModsNPMNested/d", - "pluralize": "github.com/gohugoio/hugoTestModsNPMNested/ab", - "to-space-case": "github.com/gohugoio/hugoTestModsNPMNested/a" - }, - "devDependencies": { - "decamelize": "github.com/gohugoio/hugoTestModsNPMNested/a", - "strip-ansi": "github.com/gohugoio/hugoTestModsNPMNested/a", - "to-pascal-case": "github.com/gohugoio/hugoTestModsNPMNested/a" - } - } -} --- golden1/packages/hugoautogen/package.json -- -{ - "dependencies": { - "count-days-in-month": "^1.0.0", - "fast-cartesian": "9.0.0", - "is-odd": "3.0.0", - "is-sorted": "1.0.4", - "once": "1.4.0", - "pluralize": "8.0.0", - "to-space-case": "0.1.3" - }, - "devDependencies": { - "decamelize": "6.0.0", - "strip-ansi": "7.2.0", - "to-pascal-case": "1.0.0" - }, - "name": "hugoautogen", - "private": true, - "version": "0.1.0" -} --- golden1/package.json -- -{ - "workspaces": [ - "packages/hugoautogen" - ], - "name": "npmpack", - "version": "1.0.0", - "dependencies": { - "dedupe": "4.0.3" - } -} --- golden2/packages/hugoautogen/package.json -- -{ - "dependencies": { - "count-days-in-month": "^1.0.0", - "fast-cartesian": "9.0.0", - "is-even": "1.0.0", - "is-sorted": "1.0.4", - "once": "1.4.0", - "pluralize": "8.0.0", - "to-space-case": "0.1.3" - }, - "devDependencies": { - "decamelize": "6.0.0", - "strip-ansi": "7.2.0", - "to-pascal-case": "1.0.0" - }, - "name": "hugoautogen", - "private": true, - "version": "0.1.0" -} --- golden3/packages/hugoautogen/package.json -- -{ - "dependencies": { - "count-days-in-month": "^1.0.0", - "fast-cartesian": "9.0.0", - "is-number": "7.0.0", - "is-sorted": "1.0.4", - "once": "1.4.0", - "pluralize": "8.0.0", - "to-space-case": "0.1.3" - }, - "devDependencies": { - "decamelize": "6.0.0", - "strip-ansi": "7.2.0", - "to-pascal-case": "1.0.0" - }, - "name": "hugoautogen", - "private": true, - "version": "0.1.0" -} --- golden4/packages/hugoautogen/package.json -- -{ - "dependencies": { - "count-days-in-month": "^1.0.0", - "fast-cartesian": "9.0.0", - "is-number": "7.0.0", - "is-sorted": "1.0.4", - "my-prime": "^1.0.1", - "once": "1.4.0", - "pluralize": "8.0.0", - "to-space-case": "0.1.3" - }, - "devDependencies": { - "decamelize": "6.0.0", - "strip-ansi": "7.2.0", - "to-pascal-case": "1.0.0" - }, - "name": "hugoautogen", - "private": true, - "version": "0.1.0" -} --- golden5/packages/hugoautogen/package.json -- -{ - "dependencies": { - "count-days-in-month": "^1.0.0", - "fast-cartesian": "9.0.0", - "is-sorted": "1.0.4", - "once": "1.4.0", - "pluralize": "8.0.0", - "to-space-case": "0.1.3" - }, - "devDependencies": { - "decamelize": "6.0.0", - "strip-ansi": "7.2.0", - "to-pascal-case": "1.0.0" - }, - "name": "hugoautogen", - "private": true, - "version": "0.1.0" -} --- go.mod -- -module github.com/gohugoio/hugoTestModule -go 1.20 diff --git a/testscripts/commands/mod_npm__moduleorder.txt b/testscripts/commands/mod_npm__moduleorder.txt deleted file mode 100644 index 20228e5..0000000 --- a/testscripts/commands/mod_npm__moduleorder.txt +++ /dev/null @@ -1,68 +0,0 @@ -# Test mod npm pack with shuffled modules. - -hugo mod npm pack -cmp packages/hugoautogen/package.json golden1/packages/hugoautogen/package.json -cmp package.json golden1/package.json -cmp packages/hugoautogen/hugo_packagemeta.json golden1/packages/hugoautogen/hugo_packagemeta.json - -hugo mod graph -! stderr 'WARN npm dependencies are out of sync' - --- hugo.toml -- -baseURL = "https://example.org/" -[module] -[[module.imports]] -path="github.com/gohugoio/hugoTestModsNPMNested/d" -[[module.imports]] -path="github.com/gohugoio/hugoTestModsNPMNested/a" - --- go.mod -- -module github.com/gohugoio/hugoTestModule -go 1.20 - --- golden1/package.json -- -{ - "workspaces": [ - "packages/hugoautogen" - ] -} --- golden1/packages/hugoautogen/package.json -- -{ - "dependencies": { - "count-days-in-month": "^1.0.0", - "dedupe": "4.0.1", - "fast-cartesian": "9.0.0", - "is-sorted": "1.0.2", - "once": "1.4.0", - "pluralize": "8.0.0", - "to-space-case": "0.1.3" - }, - "devDependencies": { - "decamelize": "6.0.0", - "strip-ansi": "7.0.0", - "to-pascal-case": "1.0.0" - }, - "name": "hugoautogen", - "private": true, - "version": "0.1.0" -} --- golden1/packages/hugoautogen/hugo_packagemeta.json -- -{ - "sum": "98594123fa88aedf", - "dependencySources": { - "dependencies": { - "count-days-in-month": "github.com/gohugoio/hugoTestModsNPMNested/a", - "dedupe": "github.com/gohugoio/hugoTestModsNPMNested/ab", - "fast-cartesian": "github.com/gohugoio/hugoTestModsNPMNested/a", - "is-sorted": "github.com/gohugoio/hugoTestModsNPMNested/d", - "once": "github.com/gohugoio/hugoTestModsNPMNested/d", - "pluralize": "github.com/gohugoio/hugoTestModsNPMNested/ab", - "to-space-case": "github.com/gohugoio/hugoTestModsNPMNested/a" - }, - "devDependencies": { - "decamelize": "github.com/gohugoio/hugoTestModsNPMNested/a", - "strip-ansi": "github.com/gohugoio/hugoTestModsNPMNested/ab", - "to-pascal-case": "github.com/gohugoio/hugoTestModsNPMNested/a" - } - } -} diff --git a/testscripts/commands/mod_npm_withexisting.txt b/testscripts/commands/mod_npm_withexisting.txt deleted file mode 100644 index aa5a77b..0000000 --- a/testscripts/commands/mod_npm_withexisting.txt +++ /dev/null @@ -1,62 +0,0 @@ -# Test mod npm with existing package.json. - -# See https://github.com/gohugoio/hugo/issues/13465 -[windows] skip - -hugo mod npm pack -cmp packages/hugoautogen/package.json golden/packages/hugoautogen/package.json -cmp package.json golden/package.json -exists packages/hugoautogen/hugo_packagemeta.json - --- hugo.toml -- -baseURL = "https://example.org/" -[module] -[[module.imports]] -path="github.com/gohugoio/hugoTestModule2" --- package.json -- -{ - "comments": { - "foo": { - "a": "b" - } - }, - "devDependencies": { - "tailwindcss": "2.2.0" - }, - "name": "mypackage", - "version": "1.1.0" -} --- golden/packages/hugoautogen/package.json -- -{ - "dependencies": { - "react-dom": "^16.13.1" - }, - "devDependencies": { - "@babel/cli": "7.8.4", - "@babel/core": "7.9.0", - "@babel/preset-env": "7.9.5", - "postcss-cli": "7.1.0" - }, - "name": "hugoautogen", - "private": true, - "version": "0.1.0" -} --- golden/package.json -- -{ - "comments": { - "foo": { - "a": "b" - } - }, - "devDependencies": { - "tailwindcss": "2.2.0" - }, - "name": "mypackage", - "version": "1.1.0", - "workspaces": [ - "packages/hugoautogen" - ] -} --- go.mod -- -module github.com/gohugoio/hugoTestModule -go 1.20 diff --git a/testscripts/commands/mod_vendor.txt b/testscripts/commands/mod_vendor.txt deleted file mode 100644 index 53bb895..0000000 --- a/testscripts/commands/mod_vendor.txt +++ /dev/null @@ -1,29 +0,0 @@ -hugo mod vendor -cmp _vendor/modules.txt golden/vendor.txt -ls _vendor/github.com/gohugoio/hugo-mod-integrationtests/withconfigtoml -stdout 'config.toml' -ls _vendor/github.com/gohugoio/hugo-mod-integrationtests/withhugotoml -stdout 'hugo.toml' - - - --- hugo.toml -- -title = "Hugo Modules Test" -[module] -[[module.imports]] -path="github.com/gohugoio/hugo-mod-integrationtests/withconfigtoml" -[[module.imports]] -path="github.com/gohugoio/hugo-mod-integrationtests/withhugotoml" --- go.mod -- -go 1.19 - -module github.com/gohugoio/testmod - -require ( - github.com/gohugoio/hugo-mod-integrationtests/withconfigtoml v1.0.0 - github.com/gohugoio/hugo-mod-integrationtests/withhugotoml v1.0.0 -) - --- golden/vendor.txt -- -# github.com/gohugoio/hugo-mod-integrationtests/withconfigtoml v1.0.0 -# github.com/gohugoio/hugo-mod-integrationtests/withhugotoml v1.0.0 diff --git a/testscripts/commands/mod_vendor__versions.txt b/testscripts/commands/mod_vendor__versions.txt deleted file mode 100644 index 49070b9..0000000 --- a/testscripts/commands/mod_vendor__versions.txt +++ /dev/null @@ -1,100 +0,0 @@ -hugo mod vendor -cmp _vendor/modules.txt golden/vendor.txt -lsr _vendor -stdout 'github.com/bep/hugo-mod-misc/dummy-content@%3C%3Dv0.1.0/config.toml' -stdout 'github.com/bep/hugo-mod-misc/dummy-content@v0.2.0/config.toml' -stdout 'github.com/bep/hugo-mod-misc/dummy-content@v0.2.0/content/blog/music/all-of-me/index.md' -stdout 'github.com/bep/hugo-mod-misc/dummy-content@v0.2.0/content/blog/music/blue-bossa/index.md' -stdout 'github.com/bep/hugo-mod-misc/dummy-content@%3C%3Dv0.1.0/content/blog/music/all-of-me/index.md' -! stdout 'github.com/bep/hugo-mod-misc/dummy-content@%3C%3Dv0.1.0/content/blog/music/blue-bossa/index.md' # not mounted - -hugo mod graph -stdout 'project github.com/bep/hugo-mod-misc/dummy-content@v0.2.0' -stdout 'project github.com/bep/hugo-mod-misc/dummy-content@v0.1.0' - -hugo config mounts -[unix] cmpenv stdout golden/mounts.json - --- hugo.toml -- -baseURL = "https://example.org" -[[module.imports]] -path = "github.com/bep/hugo-mod-misc/dummy-content" -version = "v0.2.0" -[[module.imports]] -path = "github.com/bep/hugo-mod-misc/dummy-content" -version = "<=v0.1.0" -[[module.imports.mounts]] -source = "content/blog/music/all-of-me" -target = "content/all" --- layouts/all.html -- -Title: {{ .Title }}|Summary: {{ .Summary }}| -Deps: {{ range hugo.Deps}}{{ printf "%s@%s" .Path .Version }}|{{ end }}$ - - --- golden/vendor.txt -- -# github.com/bep/hugo-mod-misc/dummy-content@v0.2.0 v0.2.0 -# github.com/bep/hugo-mod-misc/dummy-content@%3C%3Dv0.1.0 v0.1.0 --- golden/mounts.json -- -{ - "path": "project", - "version": "", - "time": "0001-01-01T00:00:00Z", - "owner": "", - "dir": "$WORK", - "mounts": [ - { - "source": "content", - "target": "content" - }, - { - "source": "data", - "target": "data" - }, - { - "source": "layouts", - "target": "layouts" - }, - { - "source": "i18n", - "target": "i18n" - }, - { - "source": "archetypes", - "target": "archetypes" - }, - { - "source": "assets", - "target": "assets" - }, - { - "source": "static", - "target": "static" - } - ] -} -{ - "path": "github.com/bep/hugo-mod-misc/dummy-content", - "version": "v0.2.0", - "time": "0001-01-01T00:00:00Z", - "owner": "project", - "dir": "$WORK/_vendor/github.com/bep/hugo-mod-misc/dummy-content@v0.2.0/", - "mounts": [ - { - "source": "content", - "target": "content" - } - ] -} -{ - "path": "github.com/bep/hugo-mod-misc/dummy-content", - "version": "v0.1.0", - "time": "0001-01-01T00:00:00Z", - "owner": "project", - "dir": "$WORK/_vendor/github.com/bep/hugo-mod-misc/dummy-content@%3C%3Dv0.1.0/", - "mounts": [ - { - "source": "content/blog/music/all-of-me", - "target": "content/all" - } - ] -} diff --git a/tpl/css/build_integration_test.go b/tpl/css/build_integration_test.go index e72a1bb..9ffeac5 100644 --- a/tpl/css/build_integration_test.go +++ b/tpl/css/build_integration_test.go @@ -607,6 +607,7 @@ SVG file. } func TestCSSBuildBootstrapFromNPM(t *testing.T) { + t.Skip("This tests needs internet access") htesting.SkipSlowTestUnlessCI(t) t.Parallel() diff --git a/tpl/tplimpl/shortcodes_integration_test.go b/tpl/tplimpl/shortcodes_integration_test.go index 4e7d19b..b04949f 100644 --- a/tpl/tplimpl/shortcodes_integration_test.go +++ b/tpl/tplimpl/shortcodes_integration_test.go @@ -441,6 +441,7 @@ title: p1 (de) } func TestVimeoShortcode(t *testing.T) { + t.Skip("This tests needs internet access") t.Parallel() files := ` @@ -485,6 +486,7 @@ Content: {{ .Content }} } func TestXShortcodes(t *testing.T) { + t.Skip("This tests needs internet access") t.Parallel() htesting.SkipSlowTestUnlessCI(t)