Ticket #183 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

Unit tests don't work with SQLite

Reported by: michaeltwofish Owned by:
Priority: minor Milestone: 0.6
Component: Habari Core Software Version: SVN
Keywords: testing, SQLite, has_patch Cc:

Description

The connection string for SQLite in config.php specifies a relative path to the database. This works when Habari is launched from it's main directory, but the unit test framework requires that Habari is launched from the tests directory, and therefore the database is not found. A manual workaround is to change the connection string to an absolute path, but a better fix needs to be implemented.

Attachments

sqlite_unittest.diff Download (618 bytes) - added by rickc 4 years ago.

Change History

comment:1 Changed 4 years ago by michaeltwofish

  • Keywords testing, SQLite added
  • Component changed from -none- to Habari Core Software
  • Milestone changed from 0.5 to Undetermined

comment:2 Changed 4 years ago by michaeltwofish

An alternative workaround is to specify a full path when installing through the install form.

Is that enough and we close this ticket? Or should we store the full path to the SQLite DB in config.php?

comment:3 Changed 4 years ago by rickc

The attached patch will get the unit tests to work with SQLite without having to change your config.php file. I've tested it with absolute paths, just the name of the database file, and paths relative to the Habari base installation in the connection string. All seem to work okay.

Changed 4 years ago by rickc

comment:4 Changed 4 years ago by rickc

  • Keywords SQLite, has_patch added; SQLite removed

comment:5 Changed 4 years ago by miklb

  • Milestone changed from Undetermined to 0.5

comment:6 Changed 3 years ago by chrismeller

  • Milestone changed from 0.5 to 0.6

comment:7 Changed 3 years ago by chrismeller

Can we get an update on this? I was under the impression it had been fixed.

comment:8 Changed 3 years ago by chrismeller

  • Status changed from new to closed
  • Resolution set to fixed

I'm closing this because I believe it's been fixed and no one seems to care enough to come looking for the ticket.

Note: See TracTickets for help on using tickets.