Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New running "go test ./..." failed error when building 0.38-DEV #4538

Closed
anthonyfok opened this issue Mar 26, 2018 · 9 comments · Fixed by #4575
Closed

New running "go test ./..." failed error when building 0.38-DEV #4538

anthonyfok opened this issue Mar 26, 2018 · 9 comments · Fixed by #4575
Assignees
Labels
Milestone

Comments

@anthonyfok
Copy link
Member

Recent 0.38-DEV failed to build on Canonical's snap autobuild as seen at https://launchpad.net/~gohugoio/+snap/hugo-dev (archived at http://archive.is/ssagJ and http://web.archive.org/web/20180326082235/https://launchpad.net/~gohugoio/+snap/hugo-dev)

hugo (stable) snap 0.37.1 (correctly built and released):

hugo-dev snap 0.38-DEV (failed to build):

Note the Error: running "go test ./..." failed with exit code 1 error.
Somehow, changing the "Distribution series" from Xenial (16.04 LTS) to Artful (17.10) made it "work":

But, judging from the build log, Error: running "go test ./..." failed with exit code 1 is still there with Artful. It is just that, in the newer version, snapcraft silently ignores the go test error instead of crashing?

(Sorry for causing hugo v0.37.1 to stop working when I applied the wrong fix to this problem in "hugo-dev" snap and an frivolously applied the same "fix" to the stable snap, as reported in #4533, #4534 and #4536)

I will try to run snapcraft locally and see if I could reproduce this issue.

@anthonyfok anthonyfok added this to the v0.38 milestone Mar 26, 2018
@anthonyfok anthonyfok self-assigned this Mar 26, 2018
@anthonyfok
Copy link
Member Author

Finally figured out why no go test ./... output or error was shown.
It is because go test was run by mage, which is the "strong, silent type" and hides everything! :-p

Using mage -v in the mage -v vendor test finally tells the whole story!
So, step 1, adding the -v flag to the mage call in snapcraft.yaml in commit 06495f7.

@sergiusens
Copy link

You should keep 16.04 as the build system as core is made out of a 16.04 base. What will happen when using a newer release is that you will have glibc incompatibilities. snapcraft 2.40 in the process of release raises issues (errors) when these incompatibilities arise.

@anthonyfok
Copy link
Member Author

The following is the test result on my laptop.
Looks like /usr/bin/rst2html fails to run with ImportError: No module named docutils.core
But why?

$ snapcraft -d snap
Starting snapcraft 2.39.2 from /snap/snapcraft/1177/lib/python3.6/site-packages/snapcraft/cli.
snapcraft is running as a snap True, SNAP_NAME set to 'snapcraft'
Setting up part 'hugo' with plugin 'go' and properties {'source': '.', 'plugin': 'go', 'go-importpath': 'github.com/gohugoio/hugo', 'build-packages': ['git', 'make'], 'stage-packages': ['git', 'python-pygments'], 'prepare': 'export GOPATH=$(dirname $SNAPCRAFT_PART_INSTALL)/go\nexport PATH=$GOPATH/bin:$PATH\ncd $GOPATH/src/github.com/gohugoio/hugo\ngo get github.com/magefile/mage\nmage -v vendor test\nrm -f $GOPATH/bin/dep\nrm -f $GOPATH/bin/mage\n', 'install': 'strip --remove-section=.comment --remove-section=.note $SNAPCRAFT_PART_INSTALL/bin/hugo\n', 'stage': [], 'prime': []}.
Setting up part 'go' with plugin 'nil' and properties {'build': "cd src && env GOROOT_BOOTSTRAP=$(go env GOROOT | tr -d '\\n') ./make.bash", 'build-packages': ['golang-go', 'g++'], 'install': 'cp -R * $SNAPCRAFT_PART_INSTALL', 'plugin': 'nil', 'prime': ['-*'], 'source': 'https://go.googlesource.com/go', 'source-type': 'git', 'stage': ['bin'], 'source-tag': 'go1.10'}.
Marking 'git' (and its dependencies) to be fetched
Marking 'golang-go' (and its dependencies) to be fetched
Marking 'make' (and its dependencies) to be fetched
Marking 'g++' (and its dependencies) to be fetched
Skipping pull go (already ran)
Skipping build go (already ran)
Skipping stage go (already ran)
Skipping pull hugo (already ran)
Preparing to build hugo 
Unpacking stage-packages to '/home/foka/work/git/hugo/parts/hugo/install'
Building hugo 
Running target: Vendor
exec: go get -u github.com/golang/dep/cmd/dep
exec: dep ensure
Running target: Test
exec: go test ./...
?   	github.com/gohugoio/hugo	[no test files]
ok  	github.com/gohugoio/hugo/bufferpool	0.028s
ok  	github.com/gohugoio/hugo/cache	0.007s
ok  	github.com/gohugoio/hugo/commands	0.076s
ok  	github.com/gohugoio/hugo/common/types	0.020s
?   	github.com/gohugoio/hugo/compare	[no test files]
?   	github.com/gohugoio/hugo/config	[no test files]
ok  	github.com/gohugoio/hugo/create	0.132s
?   	github.com/gohugoio/hugo/deps	[no test files]
?   	github.com/gohugoio/hugo/docshelper	[no test files]
ok  	github.com/gohugoio/hugo/helpers	5.759s
ok  	github.com/gohugoio/hugo/hugofs	0.016s
Source changed "content/sect/doc2.en.md": REMOVE
Source changed "content/new1.en.md": CREATE
Source changed "content/new2.en.md": CREATE
Source changed "content/new1.fr.md": CREATE
Source changed "content/sect/doc1.en.md": WRITE
Source changed "content/new1renamed.en.md": RENAME
Source changed "content/new1.en.md": RENAME
Template changed "layouts/_default/single.html": WRITE
i18n changed "i18n/fr.yaml": WRITE
Template changed "layouts/shortcodes/shortcode.html": WRITE
ERROR 2018/03/26 04:54:13 p0.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:13 p0.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:13 p0.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:13 p0.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:13 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering p0.rst: exit status 1
ERROR 2018/03/26 04:54:13 _index.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:13 _index.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:13 _index.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:13 _index.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:13 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering _index.rst: exit status 1
--- FAIL: TestPageWithMoreTagOnlySummary (2.67s)
	page_test.go:529: page has no summary, can not check truncation
ERROR 2018/03/26 04:54:14 _index.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:14 _index.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:14 _index.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:14 _index.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:14 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering _index.rst: exit status 1
ERROR 2018/03/26 04:54:14 p0.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:14 p0.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:14 p0.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:14 p0.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:14 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering p0.rst: exit status 1
--- FAIL: TestSummaryWithHTMLTagsOnNextLine (0.54s)
        Error Trace:    page_test.go:879
	            	page_test.go:613
	            	page_test.go:883
	Error:      	"" does not contain "Happy new year everyone!"
	Test:       	TestSummaryWithHTMLTagsOnNextLine
--- FAIL: TestPageWithLastmodFromGitInfo (2.21s)
        Error Trace:    page_test.go:938
	Error:      	Not equal: 
	            	expected: "2018-03-11"
	            	actual  : "2018-02-28"
	Test:       	TestPageWithLastmodFromGitInfo
ERROR 2018/03/26 04:54:17 Site config's rssURI is deprecated and will be removed in Hugo 0.39. Set baseName in outputFormats.RSS
Skipping shortname timezone tests.
ERROR 2018/03/26 04:54:18 unable to read frontmatter at filepos 45: EOF
ERROR 2018/03/26 04:54:19 p0.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:19 p0.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:19 p0.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:19 p0.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:19 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering p0.rst: exit status 1
ERROR 2018/03/26 04:54:19 _index.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:19 _index.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:19 _index.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:19 _index.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:19 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering _index.rst: exit status 1
--- FAIL: TestWordCount (1.21s)
	page_test.go:1076: [rst] incorrect word count. expected 483, got 0
ERROR 2018/03/26 04:54:19 _index.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:19 _index.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:19 _index.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:19 _index.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:19 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering _index.rst: exit status 1
ERROR 2018/03/26 04:54:19 p0.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:19 p0.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:19 p0.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:19 p0.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:19 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering p0.rst: exit status 1
--- FAIL: TestWordCountWithIsCJKLanguageFalse (1.20s)
	page_test.go:1058: [rst] incorrect word count for content ''. expected 74, got 0
ERROR 2018/03/26 04:54:19 p0.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:19 p0.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:19 p0.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:19 p0.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:19 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering p0.rst: exit status 1
ERROR 2018/03/26 04:54:19 _index.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:19 _index.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:19 _index.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:19 _index.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:19 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering _index.rst: exit status 1
--- FAIL: TestWordCountWithMainEnglishWithCJKRunes (1.36s)
	page_test.go:1037: [rst] incorrect word count for content ''. expected 74, got 0
ERROR 2018/03/26 04:54:20 _index.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:20 _index.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:20 _index.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:20 _index.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:20 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering _index.rst: exit status 1
ERROR 2018/03/26 04:54:20 p0.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:20 p0.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:20 p0.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:20 p0.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:20 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering p0.rst: exit status 1
--- FAIL: TestWordCountWithAllCJKRunesHasCJKLanguage (1.16s)
	page_test.go:1024: [rst] incorrect word count for content ''. expected 15, got 0
ERROR 2018/03/26 04:54:20 _index.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:20 _index.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:20 _index.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:20 _index.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:20 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering _index.rst: exit status 1
ERROR 2018/03/26 04:54:20 p0.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:20 p0.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:20 p0.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:20 p0.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:20 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering p0.rst: exit status 1
--- FAIL: TestWordCountWithAllCJKRunesWithoutHasCJKLanguage (1.28s)
	page_test.go:1010: [rst] incorrect word count for content ''. expected 8, got 0
ERROR 2018/03/26 04:54:20 _index.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:20 _index.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:20 _index.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:20 _index.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:20 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering _index.rst: exit status 1
ERROR 2018/03/26 04:54:20 p0.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:20 p0.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:20 p0.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:20 p0.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:20 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering p0.rst: exit status 1
--- FAIL: TestPageWithMoreTag (1.13s)
	page_test.go:486: Page content is:
		""
		Expected:
		"<div class=\"document\"> <p>Summary Same Line</p><p>Some more text</p></div>" ([])
ERROR 2018/03/26 04:54:21 p0.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:21 p0.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:21 p0.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:21 p0.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:21 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering p0.rst: exit status 1
ERROR 2018/03/26 04:54:21 _index.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:21 _index.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:21 _index.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:21 _index.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:21 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering _index.rst: exit status 1
--- FAIL: TestPageWithEmbeddedScriptTag (1.31s)
        Error Trace:    page_test.go:619
	            	page_test.go:816
	Error:      	"" does not contain "Home Page Content"
	Test:       	TestPageWithEmbeddedScriptTag
ERROR 2018/03/26 04:54:21 p0.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:21 p0.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:21 p0.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:21 p0.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:21 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering p0.rst: exit status 1
ERROR 2018/03/26 04:54:21 _index.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:21 _index.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:21 _index.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:21 _index.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:21 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering _index.rst: exit status 1
--- FAIL: TestPageWithShortCodeInSummary (1.17s)
	page_test.go:486: Page content is:
		""
		Expected:
		"<div class=\"document\"> <p>Summary Next Line. <figure> <img src=\"/not/real\" /> </figure> . More text here.</p><p>Some more text</p></div>" ([])
ERROR 2018/03/26 04:54:22 p0.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:22 p0.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:22 p0.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:22 p0.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:22 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering p0.rst: exit status 1
ERROR 2018/03/26 04:54:22 p2.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:22 p2.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:22 p2.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:22 p2.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:22 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering p2.rst: exit status 1
ERROR 2018/03/26 04:54:22 _index.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:22 _index.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:22 _index.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:22 _index.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:22 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering _index.rst: exit status 1
ERROR 2018/03/26 04:54:22 p3.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:22 p3.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:22 p3.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:22 p3.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:22 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering p3.rst: exit status 1
ERROR 2018/03/26 04:54:22 p1.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:22 p1.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:22 p1.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:22 p1.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:22 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering p1.rst: exit status 1
--- FAIL: TestPageWithDateFields (1.54s)
        Error Trace:    page_test.go:619
	            	page_test.go:768
	Error:      	"" does not contain "Home Page Content"
	Test:       	TestPageWithDateFields
ERROR 2018/03/26 04:54:22 _index.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:22 _index.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:22 _index.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:22 _index.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:22 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering _index.rst: exit status 1
ERROR 2018/03/26 04:54:22 p0.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:22 p0.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:22 p0.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:22 p0.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:22 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering p0.rst: exit status 1
--- FAIL: TestPageWithDelimiter (1.53s)
	page_test.go:486: Page content is:
		""
		Expected:
		"<div class=\"document\"> <p>Summary Next Line</p><p>Some more text</p></div>" (["rst"])
ERROR 2018/03/26 04:54:22 Resources's GetByPrefix is deprecated and will be removed in Hugo 0.39. We have added the more flexible Resources.GetMatch (find one) and Resources.Match (many) to replace the "prefix" methods. 

These matches by a given globbing pattern, e.g. "*.jpg".

Some examples:

* To find all resources by its prefix in the root dir of the bundle: .Match image*
* To find one resource by its prefix in the root dir of the bundle: .GetMatch image*
* To find all JPEG images anywhere in the bundle: .Match **.jpg
ERROR 2018/03/26 04:54:22 Resources's ByPrefix is deprecated and will be removed in Hugo 0.39. We have added the more flexible Resources.GetMatch (find one) and Resources.Match (many) to replace the "prefix" methods. 

These matches by a given globbing pattern, e.g. "*.jpg".

Some examples:

* To find all resources by its prefix in the root dir of the bundle: .Match image*
* To find one resource by its prefix in the root dir of the bundle: .GetMatch image*
* To find all JPEG images anywhere in the bundle: .Match **.jpg
ERROR 2018/03/26 04:54:22 p0.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:22 p0.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:22 p0.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:22 p0.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:22 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering p0.rst: exit status 1
ERROR 2018/03/26 04:54:22 _index.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:22 _index.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:22 _index.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:22 _index.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:22 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering _index.rst: exit status 1
--- FAIL: TestCreateNewPage (1.59s)
	page_test.go:486: Page content is:
		""
		Expected:
		"<div class=\"document\"> <p>Simple Page</p></div>" ([])
ERROR 2018/03/26 04:54:24 failed to parse page metadata for "invalid0.md": yaml: line 1: mapping values are not allowed in this context
ERROR 2018/03/26 04:54:24 failed to parse page metadata for "invalid10.md": yaml: line 1: mapping values are not allowed in this context
ERROR 2018/03/26 04:54:24 failed to parse page metadata for "invalid15.md": yaml: line 1: mapping values are not allowed in this context
ERROR 2018/03/26 04:54:24 failed to parse page metadata for "invalid20.md": yaml: line 1: mapping values are not allowed in this context
ERROR 2018/03/26 04:54:24 failed to parse page metadata for "invalid25.md": yaml: line 1: mapping values are not allowed in this context
ERROR 2018/03/26 04:54:24 failed to parse page metadata for "invalid30.md": yaml: line 1: mapping values are not allowed in this context
ERROR 2018/03/26 04:54:26 page post/broken.md has both draft and published settings in its frontmatter. Using draft.
ERROR 2018/03/26 04:54:26 both draft and published parameters were found in page's frontmatter
ERROR 2018/03/26 04:54:28 missing : template: missing:1: function "funcdoesnotexists" not defined
ERROR 2018/03/26 04:54:28 init : template: missing:1: function "funcdoesnotexists" not defined
ERROR 2018/03/26 04:54:28 Unable to locate template for shortcode "thisDoesNotExist" in page "sect/notfound.md"
ERROR 2018/03/26 04:54:28 sect/doc8.rst: Traceback (most recent call last):
ERROR 2018/03/26 04:54:28 sect/doc8.rst: File "/usr/bin/rst2html", line 17, in <module>
ERROR 2018/03/26 04:54:28 sect/doc8.rst: from docutils.core import publish_cmdline, default_description
ERROR 2018/03/26 04:54:28 sect/doc8.rst: ImportError: No module named docutils.core
ERROR 2018/03/26 04:54:28 /home/foka/work/git/hugo/parts/hugo/install/usr/bin/python rendering sect/doc8.rst: exit status 1
Skip Pygments test case as no pygments present.
Skip Pygments test case as no pygments present.
Skip Pygments test case as no pygments present.
Skip Pygments test case as no pygments present.
ERROR 2018/03/26 04:54:29 No shortcode param at .Get 1 in page simple.md, have params: [47238zzb]
FAIL
FAIL	github.com/gohugoio/hugo/hugolib	19.920s
ok  	github.com/gohugoio/hugo/hugolib/pagemeta	0.023s
ok  	github.com/gohugoio/hugo/i18n	0.308s
?   	github.com/gohugoio/hugo/livereload	[no test files]
ok  	github.com/gohugoio/hugo/media	0.006s
ok  	github.com/gohugoio/hugo/metrics	0.006s
ok  	github.com/gohugoio/hugo/output	0.041s
ok  	github.com/gohugoio/hugo/parser	0.051s
ok  	github.com/gohugoio/hugo/related	0.028s
ok  	github.com/gohugoio/hugo/releaser	0.165s
ok  	github.com/gohugoio/hugo/resource	5.887s
ok  	github.com/gohugoio/hugo/source	0.108s
?   	github.com/gohugoio/hugo/tpl	[no test files]
ok  	github.com/gohugoio/hugo/tpl/cast	0.044s
ok  	github.com/gohugoio/hugo/tpl/collections	0.046s
ok  	github.com/gohugoio/hugo/tpl/compare	0.057s
ok  	github.com/gohugoio/hugo/tpl/crypto	0.094s
ok  	github.com/gohugoio/hugo/tpl/data	8.050s
ok  	github.com/gohugoio/hugo/tpl/encoding	0.034s
ok  	github.com/gohugoio/hugo/tpl/fmt	0.029s
ok  	github.com/gohugoio/hugo/tpl/images	0.140s
ok  	github.com/gohugoio/hugo/tpl/inflect	0.024s
ok  	github.com/gohugoio/hugo/tpl/internal	0.022s
ok  	github.com/gohugoio/hugo/tpl/lang	0.051s
ok  	github.com/gohugoio/hugo/tpl/math	0.036s
ok  	github.com/gohugoio/hugo/tpl/os	0.036s
ok  	github.com/gohugoio/hugo/tpl/partials	0.027s
ok  	github.com/gohugoio/hugo/tpl/safe	0.023s
ok  	github.com/gohugoio/hugo/tpl/strings	0.067s
ok  	github.com/gohugoio/hugo/tpl/time	0.026s
ok  	github.com/gohugoio/hugo/tpl/tplimpl	1.777s
ok  	github.com/gohugoio/hugo/tpl/transform	0.033s
ok  	github.com/gohugoio/hugo/tpl/urls	0.065s
ok  	github.com/gohugoio/hugo/transform	0.031s
?   	github.com/gohugoio/hugo/utils	[no test files]
?   	github.com/gohugoio/hugo/watcher	[no test files]
Error: running "go test ./..." failed with exit code 1
Traceback (most recent call last):
  File "/snap/snapcraft/1177/bin/snapcraft", line 11, in <module>
    load_entry_point('snapcraft==2.39.2', 'console_scripts', 'snapcraft')()
  File "/snap/snapcraft/1177/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 565, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/snap/snapcraft/1177/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2631, in load_entry_point
    return ep.load()
  File "/snap/snapcraft/1177/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2291, in load
    return self.resolve()
  File "/snap/snapcraft/1177/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2297, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/snap/snapcraft/1177/lib/python3.6/site-packages/snapcraft/cli/__main__.py", line 43, in <module>
    run(prog_name='snapcraft')
  File "/snap/snapcraft/1177/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/snap/snapcraft/1177/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/snap/snapcraft/1177/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/snap/snapcraft/1177/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/snap/snapcraft/1177/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/snap/snapcraft/1177/lib/python3.6/site-packages/snapcraft/cli/lifecycle.py", line 139, in snap
    project_options, directory=directory, output=output)
  File "/snap/snapcraft/1177/lib/python3.6/site-packages/snapcraft/internal/lifecycle/_packer.py", line 46, in snap
    execute('prime', project_options)
  File "/snap/snapcraft/1177/lib/python3.6/site-packages/snapcraft/internal/lifecycle/_runner.py", line 79, in execute
    _Executor(config, project_options).run(step, part_names)
  File "/snap/snapcraft/1177/lib/python3.6/site-packages/snapcraft/internal/lifecycle/_runner.py", line 185, in run
    self._run_step(step, part, part_names)
  File "/snap/snapcraft/1177/lib/python3.6/site-packages/snapcraft/internal/lifecycle/_runner.py", line 222, in _run_step
    getattr(part, step)()
  File "/snap/snapcraft/1177/lib/python3.6/site-packages/snapcraft/internal/pluginhandler/__init__.py", line 360, in build
    script_runner.run(scriptlet=self._part_properties.get('prepare'))
  File "/snap/snapcraft/1177/lib/python3.6/site-packages/snapcraft/internal/pluginhandler/_scriptlets.py", line 43, in run
    run([scriptlet_path], cwd=self._builddir)
  File "/snap/snapcraft/1177/lib/python3.6/site-packages/snapcraft/internal/common.py", line 64, in run
    subprocess.check_call(['/bin/sh', f.name] + cmd, **kwargs)
  File "/snap/snapcraft/1177/usr/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/bin/sh', '/tmp/tmpe6w8m39j', '/tmp/tmpx1z12b_x']' returned non-zero exit status 1.

