goconvey icon indicating copy to clipboard operation
goconvey copied to clipboard

fails on ubuntu 16.04 when go is installed with snap package manager

Open peterrosell opened this issue 7 years ago • 5 comments

I have been running goconvey at home for a while and it works great. Now I tried it on my work laptop and I don't get any tests to run. I see this in the logs:

Potential error parsing output of gitlab.pagero.local/infra/gocd-cleaner/cmd/client ; couldn't handle this stray line: go test runtime/cgo: open /snap/go/2130/pkg/linux_amd64/runtime/cgo.a: read-only file system

I notice the difference that I have installed golang, version 1.10.3, at work with ubuntu's snap package manager, but at home I have used apt-get and the package from ppa:gophers, version 1.10.0.

I think the problem is how and where go is installed and not the version. I haven't found a newer version to install via the ppa:gophers.

Workaround I uninstalled the snap package for go and installed it with the ppa:gophers and now it works.

peterrosell avatar Jun 14 '18 06:06 peterrosell

I installed go from the official tarball and I also have this issue. Any updates?

VMitov avatar Sep 24 '18 11:09 VMitov

Any updates? I just run into the same problem under mac osx with go1.14.3.

timestee avatar Jun 12 '20 12:06 timestee

I have the exact some issue on Mac. I installed using the official Mac package installer.

% go version
go version go1.14.4 darwin/amd64

% $GOPATH/bin/goconvey
2020/07/18 11:20:21 goconvey.go:61: Initial configuration: [host: 127.0.0.1] [port: 8080] [poll: 250ms] [cover: true]
2020/07/18 11:20:21 goconvey.go:232: Could not find or create the coverage report directory (at: '/Users/chappio/go/pkg/mod/github.com/smartystreets/[email protected]/web/client/reports'). You probably won't see any coverage statistics...
2020/07/18 11:20:21 tester.go:19: Now configured to test 10 packages concurrently.
2020/07/18 11:20:21 goconvey.go:178: Serving HTTP at: http://127.0.0.1:8080
2020/07/18 11:20:21 goconvey.go:105: Launching browser on 127.0.0.1:8080
2020/07/18 11:20:21 integration.go:122: File system state modified, publishing current folders... 0 3190128630
2020/07/18 11:20:21 goconvey.go:118: Received request from watcher to execute tests...
2020/07/18 11:20:21 goconvey.go:113: 
2020/07/18 11:20:21 executor.go:69: Executor status: 'executing'
2020/07/18 11:20:21 coordinator.go:46: Executing concurrent tests: superscreenpi-run-webapp/cmd/sspi-webapp
Potential error parsing output of superscreenpi-run-webapp/cmd/sspi-webapp ; couldn't handle this stray line: go test runtime/cgo: copying /Users/chappio/Library/Caches/go-build/c9/c98ec99950f6a719f87ae12ba24830893366a8e8b6fde1fe2e8cf8721f80e922-d: open /usr/local/go/pkg/darwin_amd64/runtime/cgo.a: permission denied
2020/07/18 11:20:22 parser.go:24: []: superscreenpi-run-webapp/cmd/sspi-webapp
2020/07/18 11:20:22 executor.go:69: Executor status: 'idle'

ChappIO avatar Jul 18 '20 09:07 ChappIO

My test case:

  1. Install go using the Mac package installer
  2. Create a go module: go mod init testcase
  3. Create main.go:
    package main
    
    import ( 
       	_ "golang.org/x/net/websocket" // this import seems to trigger the use of runtime/cgo
    )    
    
    func Test() int {
       return 4
    }
    
  4. Create main_test.go:
    package main
    
    import (
      "github.com/smartystreets/goconvey/convey"
      "testing"
    )
    
    func TestTest(t *testing.T) {
      convey.Convey("The test works", t, func() {
        convey.So(Test(), convey.ShouldEqual, 4)
      })
    }
    
  5. Run go test -v -cover
    === RUN   TestTest
    
      The test works ✔
    
    
    1 total assertion
    
    --- PASS: TestTest (0.00s)
    PASS
    coverage: 100.0% of statements
    ok  	testcase	0.005s
    
  6. Run ~/go/bin/goconvey:
    2020/07/18 11:34:14 goconvey.go:61: Initial configuration: [host: 127.0.0.1] [port: 8080] [poll: 250ms] [cover: true]
    2020/07/18 11:34:14 goconvey.go:232: Could not find or create the coverage report directory (at: '/Users/chappio/go/pkg/mod/github.com/smartystreets/[email protected]/web/client/reports'). You probably won't see any coverage statistics...
    2020/07/18 11:34:14 tester.go:19: Now configured to test 10 packages concurrently.
    2020/07/18 11:34:14 goconvey.go:178: Serving HTTP at: http://127.0.0.1:8080
    2020/07/18 11:34:14 goconvey.go:105: Launching browser on 127.0.0.1:8080
    2020/07/18 11:34:14 integration.go:122: File system state modified, publishing current folders... 0 3190129516
    2020/07/18 11:34:14 goconvey.go:118: Received request from watcher to execute tests...
    2020/07/18 11:34:14 goconvey.go:113: 
    2020/07/18 11:34:14 executor.go:69: Executor status: 'executing'
    2020/07/18 11:34:14 coordinator.go:46: Executing concurrent tests: testcase
    Potential error parsing output of testcase ; couldn't handle this stray line: go test runtime/cgo: copying /Users/chappio/Library/Caches/go-build/c9/c98ec99950f6a719f87ae12ba24830893366a8e8b6fde1fe2e8cf8721f80e922-d: open /usr/local/go/pkg/darwin_amd64/runtime/cgo.a: permission denied
    2020/07/18 11:34:14 parser.go:24: []: testcase
    2020/07/18 11:34:14 executor.go:69: Executor status: 'idle'
    

ChappIO avatar Jul 18 '20 09:07 ChappIO

My workaround is to NOT install go locally but allow goland to download the go sdk to my home folder.

ChappIO avatar Jul 18 '20 09:07 ChappIO