{"action":"created","issue":{"url":"https://api.github.com/repos/aacanakin/qb/issues/81","repository_url":"https://api.github.com/repos/aacanakin/qb","labels_url":"https://api.github.com/repos/aacanakin/qb/issues/81/labels{/name}","comments_url":"https://api.github.com/repos/aacanakin/qb/issues/81/comments","events_url":"https://api.github.com/repos/aacanakin/qb/issues/81/events","html_url":"https://github.com/aacanakin/qb/issues/81","id":168597141,"number":81,"title":"go test fails","user":{"login":"cdevienne","id":547135,"avatar_url":"https://avatars.githubusercontent.com/u/547135?v=3","gravatar_id":"","url":"https://api.github.com/users/cdevienne","html_url":"https://github.com/cdevienne","followers_url":"https://api.github.com/users/cdevienne/followers","following_url":"https://api.github.com/users/cdevienne/following{/other_user}","gists_url":"https://api.github.com/users/cdevienne/gists{/gist_id}","starred_url":"https://api.github.com/users/cdevienne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdevienne/subscriptions","organizations_url":"https://api.github.com/users/cdevienne/orgs","repos_url":"https://api.github.com/users/cdevienne/repos","events_url":"https://api.github.com/users/cdevienne/events{/privacy}","received_events_url":"https://api.github.com/users/cdevienne/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-01T08:52:08Z","updated_at":"2016-08-01T09:00:52Z","closed_at":null,"body":"I am changing a little the tests so we can provide dsn for mysql and postgres through env vars.\r\n\r\nBut I cannot get the mysql tests to pass. I always get the following output (see below).\r\n\r\nAre the tests supposed to pass successfully ? Did I miss something ?\r\n\r\n```\r\n2016/08/01 11:49:22 INSERT INTO actors(id)\r\nVALUES(?);\r\n2016/08/01 11:49:22 [5]\r\n2016/08/01 11:49:22 \r\n2016/08/01 11:49:22 INSERT INTO actors(id)\r\nVALUES(?);\r\n2016/08/01 11:49:22 [10]\r\n2016/08/01 11:49:22 \r\nCREATE TABLE user (\r\n\tsecondary_id VARCHAR(255),\r\n\tuser_type VARCHAR(255) DEFAULT 'guest',\r\n\tcreated_at TIMESTAMP NOT NULL,\r\n\tid VARCHAR(255),\r\n\tfacebook_id BIGINT,\r\n\tprofile_name VARCHAR(255),\r\n\tfull_name VARCHAR(255) NOT NULL DEFAULT '',\r\n\tlevel INT,\r\n\tmoney FLOAT,\r\n\tfacebook_profile VARCHAR(255),\r\n\temail VARCHAR(255) UNIQUE NOT NULL,\r\n\tpassword TEXT,\r\n\tpremium BOOLEAN,\r\n\tprofile_id BIGINT,\r\n\tdeleted_at TIMESTAMP NULL,\r\n\tscore FLOAT,\r\n\tunknown VARCHAR(255),\r\n\tPRIMARY KEY(id, secondary_id),\r\n\tFOREIGN KEY(facebook_id, facebook_profile) REFERENCES facebook(id, profile_id),\r\n\tFOREIGN KEY(profile_id, profile_name) REFERENCES profile(id, name)\r\n);\r\nCREATE INDEX i_unknown ON user(unknown);\r\nCREATE INDEX i_full_name_password ON user(full_name, password); \r\n\r\nCREATE TABLE user (\r\n\tid BIGINT\r\n); \r\n\r\nCREATE TABLE user (\r\n\t_id VARCHAR(36),\r\n\temail VARCHAR(255) UNIQUE NOT NULL,\r\n\tPRIMARY KEY(_id)\r\n); \r\n\r\nInvalid tag key=tag_should_raise_err value=val\r\n--- FAIL: TestMysql (0.01s)\r\n        Error Trace:    5: \r\n\tError:\t\tExpected nil, but got: &errors.errorString{s:\"Metadata is empty\"}\r\n\t\t\r\n        Error Trace:    mysql_test.go:52\r\n\tError:\t\tExpected nil, but got: &mysql.MySQLError{Number:0x41a, Message:\"Table 'user' already exists\"}\r\n\t\t\r\n        Error Trace:    mysql_test.go:70\r\n\tError:\t\tExpected nil, but got: &mysql.MySQLError{Number:0x47a, Message:\"Table 'qb_test.session' doesn't exist\"}\r\n\t\t\r\n        Error Trace:    mysql_test.go:77\r\n\tError:\t\tNot equal: \"\" (expected)\r\n\t\t\t        != \"jack@nicholson.com\" (actual)\r\n\t\t\r\n        Error Trace:    mysql_test.go:78\r\n\tError:\t\tNot equal: \"\" (expected)\r\n\t\t\t        != \"Jack Nicholson\" (actual)\r\n\t\t\r\n        Error Trace:    mysql_test.go:79\r\n\tError:\t\tNot equal: \"\" (expected)\r\n\t\t\t        != \"Jack Nicholson, an American actor, producer, screen-writer and director, is a three-time Academy Award winner and twelve-time nominee.\" (actual)\r\n\t\t\r\n        Error Trace:    mysql_test.go:88\r\n\tError:\t\tExpected nil, but got: &mysql.MySQLError{Number:0x47a, Message:\"Table 'qb_test.session' doesn't exist\"}\r\n\t\t\r\n        Error Trace:    mysql_test.go:89\r\n\tError:\t\tNot equal: 0 (expected)\r\n\t\t\t        != 1 (actual)\r\n\t\t\r\npanic: runtime error: index out of range [recovered]\r\n\tpanic: runtime error: index out of range\r\n\r\ngoroutine 55 [running]:\r\npanic(0x9ca140, 0xc82000a0f0)\r\n\t/usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6\r\ntesting.tRunner.func1(0xc82001e090)\r\n\t/usr/lib/go-1.6/src/testing/testing.go:467 +0x192\r\npanic(0x9ca140, 0xc82000a0f0)\r\n\t/usr/lib/go-1.6/src/runtime/panic.go:443 +0x4e9\r\ngithub.com/aacanakin/qb.(*MysqlTestSuite).TestMysql(0xc820412a20)\r\n\t/home/cdevienne/ws/ll/golang/src/github.com/aacanakin/qb/mysql_test.go:91 +0x2144\r\nreflect.Value.call(0x902920, 0xa592b8, 0x13, 0xa62070, 0x4, 0xc8201d5ef8, 0x1, 0x1, 0x0, 0x0, ...)\r\n\t/usr/lib/go-1.6/src/reflect/value.go:435 +0x120d\r\nreflect.Value.Call(0x902920, 0xa592b8, 0x13, 0xc8201d5ef8, 0x1, 0x1, 0x0, 0x0, 0x0)\r\n\t/usr/lib/go-1.6/src/reflect/value.go:303 +0xb1\r\ngithub.com/stretchr/testify/suite.Run.func2(0xc82001e090)\r\n\t/home/cdevienne/ws/ll/golang/src/github.com/stretchr/testify/suite/suite.go:95 +0x230\r\ntesting.tRunner(0xc82001e090, 0xc820498d20)\r\n\t/usr/lib/go-1.6/src/testing/testing.go:473 +0x98\r\ncreated by testing.RunTests\r\n\t/usr/lib/go-1.6/src/testing/testing.go:582 +0x892\r\nexit status 2\r\nFAIL\tgithub.com/aacanakin/qb\t0.063s\r\n```"},"comment":{"url":"https://api.github.com/repos/aacanakin/qb/issues/comments/236526578","html_url":"https://github.com/aacanakin/qb/issues/81#issuecomment-236526578","issue_url":"https://api.github.com/repos/aacanakin/qb/issues/81","id":236526578,"user":{"login":"cdevienne","id":547135,"avatar_url":"https://avatars.githubusercontent.com/u/547135?v=3","gravatar_id":"","url":"https://api.github.com/users/cdevienne","html_url":"https://github.com/cdevienne","followers_url":"https://api.github.com/users/cdevienne/followers","following_url":"https://api.github.com/users/cdevienne/following{/other_user}","gists_url":"https://api.github.com/users/cdevienne/gists{/gist_id}","starred_url":"https://api.github.com/users/cdevienne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdevienne/subscriptions","organizations_url":"https://api.github.com/users/cdevienne/orgs","repos_url":"https://api.github.com/users/cdevienne/repos","events_url":"https://api.github.com/users/cdevienne/events{/privacy}","received_events_url":"https://api.github.com/users/cdevienne/received_events","type":"User","site_admin":false},"created_at":"2016-08-01T09:00:52Z","updated_at":"2016-08-01T09:00:52Z","body":"If a clean the test db (by dropping the user table), the error becomes:\r\n\r\n```\r\n2016/08/01 11:58:49 INSERT INTO actors(id)\r\nVALUES(?);\r\n2016/08/01 11:58:49 [5]\r\n2016/08/01 11:58:49 \r\n2016/08/01 11:58:49 INSERT INTO actors(id)\r\nVALUES(?);\r\n2016/08/01 11:58:49 [10]\r\n2016/08/01 11:58:49 \r\nCREATE TABLE user (\r\n\tunknown VARCHAR(255),\r\n\tid VARCHAR(255),\r\n\tprofile_id BIGINT,\r\n\tlevel INT,\r\n\tmoney FLOAT,\r\n\temail VARCHAR(255) UNIQUE NOT NULL,\r\n\tscore FLOAT,\r\n\tfacebook_id BIGINT,\r\n\tfacebook_profile VARCHAR(255),\r\n\tuser_type VARCHAR(255) DEFAULT 'guest',\r\n\tpremium BOOLEAN,\r\n\tcreated_at TIMESTAMP NOT NULL,\r\n\tdeleted_at TIMESTAMP NULL,\r\n\tsecondary_id VARCHAR(255),\r\n\tprofile_name VARCHAR(255),\r\n\tfull_name VARCHAR(255) NOT NULL DEFAULT '',\r\n\tpassword TEXT,\r\n\tPRIMARY KEY(id, secondary_id),\r\n\tFOREIGN KEY(facebook_id, facebook_profile) REFERENCES facebook(id, profile_id),\r\n\tFOREIGN KEY(profile_id, profile_name) REFERENCES profile(id, name)\r\n);\r\nCREATE INDEX i_unknown ON user(unknown);\r\nCREATE INDEX i_full_name_password ON user(full_name, password); \r\n\r\nCREATE TABLE user (\r\n\tid BIGINT\r\n); \r\n\r\nCREATE TABLE user (\r\n\t_id VARCHAR(36),\r\n\temail VARCHAR(255) UNIQUE NOT NULL,\r\n\tPRIMARY KEY(_id)\r\n); \r\n\r\nInvalid tag key=tag_should_raise_err value=val\r\n--- FAIL: TestMysql (0.12s)\r\n        Error Trace:    5: \r\n\tError:\t\tExpected nil, but got: &errors.errorString{s:\"Metadata is empty\"}\r\n\t\t\r\n        Error Trace:    mysql_test.go:52\r\n\tError:\t\tExpected nil, but got: &mysql.MySQLError{Number:0x42b, Message:\"Invalid default value for 'expires_at'\"}\r\n\t\t\r\n        Error Trace:    mysql_test.go:70\r\n\tError:\t\tExpected nil, but got: &mysql.MySQLError{Number:0x47a, Message:\"Table 'qb_test.session' doesn't exist\"}\r\n\t\t\r\n        Error Trace:    mysql_test.go:77\r\n\tError:\t\tNot equal: \"\" (expected)\r\n\t\t\t        != \"jack@nicholson.com\" (actual)\r\n\t\t\r\n        Error Trace:    mysql_test.go:78\r\n\tError:\t\tNot equal: \"\" (expected)\r\n\t\t\t        != \"Jack Nicholson\" (actual)\r\n\t\t\r\n        Error Trace:    mysql_test.go:79\r\n\tError:\t\tNot equal: \"\" (expected)\r\n\t\t\t        != \"Jack Nicholson, an American actor, producer, screen-writer and director, is a three-time Academy Award winner and twelve-time nominee.\" (actual)\r\n\t\t\r\n        Error Trace:    mysql_test.go:88\r\n\tError:\t\tExpected nil, but got: &mysql.MySQLError{Number:0x47a, Message:\"Table 'qb_test.session' doesn't exist\"}\r\n\t\t\r\n        Error Trace:    mysql_test.go:89\r\n\tError:\t\tNot equal: 0 (expected)\r\n\t\t\t        != 1 (actual)\r\n\t\t\r\npanic: runtime error: index out of range [recovered]\r\n\tpanic: runtime error: index out of range\r\n\r\ngoroutine 78 [running]:\r\npanic(0x9ca140, 0xc82000a0f0)\r\n\t/usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6\r\ntesting.tRunner.func1(0xc8204562d0)\r\n\t/usr/lib/go-1.6/src/testing/testing.go:467 +0x192\r\npanic(0x9ca140, 0xc82000a0f0)\r\n\t/usr/lib/go-1.6/src/runtime/panic.go:443 +0x4e9\r\ngithub.com/aacanakin/qb.(*MysqlTestSuite).TestMysql(0xc82032a4e0)\r\n\t/home/cdevienne/ws/ll/golang/src/github.com/aacanakin/qb/mysql_test.go:91 +0x2144\r\nreflect.Value.call(0x902920, 0xa592b8, 0x13, 0xa62070, 0x4, 0xc820121ef8, 0x1, 0x1, 0x0, 0x0, ...)\r\n\t/usr/lib/go-1.6/src/reflect/value.go:435 +0x120d\r\nreflect.Value.Call(0x902920, 0xa592b8, 0x13, 0xc820121ef8, 0x1, 0x1, 0x0, 0x0, 0x0)\r\n\t/usr/lib/go-1.6/src/reflect/value.go:303 +0xb1\r\ngithub.com/stretchr/testify/suite.Run.func2(0xc8204562d0)\r\n\t/home/cdevienne/ws/ll/golang/src/github.com/stretchr/testify/suite/suite.go:95 +0x230\r\ntesting.tRunner(0xc8204562d0, 0xc82032b6e0)\r\n\t/usr/lib/go-1.6/src/testing/testing.go:473 +0x98\r\ncreated by testing.RunTests\r\n\t/usr/lib/go-1.6/src/testing/testing.go:582 +0x892\r\nexit status 2\r\nFAIL\tgithub.com/aacanakin/qb\t0.161s\r\n```"}}
{"actor":{"display_login":"cdevienne"}}