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

[TEST] dev/core#1572 Unit test environment not working on windows after recent CodeGen updates #16477

Merged
merged 1 commit into from
Feb 13, 2020

Conversation

demeritcowboy
Copy link
Contributor

Overview

https://lab.civicrm.org/dev/core/issues/1572
Previously it loaded the database from sql files. Now it does it on the fly compiling the schema xml files, but the path used doesn't work on windows.

Before

Screen fills with errors trying to run a unit test.

After

Works like it used to.

Technical Details

DomDocument->xinclude() in CRM_Core_CodeGen_Util_Xml is the main problem that doesn't work with backslashes. It's being passed a path that includes backslashes because the process gets started using __DIR__ as the root, which on windows comes through with backslashes, and then it can't find the schema files to include. Except for system calls out to batch files and such where it's windows itself consuming the parameters, php works better on windows using forward slashes same as unix.

Comments

Another option if it's desired to have absolute paths is to use str_replace("\\", '/', $civiRoot).

@civibot
Copy link

civibot bot commented Feb 5, 2020

(Standard links)

@civibot civibot bot added the master label Feb 5, 2020
@demeritcowboy
Copy link
Contributor Author

Jenkins retest this please.

@eileenmcnaughton eileenmcnaughton merged commit 8b00f7f into civicrm:master Feb 13, 2020
@demeritcowboy
Copy link
Contributor Author

Yay!

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.

2 participants