@bep
Copy link
Member

bep commented Mar 26, 2018

But why?

I had this error myself ... somewhere lately.

It is related to versioning of this:

https://github.com/gohugoio/hugo/blob/master/requirements.txt

More specific, the docutils used for the RST rendering tests. If this is somewhat difficult to get working, we can figure a way to skip these tests on the Snap build or whatever.

@anthonyfok
Copy link
Member Author

anthonyfok commented Mar 26, 2018

Sorry, the RST was a false alarm, as in /usr/bin/rst2html does not exist in the snap build environments at Canonical. According to https://launchpadlibrarian.net/362130797/buildlog_snap_ubuntu_xenial_amd64_hugo-dev_BUILDING.txt.gz, the only FAIL is only this:

--- FAIL: TestPageWithLastmodFromGitInfo (0.80s)
	assertions.go:247: 
	Error Trace:	page_test.go:938
	Error:      	Not equal: 
	            	expected: "2018-03-11"
	            	actual  : "2018-02-28"
	Test:       	TestPageWithLastmodFromGitInfo

@anthonyfok
Copy link
Member Author

Some background information:

But TestPageWithLastmodFromGitInfo runs perfectly fine outside of snap build. I wonder what makes the difference?

@bep
Copy link
Member

bep commented Mar 26, 2018

