scaleway/scaleway-sdk-go

undefined variables during a test

remyleone opened this issue · 1 comments

$ docker run -it circleci/golang:1.13
$ go get github.com/scaleway/scaleway-sdk-go
$ cd src/github.com/scaleway/scaleway-sdk-go
$ go test -v scw/config_test.go

# command-line-arguments [command-line-arguments.test]
scw/config_test.go:18:14: undefined: Region
scw/config_test.go:22:14: undefined: Zone
scw/config_test.go:54:78: undefined: defaultConfigPermission
scw/config_test.go:412:36: undefined: RegionFrPar
scw/config_test.go:413:36: undefined: ZoneFrPar2
scw/config_test.go:420:35: undefined: RegionNlAms
scw/config_test.go:421:35: undefined: ZoneNlAms1
scw/config_test.go:424:25: undefined: Config
scw/config_test.go:483:40: undefined: v1ValidToken
scw/config_test.go:484:30: undefined: v1ValidOrganizationID
scw/config_test.go:54:78: too many errors
FAIL	command-line-arguments [build failed]
FAIL

Hi @remyleone,

./scw/config_test.go uses types that are defined in:

  • ./scw/locality.go
  • ./scw/config.go
  • ./scw/config_legacy_test.go

go test will not import missing files, the safe way to run tests is on a package, not on a file. 👌