CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • Unit Testing (Moderator: Michał Mach) »
  • testing with MEMORY engine
Pages: [1]

Author Topic: testing with MEMORY engine  (Read 2419 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
testing with MEMORY engine
May 05, 2011, 04:26:40 am
Hi,

Spend way too long trying the MEMORY engine.

State of the tests:
1) I modified the test code so the name of the db (civicrm_tests_dev) isn't hard coded, but defined in one place

2) I've created a copy of civicrm.mysql to use MEMORY instead of InnoDB.
Issue: memory can't handle BLOB/TEXT columns, so converted them to varchar (5555), the problem is that now when I run the tests

3) Where the f*** is this defined ?
When I run the tests, I get stuff like
PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'msg_html' at row 1

I have no idea where this data is defined, when I run
mysql -uroot civicrm_tests_mem < /var/www/civi.34/sql/civicrm_data.mysql

I don't get any error, but I can't find where it's triggered on the tests (That's more or less on each tests, even if the test hasn't anything to do with a msg_html column value defined).

Hard to compare because I got lots of errors, but it seems faster to run a test (Time: 8 seconds to run api_v3_ActivityTest, and the Initialising stage is fast)

@michau @dlobo : any idea ?

Code: [Select]
Installing civicrm_tests_mem database
bool(false)
array(3) {
  [0]=>
  string(5) "22001"
  [1]=>
  int(1406)
  [2]=>
  string(44) "Data too long for column 'msg_html' at row 7"
}



changes on the mysql so far
Code: [Select]
:%s/ENGINE=InnoDB/ENGINE=MEMORY/g
%s/ text / varchar(2555)/g
:%s/ mediumblob / varchar(2555)/g
:%s/ longtext / varchar(2555)/g

REM: It seems that mysql translates varchar (xxx) where xxx is "too big" into a blob.

X+






-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • Unit Testing (Moderator: Michał Mach) »
  • testing with MEMORY engine

This forum was archived on 2017-11-26.