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 Smarty to framework test system #2763

Closed
MarkMaldaba opened this issue May 25, 2014 · 38 comments
Closed

Add Smarty to framework test system #2763

MarkMaldaba opened this issue May 25, 2014 · 38 comments

Comments

@MarkMaldaba
Copy link

Hi there,

It would be great if you could add the Smarty templating engine (http://www.smarty.net/) to the list of frameworks that you test against (http://hhvm.com/frameworks/).

@MarkMaldaba
Copy link
Author

I had a look at the frameworks.yaml file with a view to fixing this ticket, and it seems that in order to add an entry it needs to be hosted on Github.

Smarty is not currently hosted on Github, but on Googlecode, as an SVN repository. I have left a message on the Smarty forums in an existing thread that was discussing a possible Git migration. It would be worth keeping an eye on how that thread develops: http://www.smarty.net/forums/viewtopic.php?p=87250#87250

If they don't migrate the whole project, there is also the option of using an SVN clone and an auto-sync to Github, as is being done here: https://github.com/opensolutions/smarty. However, that particular repository only contains the main Smarty distribution and does not include the unit tests which we would need in order to add it to the HHVM framework tests.

@MarkMaldaba
Copy link
Author

I also logged a ticket with the existing clone at https://github.com/opensolutions/smarty to see if it would be possible to sync the whole trunk: opensolutions/smarty#4

This would include the unit tests and therefore be one possible solution to allow this ticket to be implemented.

@uwetews
Copy link

uwetews commented Jul 11, 2014

The complete distribution including unit test can be found at
https://github.com/smarty-php/smarty

It's now maintened by the Smarty developers.

@MarkMaldaba
Copy link
Author

That's great news - I wonder why it didn't turn up in my searches, and why it isn't mentioned on the Smarty website!?

Thanks for the pointer.

@MarkMaldaba
Copy link
Author

Oops - closed by mistake!

@fredemmott
Copy link
Contributor

I don't see any unit tests in that repository - could you point me in the right direction?

@MarkMaldaba
Copy link
Author

Hmmm... as far as I can tell (and I may be wrong) the repository referred to above has been moved here: https://github.com/smarty-php/smarty-old, with a new repository being located at the original address. The new repository doesn't contain the tests, but the old one does (https://github.com/smarty-php/smarty-old/tree/master/development/PHPunit).

I'm sure the tests are still maintained somewhere, but you may need to contact @uwetews to find out which is the correct repo to link to.

@smarty-php
Copy link

We are right now in the process of moving completely to github and restructuring things a bit.
The PHPunit tests are currently reworked to be compliant with composer. Also some work is underway for the next 3.1.22 release of Smarty. Every thing will be uploaded within the next 2 weeks.
So please wait for these updates..

I keep you informed when everything is on github

Uwe

@MarkMaldaba
Copy link
Author

Thanks @uwetews - that sounds great!

@uwetews
Copy link

uwetews commented Jan 6, 2015

I want to give you a status update. 3.1.22 will become a major release with a lot of improvements. So it takes some more time. Mit meanwhile I have done some testing with Smarty under HHVM.

The hackificator tool was able to convert most of the Smarty code automatically.
With some work we should get Smarty itself 100% compatible.

The compiled template and cache PHP files are currently not compatible. But some brief tests have been successfull that we could generate these files directly as <?hh files if Smarty detects that it is running under HHVM.

My goal is to have HHVM support included in the 3.1.22 release.
Current estimated time frame 2 - 3 weeks.

I will keep you informed.

Uwe

@Majkl578
Copy link
Contributor

Majkl578 commented Jan 6, 2015

You don't need to hackify the code (don't know what the tool does) nor use <?hh under HHVM. Unless you are converting the library to Hack.

@ghost
Copy link

ghost commented Jan 22, 2015

What sort of work will need to be done locally to update smarty?

@fredemmott
Copy link
Contributor

To close this task, it needs a phpunit test framework that's reliably included in the main repository.

If the current PHP code does not work, we will almost certainly consider it a bug in HHVM; no changes to smarty should be required for HHVM.

Converting to Hack could provide some developer-efficiency benefits, but that's really separate to this issue.

@ghost
Copy link

ghost commented Jan 22, 2015

Hi there Fred,

PhpUNIT test Framework? - You mean this is already included?

Apologies HHVM is very new to me and most i discuss it with, so just to confirm.

We can add HHVM on to the current SmartyPHP version without any issues and it will run without any issues?

Converting to Hack -... apologies what is this in ref to?

