Closed Icedroid closed 10 years ago
@Icedroid - Thanks for posting the report. Any chance you could also post some of the code that produced the report?
When I run goconvey, AppConfigPath= /tmp/go-build078948566/mm/api/tests/_test/conf/app.conf I use beego framework,the models have use the beego.AppConfig.String("key"), It get these error.
I frequently get these error when I run goconvey in my beego project dir:
2014/01/02 20:41:45 executor.go:56: Executor status: 'parsing'
Potential error parsing output of mm/api ; couldn't handle this stray line: go install mm/api/controllers: open /home/ice/Dropbox/mygo/pkg/linux_amd64/mm/api/controllers.a: permission denied
@Icedroid - Hmm, that's strange. I'm not familiar with beego. I'll experiment with it to see if I get similar errors. In the meantime, what output do you get when you run go test -v -timeout=-42s
in your beego project directory? Can you paste that output here?
You can see this link https://github.com/astaxie/beego/issues/424
Can you create a simple example of the test code and production code you are trying to run and attach that as a comment here? It would be really helpful to have an example that I can execute to see if I see the error. If I can reproduce the error then I can probably fix it if the problem is with GoConvey. I can see some of your test code from that link you provided but the Chinese makes it difficult for me to understand the context (even with google translate).
If I were to guess what your test code was doing I would say that it is sending authentication information (username, password) to an HTTP handler. I've encountered problems in GoConvey when encrypted or hashed data is not escaped properly. Could that be the problem here? (I'm really guessing now)
You can try a golang simple function have a relative config file to read in. Like beego project, you can simply create a login method, and you must read from mysql, and then the mysql configure is from app.conf. When you run the goconvey or like go test, the tmp path will is /tmp/go-build078948566/mm/api/tests/_test/ so any configure file will not be readed.
Ah, now I understand the problem. Your configuration file isn't copied into the tmp directory created by go test
. That's not something that GoConvey can help with because we integrate completely with go test
. Is the config file read by beego or by the mysql process? Could you achieve the configuration you seek by using environment variables rather than a config file?
I'm going to close this issue as this issue is tied to go test
, not GoConvey.
Thank-you for your attention reply. The config file is read by beego to connected mysql, but I don't know how to run my test for some associated mysql function? How to achieve mysql configuration for connected? How you run test in your project which have mysql or redis
That's a great question. Might be a good question for the golang-nuts user group.