FAIL: TestPageWithLastmodFromGitInfo (0.80s)

Hard to say, I assume this is due to a Git version issue or something. This is not something I want to spend time debugging, so if you got some kind of environment variable we could check for and disable this test on that builder.

@bep bep modified the milestones: v0.38, v0.39 Apr 2, 2018
@anthonyfok
Copy link
Member Author

Sorry for taking so long to get back to you.

I was able to reproduce "FAIL: TestPageWithLastmodFromGitInfo" running snapcraft -d snap on my own laptop (running Debian GNU/Linux), and finally found the trigger: when $GOPATH/src/github.com/gohugoio/hugo is a symlink, as is the case during a snapcraft build.

For example, in my local snapcraft test run:

  • GOPATH=/home/foka/snapcraft/hugo/parts/hugo/go
  • /home/foka/snapcraft/hugo/parts/hugo/go/src/github.com/gohugoio/hugo is a symlink to /home/foka/snapcraft/hugo/parts/hugo/src
foka@debian ~/snapcraft/hugo/parts/hugo/go/src/github.com/gohugoio/hugo/hugolib (master *=) $ go test -v -run TestPageWithLastmodFromGitInfo
=== RUN   TestPageWithLastmodFromGitInfo
gitRepo.TopLevelAbsPath = /home/foka/snapcraft/hugo/parts/hugo/src
repoPath = /home/foka/snapcraft/hugo/parts/hugo/src
workingDir = /home/foka/snapcraft/hugo/parts/hugo/go/src/github.com/gohugoio/hugo/hugolib/testsite
contentDir = home/foka/snapcraft/hugo/parts/hugo/go/src/github.com/gohugoio/hugo/hugolib/testsite/content
--- FAIL: TestPageWithLastmodFromGitInfo (0.95s)
        Error Trace:    page_test.go:938
	Error:      	Not equal: 
	            	expected: "2018-03-11"
	            	actual  : "2018-02-28"
	Test:       	TestPageWithLastmodFromGitInfo
FAIL
exit status 1
FAIL	github.com/gohugoio/hugo/hugolib	0.993s

Note how contentDir is missing an initial / partly because gitRepo.TopLevelAbsPath, which calls git rev-parse --show-toplevel, dereferences the symlink.

I suspect some end-users, for whatever strange reasons, might want to work within a symlinked directory. I intend to send a PR to github.com/bep/gitmap to use git rev-parse --show-cdup for calculating (?) the TopLevelAbsPath without dereferencing the symlink. Hope that's the right solution!

@github-actions
Copy link

github-actions bot commented Mar 5, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants