Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit test demonstrating attaching a listener to queries #14716

Merged
merged 1 commit into from
Jul 22, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Jul 3, 2019

Overview

Unit test for civicrm/civicrm-packages#180

Before

No test

After

Test

Technical Details

Unit test for civicrm/civicrm-packages#180 pretty much stalled on lack of a test for a long time - this is that test. It will fail until that is merged

I think we can also use this method to resolve https://bugs.mysql.com/bug.php?id=68184 which is an issue where for us truncate is very slow & we have had to hack to DELETE FROM instead

Comments

@seamuslee001 @davejenx

@civibot
Copy link

civibot bot commented Jul 3, 2019

(Standard links)

}
catch (PEAR_Exception $e) {
$this->assertEquals(
"SELECT * FROM civicrm_domain [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/* Forgot trailing comment markerSELECT * FROM civicrm_domain' at line 1]",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering if this check could be a bit brittle if the exact text of MySQL's error message changes, or MariaDB diverges from MySQL, or someone runs the test with MySQL in a different locale. Could look for substrings like "nativecode=1064" and "'/* Forgot trailing comment markerSELECT * FROM civicrm_domain'" instead?

@seamuslee001
Copy link
Contributor

Jenkins re test this please

@eileenmcnaughton
Copy link
Contributor Author

@seamuslee001 this can't pass until the other is merged

@eileenmcnaughton
Copy link
Contributor Author

test this please

@eileenmcnaughton
Copy link
Contributor Author

Note from the main pr- docs issue outstanding civicrm/civicrm-packages#180

@colemanw
Copy link
Member

Test passes.

@colemanw colemanw merged commit cc07069 into civicrm:master Jul 22, 2019
@colemanw colemanw deleted the db branch July 22, 2019 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants