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

remove "testing" imports in files that do not end in _test.go #637

Closed
btc opened this issue Jan 24, 2015 · 3 comments
Closed

remove "testing" imports in files that do not end in _test.go #637

btc opened this issue Jan 24, 2015 · 3 comments
Assignees
Labels
help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) kind/test Testing work topic/cleanup Topic cleanup

Comments

@btc
Copy link
Contributor

btc commented Jan 24, 2015

These imports cause testing flags to be parsed in binaries that include go-ipfs/core.

@btc btc added kind/bug A bug in existing code (including security flaws) help wanted Seeking public contribution on this issue labels Jan 24, 2015
@jbenet
Copy link
Member

jbenet commented Jan 24, 2015

% egrep -r '"testing"' . | egrep -v "_test.go"
./blockservice/mock.go: "testing"
./blockservice/worker/bench/main.go:    "testing"
./Godeps/_workspace/src/bazil.org/fuse/fs/fstestutil/mounted.go:    "testing"
./Godeps/_workspace/src/github.com/jbenet/go-peerstream/transport/test/ttest.go:    "testing"
./merkledag/mock.go:    "testing"
./p2p/test/util/key.go: "testing"
./p2p/test/util/util.go:    "testing"
./test/bench/bench_cli_ipfs_add/main.go:    "testing"
./thirdparty/assert/assert.go:import "testing"
./util/testutil/gen.go: "testing"
./util/testutil/identity.go:    "testing"

not sure what we want to do about all the test utils. can _test.go files export symbols to be included in code from other _test.go files in other packages? If so, we can enforce all testutil stuff is renamed _test.go

@wking
Copy link
Contributor

wking commented May 4, 2015

On Fri, Jan 23, 2015 at 07:20:04PM -0800, Juan Batiz-Benet wrote:

not sure what we want to do about all the test utils. can _test.go
files export symbols to be included in code from other _test.go
files in other packages?

I don't think they can. I'd like to move all shared test utilities
into util/testutil/… though, and we can use non-_test packages there
without polluting the core API. Related to #1158.

I'm happy to start working on this, since cyclic imports bit me while
writing #1136.

@daviddias
Copy link
Member

$ egrep -r '"testing"' . | egrep -v "_test.go"
egrep: ./Godeps/_workspace/src/github.com/jbenet/go-multihash/test/sharness/bin: No such file or directory
./Godeps/_workspace/src/bazil.org/fuse/fs/fstestutil/mounted.go:        "testing"
./Godeps/_workspace/src/github.com/jbenet/go-datastore/test/assert.go:import "testing"
./Godeps/_workspace/src/github.com/jbenet/go-datastore/test/test_util.go:    "testing"
./Godeps/_workspace/src/github.com/jbenet/go-peerstream/muxtest/muxt.go:     "testing"
./Godeps/_workspace/src/github.com/jbenet/go-stream-muxer/test/ttest.go:     "testing"
./p2p/test/util/key.go: "testing"
./p2p/test/util/util.go:        "testing"
./test/bench/bench_cli_ipfs_add/main.go:        "testing"
./test/bench/offline_add/main.go:       "testing"
./test/sharness/t0250-files-api.sh:             echo "testing" | ipfs files write -f=false -e /cats/walrus
./thirdparty/assert/assert.go:import "testing"
./util/testutil/gen.go: "testing"
./util/testutil/identity.go:    "testing"

Seems all good now, closing :)

@jbenet jbenet removed the backlog label Jan 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) kind/test Testing work topic/cleanup Topic cleanup
Projects
None yet
Development

No branches or pull requests

5 participants