Bumped up the version of MariaDB on Travis.

Replaced a couple of expects with expectNilErrs so we don't lose the original errors messages in those tests.
Fixed a couple more MySQL default value issues.
This commit is contained in:
Azareal 2018-10-07 00:02:52 +10:00
parent 644bba36e3
commit ebbfa7d247
3 changed files with 5 additions and 7 deletions

View File

@ -23,4 +23,4 @@ script: ./run-linux-tests
after_script: after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
addons: addons:
mariadb: '10.0' mariadb: '10.1'

View File

@ -690,10 +690,8 @@ func TestProfileReplyStore(t *testing.T) {
_, err := common.Prstore.Get(-1) _, err := common.Prstore.Get(-1)
recordMustNotExist(t, err, "PRID #-1 shouldn't exist") recordMustNotExist(t, err, "PRID #-1 shouldn't exist")
_, err = common.Prstore.Get(0) _, err = common.Prstore.Get(0)
recordMustNotExist(t, err, "PRID #0 shouldn't exist") recordMustNotExist(t, err, "PRID #0 shouldn't exist")
_, err = common.Prstore.Get(1) _, err = common.Prstore.Get(1)
recordMustNotExist(t, err, "PRID #1 shouldn't exist") recordMustNotExist(t, err, "PRID #1 shouldn't exist")
@ -704,11 +702,11 @@ func TestProfileReplyStore(t *testing.T) {
var profileID = 1 var profileID = 1
prid, err := common.Prstore.Create(profileID, "Haha", 1, "::1") prid, err := common.Prstore.Create(profileID, "Haha", 1, "::1")
expect(t, err == nil, "Unable to create a profile reply") expectNilErr(t, err)
expect(t, prid == 1, "The first profile reply should have an ID of 1") expect(t, prid == 1, "The first profile reply should have an ID of 1")
profileReply, err := common.Prstore.Get(1) profileReply, err := common.Prstore.Get(1)
expect(t, err == nil, "PRID #1 should exist") expectNilErr(t, err)
expect(t, profileReply.ID == 1, fmt.Sprintf("The profile reply should have an ID of 1 not %d", profileReply.ID)) expect(t, profileReply.ID == 1, fmt.Sprintf("The profile reply should have an ID of 1 not %d", profileReply.ID))
expect(t, profileReply.ParentID == 1, fmt.Sprintf("The parent ID of the profile reply should be 1 not %d", profileReply.ParentID)) expect(t, profileReply.ParentID == 1, fmt.Sprintf("The parent ID of the profile reply should be 1 not %d", profileReply.ParentID))
expect(t, profileReply.Content == "Haha", fmt.Sprintf("The profile reply's contents should be 'Haha' not '%s'", profileReply.Content)) expect(t, profileReply.Content == "Haha", fmt.Sprintf("The profile reply's contents should be 'Haha' not '%s'", profileReply.Content))

View File

@ -319,8 +319,8 @@ func createTables(adapter qgen.Adapter) error {
qgen.DBTableColumn{"parsed_content", "text", 0, false, false, ""}, qgen.DBTableColumn{"parsed_content", "text", 0, false, false, ""},
qgen.DBTableColumn{"createdAt", "createdAt", 0, false, false, ""}, qgen.DBTableColumn{"createdAt", "createdAt", 0, false, false, ""},
qgen.DBTableColumn{"createdBy", "int", 0, false, false, ""}, // TODO: Make this a foreign key qgen.DBTableColumn{"createdBy", "int", 0, false, false, ""}, // TODO: Make this a foreign key
qgen.DBTableColumn{"lastEdit", "int", 0, false, false, ""}, qgen.DBTableColumn{"lastEdit", "int", 0, false, false, "0"},
qgen.DBTableColumn{"lastEditBy", "int", 0, false, false, ""}, qgen.DBTableColumn{"lastEditBy", "int", 0, false, false, "0"},
qgen.DBTableColumn{"ipaddress", "varchar", 200, false, false, "0.0.0.0.0"}, qgen.DBTableColumn{"ipaddress", "varchar", 200, false, false, "0.0.0.0.0"},
}, },
[]qgen.DBTableKey{ []qgen.DBTableKey{