I say this as we are on tenterhooks we have a site nearing completion which is the only way to explain it 22m lines of code with thousands of functions..

And having it all corrupt and having to remove then replace will take us a very very long time, something we are trying to avoid.

PS we are running CPanel 11.38 + CentOS 6.4
8CPUs
32700 Ram
10PB Harddisk

Encase this information also has any effect

Also i am hoping our Smarty is not v2.1

- @author Uwe Tews - @author Rodney Rehm - @Package Smarty - @Version 3.1-DEV

@fredemmott
Copy link
Contributor

  • This issue is just for adding Smarty to http://hhvm.com/frameworks/
  • hhvm.com/frameworks/ can run tests that use PHPUnit
  • There are PHPUnit tests for Smarty, however, they're not currently in the source tree, so we can't use them
  • See http://hacklang.org/ for 'converting to Hack'

Given we don't currently use Smarty ourselves, and the unit tests aren't currently available, I can't comment on if it will work or not.

@uwetews
Copy link

uwetews commented Jan 22, 2015

You can install the 3.1 releases with no problems under HHVM.

If you run the hackificator (see http://docs.hhvm.com/manual/en/install.hack.conversion.php)
The majority of code gets converted to <?hh. Some modules will stay as PHP files.

The upcomming release 3.1.22 of Smarty will include optimizations for HHVM. The goal is that the hackificator can convert the complete Smarty distribution to <?hh.

3.1.22 will include also many other improvements resulting also under PHP in some higher speed and less memory usage.

I'm currently preparing a package including Smarty PHPUnit tests ready to run under HHVM. I will drop here a note when this work is completed.

@ghost
Copy link

ghost commented Jan 26, 2015

Q: Is this for finnished projects or can be used in test/dev framework also?

@uwetews
Copy link

uwetews commented Feb 7, 2015

Here is a status update.
Currently #4797 does create problems in the PHPUnit test while testing Smarty's recompile and caching functions.

Smarty itself currently is affected when caching mode CACHING_LIFETIME_SAVED is used.
(An update of an invalid cache file will be seen with a delay of one page request)

The current working copies can be required by composer with
"smarty/smarty": "~3.1@dev"
"smarty/smarty-phpunit": "~3.1@dev",

Run the test with
$ sh phpunit_hhvm.sh

@ghost
Copy link

ghost commented Feb 7, 2015

Hi there, Just to confirm is this pre-release issue likely to be resolved with the 3.22 release only im waiting on its release to update the entire site from 3.12 to 3.22 then add HHVM set up after through testing.

@uwetews
Copy link

uwetews commented Feb 9, 2015

The goal is to get this resolved with the 3.1.22 release.
But currently it looks like that we have to wait for a HHVM update to remove this PHP incompatibility.

@MarkMaldaba
Copy link
Author

Isn't the point of this ticket just to get the Smarty unit tests into a public Git repo and add a submodule or whatever so they are included in the HHVM framework tests?

I don't think it really matters whether the tests pass or whether Smarty actually supports HHVM, does it? The point is that the Smarty unit tests are being run under HHVM so that we get some transparency about compatibility (which, as has been said, is really a matter for the HHVM team to deal with, rather than the Smarty developer(s)).

Is there no public repo for Smarty that includes the unit tests? There certainly used to be!

@fredemmott
Copy link
Contributor

Yep, we're happy to start running the tests even if they don't all pass, once there is a canonical place for us to get them and the source from.

@uwetews
Copy link

uwetews commented Feb 9, 2015

The Smarty source and PHPUnit test can be installed via composer or are available at https://github.com/smarty-php/smarty and https://github.com/smarty-php/smarty-phpunit.

See my comment 3 days ago.

@fredemmott
Copy link
Contributor

Cool; we need a unified repository - would it be possible for smarty-phpunit to require smarty via composer?

@uwetews
Copy link

uwetews commented Feb 10, 2015

I will add that.
So I will remove all @runInSeparateProcess annotation which I tried to find a work around until the include problem is solved.
In the unit test we run tests on some demo custom cache resources like memcache, mysql, APC.
These may require some system configuration to run correctly. Shall I disable these test for the time being?

As it's already late night here in Germany I would update the smarty-phpunit tomorrow and let you know,

@ghost
Copy link

ghost commented Feb 18, 2015

@fredemmott , @uwetews have we got an update on this yet and a possible lead time as to whether 3.22 will be launching 100% HM compat?

or will 3.22 be launching with its generic updates and % compat ?

Thank you.

@ceased-ebc
Copy link

I second ^ @fredemmott @uwetews

@ceased-ebc
Copy link

Quote @uwetews

I want to give you a status update. 3.1.22 will become a major release with a lot of improvements. So it takes some more time. Mit meanwhile I have done some testing with Smarty under HHVM.

The hackificator tool was able to convert most of the Smarty code automatically.
With some work we should get Smarty itself 100% compatible.

The compiled template and cache PHP files are currently not compatible. But some brief tests have been successfull that we could generate these files directly as <?hh files if Smarty detects that it is running under HHVM.

My goal is to have HHVM support included in the 3.1.22 release.
Current estimated time frame 2 - 3 weeks.

I will keep you informed.

Uwe

////

Have we got any update on this?

@ceased-ebc
Copy link

.......... any update chaps

@uwetews
Copy link

uwetews commented Mar 6, 2015

Sorry, the work on the 3.1.22 release takes longer as previously estimated.
There will be a couple of internal changes for less memory usage, higher speed and best performance under hhvm.

Also the PHPUnit test will be reworked to run under hhvm.

I now estimate another 1 - 2 weeks.

@ceased-ebc
Copy link

^ Looking forward to and happily awaiting...

@ceased-ebc
Copy link

@uwetews Hi, any update on this release ? coming up to 3 weeks.

@MarkMaldaba
Copy link
Author

Am I missing something? All this ticket needs is a URL to the Git repository containing the unit tests. We don't need to wait for a release for this, do we?

Even if 100% of tests fail under HHVM, that would be enough to satisfy this ticket!

@ceased-ebc
Copy link

@mark we are awaiting Smarty 3.2 release and its 100% compatibility with HHVM

@MarkMaldaba
Copy link
Author

@NotApplicableBeech - I am aware of that, and am looking forward to it with great anticipation!

However, that is not a requirement of this ticket. This ticket is about linking the Smarty unit tests into the HHVM unit-testing framework, so we can get an idea of how well HHVM supports Smarty. This will allow the HHVM developers to fix any bugs/edge-cases in HHVM that might cause Smarty to not work correctly.

There is no requirement for Smarty devs to make any change to Smarty in order for this to be possible, and given that there have been PHPUnit tests in Smarty since at least v2, this ticket should have been an easy fix. The only thing holding it up is having a URL to the Github repository that contains the tests.

@uwetews
Copy link

uwetews commented May 4, 2015

Fred

Sorry for the delay in this matter.

I had for personal reason just little time to work on Smarty.

Also I had to make sure that our PHPUnit tests will fail on HHVM just because incompatibilities when executing Smarty, but not because of the test code.

You can now use composer “smarty/smarty-dev” : “~3.1” to get the latest stable Smarty version and its corresponding PHPUnit tests.

Smarty-dev contains just a wrapper composer.json t load the versions from “smarty/smarty” and “smarty/smarty-phpunit”.

I hope this does work for you.

The failures you will get when running the unit test should all be caused by the reported issue #4797 (comment)

Besides that have not experience other problems.

The failure will not be a hard one in applications.

It will delay the visibility of a modified template source or an updated template cache by one page call.

Let me know if you need more information.

Uwe

Von: Fred Emmott [mailto:notifications@github.com]
Gesendet: Dienstag, 10. Februar 2015 00:56
An: facebook/hhvm
Cc: uwetews
Betreff: Re: [hhvm] Add Smarty to framework test system (#2763)

Cool; we need a unified repository - would it be possible for smarty-phpunit to require smarty via composer?


Reply to this email directly or view it on GitHub #2763 (comment) . https://github.com/notifications/beacon/ABMDr67sCc2Xo5g5p20PaUpFyM5CWb2Nks5nqUCogaJpZM4B-GWN.gif

@JoelMarcey JoelMarcey self-assigned this Jun 18, 2015
@JoelMarcey
Copy link
Contributor

There is an internal diff to add framework test runner support for Smarty.

@uwetews
Copy link

uwetews commented Jul 28, 2015

I'm glad to see that Smarty is now part of your frameworks tests.
But as far as I see you compare the test results with hphp/test/frameworks/results/smarty.expect. Right?

Currently a lot of development is under way at Smarty. So the PHPUnit tests will be extended regularly so I assume you might see no real failures.

Anyway I was able to implement a workaround for the existing HHVM issue #4797 (comment)

The dev-master version of Smarty is now passing all PHPUnit tests under HHVM.

I did set up at Travis CI for Smarty also a hhvm test run.

See https://travis-ci.org/smarty-php/smarty

So every commit to the Smarty repository will now be automatically tested for hhvm compatibility.

Thanks for your good work.

Uwe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants