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

Setup continuous integration server for Piwik builds #818

Closed
mattab opened this issue Jun 19, 2009 · 52 comments
Closed

Setup continuous integration server for Piwik builds #818

mattab opened this issue Jun 19, 2009 · 52 comments
Assignees
Labels
c: Website matomo.org For issues related to our matomo.org website. Critical Indicates the severity of an issue is very critical and the issue has a very high priority. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

Comments

@mattab
Copy link
Member

mattab commented Jun 19, 2009

We use bamboo for continuous integration: https://bamboo.openx.org/

currently it runs the webtest that tests the installation process + reset password feature.
it should also run the unit tests and fail when at least one test doesn't pass. there is some magic involved to rewrite simpletests results in XML to be parsed by the tool.

The tool has been failing lately and we would like to setup our own Build integration software on 2 servers we have available for the task.

@robocoder
Copy link
Contributor

bamboo.openx.org server appears to be no longer available; should we close this or look into setting up our own (eg using xinc)?

@mattab
Copy link
Member Author

mattab commented Jan 18, 2010

vipsoft, we should consider running our own bamboo, or maybe Hudson as it seems better. We could have 1 or 2 boxes by our sponsor Free to support it - if you want to have a try I can give you the server details

@mattab
Copy link
Member Author

mattab commented Jan 18, 2010

I looked at xing, interesting to build this in php! the project hasn't seen an update for a while though.. I used Hudson in the past, and people were very happy with it; !http://wiki.hudson-ci.org/display/HUDSON/Meet+Hudson

@robocoder
Copy link
Contributor

I thought we could use xinc to avoid using a java server, but since webtest is java-based, we might as well use bamboo or hudson.

@mattab
Copy link
Member Author

mattab commented Feb 11, 2010

Note: the current Bamboo is at http://bamboo.openx.org:8085/browse/PIWIK-TRUNK but seems to fail due to some errors. We would like to setup our own integration build server at eg. tests.piwik.org

@mattab
Copy link
Member Author

mattab commented May 9, 2010

I asked atlassian and they offered a free license of Bamboo. However, it might be better for us to pay for hosted continuous integration server (bamboo or hudson). If anyone knows such a hosted service, let us know!

@robocoder
Copy link
Contributor

System requirements are:

  • multiple PHP CGI versions (e.g., 5.1.3, 5.2.0, 5.2.6, 5.2-SVN, 5.3.1, 5.3-SVN)
  • Tomcat (or other Java server) to support bamboo or hudson; or Apache if we go with xinc
  • Java runtime, ant, JDK for WebTest
  • MySQL (and in the future, other databases)

Is Free still offering a box (or two)? Maybe we can set this up ourselves.

@mattab
Copy link
Member Author

mattab commented May 17, 2010

Anthon,
Yes the servers are still available. I can give you the details by email if you'd like to give it a try.

@robocoder
Copy link
Contributor

Should test Piwik with:

  • safe_mode disabled and no open_basedir restriction
  • safe_mode enabled
  • open_basedir restriction
  • safe_mode enabled and open_basedir restriction

To test the one click update process, a script could download and install the latest release (latest.zip). Then instead of api.piwik.org/1.0/getLatestVersion, it could check api.piwik.org/1.0/getLatestSvnRevision, and update to the latest svn snapshot, e.g., !http://dev.piwik.org/trac/changeset/{latest revision}/trunk?old_path=%2F&format=zip. (Unlike the build script, Trac packages it in the "trunk" folder instead of "piwik".) It gets a little trickier because the piwik_option table stores the version number in UpdateCheck_LatestVersion, not the SVN version.

@robocoder
Copy link
Contributor

It would be nice if there was some support for tinderbox-like scripts to collect build results from remote build servers because it would be desirable to have builds continuously tested on Windows IIS and XAMPP.

@robocoder
Copy link
Contributor

Should also include testing with E_STRICT because some environments don't permit the error_reporting level to be overridden by .htaccess or scripts.

@robocoder
Copy link
Contributor

(In [2269]) refs #818 - unit tests with both pdo_mysql and mysqli adapters

@robocoder
Copy link
Contributor

(In [2270]) refs #818 - fix typo in target

@robocoder
Copy link
Contributor

(In [2271]) refs #818 - bamboo.openx.org doesn't have mysqli extension ... comment out for now

@robocoder
Copy link
Contributor

Replying to vipsoft:

It would be nice if there was some support for tinderbox-like scripts to collect build results from remote build servers because it would be desirable to have builds continuously tested on Windows IIS and XAMPP.

Cool. Hudson and Bamboo support remote agents, or on the cloud (Amazon EC2) -- what Atlassian calls "elastic agents". Neither provide Amazon Machine Images for Windows, nor support for Microsoft Azure.

@robocoder
Copy link
Contributor

Minor issue with Hudson on Jetty: http://issues.hudson-ci.org/browse/HUDSON-6760

@robocoder
Copy link
Contributor

(In [2318]) refs #818 - build directory missing a folder

@robocoder
Copy link
Contributor

Note to self: It appears there's a bug in HtmlUnit 2.7 that causes WebTest R_1804 to fail the web test after sign in. Sizzle.filter (in jquery.js 1.4.2) is throwing an exception (Syntax error, unrecognized expression: ul li) for this selector in superfish-modified.js, "li:has(ul li)".

@mattab
Copy link
Member Author

mattab commented Jun 30, 2010

Anthon, I have a few questions

  • Will Hudson run on Mysql, mysqli all tests?
  • Is there a way to trigger the JS tests for piwik.js, as well as unit tests and webtests?
  • Would it be better if we migrate to PhpUnit if we want to have the unit tests ran easily (right now Bamboo doesn't parse Simpletest output)

I'm working on acceptance tests that will test Tracker with known data sets, and then call all API methods and Widgets, and check the XML/ HTML output. I hope to finish this in the next few days, which would give great coverage to Piwik testing. Do you know when Hudson service could be available, any chance before end of Month/1.0 release?

Thanks

@robocoder
Copy link
Contributor

Replying to matt:

Anthon, I have a few questions

  • Will Hudson run on Mysql, mysqli all tests?

Eventually. I commented out the mysqli unit test because bamboo.openx.org (or rather its elastic agent) doesn't have the mysqli extension installed.

  • Is there a way to trigger the JS tests for piwik.js, as well as unit tests and webtests?

We could use webtest (via HtmlUnit browser simulation). Need to investigate further.

  • Would it be better if we migrate to PhpUnit if we want to have the unit tests ran easily (right now Bamboo doesn't parse Simpletest output)

I might be able to wrap it in a webtest testcase.

I'm working on acceptance tests that will test Tracker with known data sets, and then call all API methods and Widgets, and check the XML/ HTML output. I hope to finish this in the next few days, which would give great coverage to Piwik testing. Do you know when Hudson service could be available, any chance before end of Month/1.0 release?

As of last nite, I have it running locally but the webtest is failing on the second-to-last step. I tried using Webtest 3.0 and the same version of webtest as on bamboo.openx.org (r 1783) but both choked, so I'm now running the latest snapshot and trying to locate the source of the failure in HtmlUnit. Right now, it's not looking hopeful for end-of-the-month.

@robocoder
Copy link
Contributor

Re: piwik.js. It looks like we can use Selenium for native browser testing. (There's a Hudson plugin for this.)

@robocoder
Copy link
Contributor

(In [2414]) refs #818 - phpdoc 1.4.3 expects this to be an absolute path

@robocoder
Copy link
Contributor

Looks like #660 works around the problem in HtmlUnit.

I'm going to start moving my build setup over to dev6.

@mattab
Copy link
Member Author

mattab commented Jul 1, 2010

Awesome.

The continuous build server running Unit tests as well as webtests will be a life saver!! (not to note the possibility of running mysqli and later postgresql...)

@robocoder
Copy link
Contributor

Another option for native browser testing of piwik.js is to run our own Testswarm instance. http://wiki.github.com/jeresig/testswarm/

@robocoder
Copy link
Contributor

It looks like bamboo.openx.org is down, so there's greater urgency to get this setup on dev6.

In r2429, Matt indicates that Config.test.php fails when run standalone. We should definitely consider iterating through the unit tests, in addition to all_tests.php, as this can catch some side-effects (due to globals).

@mattab
Copy link
Member Author

mattab commented Jul 6, 2010

Fixed the config.test.php in r2433

@robocoder
Copy link
Contributor

(In [2445]) refs #818 - add webtest wrapper around unit tests

@robocoder
Copy link
Contributor

Hudson is now running at http://qa.piwik.org:8080/ with some the unit tests are failing. (See other tickets.)

I'll open a new ticket for improvements.

@halfdan
Copy link
Member

halfdan commented Jul 11, 2010

Nice work! The feeds are broken though:

http://qa.piwik.org:8080/hudson/rssFailed

The items links to iproxy.ca:8080.

@robocoder
Copy link
Contributor

(In [2485]) Refs #818 - upcase words in installation steps; use "JavaScript" consistently; fixes WebTest (installation)

Artifacts can be access through the "Workspace" link, once you're logged in, e.g.,

(There's a configuration option to archive artifacts somewhere...)

Yes, the plan is to use Piwik_QA to tweet build results.

@halfdan
Copy link
Member

halfdan commented Jul 13, 2010

Is it possible to make Artifacts public? I can't login and would very much like to see the current build status and possible errors.

http://trac-hacks.org/wiki/HudsonTracPlugin would be nice for trac to see the build history from hudson in the trac timeline.

@robocoder
Copy link
Contributor

re: public artifacts are possible, but we'll have to review the artifacts to ensure no passwords and internal paths are disclosed.

re: hudson trac plugin. Good idea. We don't currently use the Bamboo Trac plugin that's currently installed.

@robocoder
Copy link
Contributor

I've rebuilt php with --enable-mbstring, so the mb_convert_encoding calls work (requires for .csv and .tsv output).

The webtest wrapper on the unit tests is currently failing because the output isn't proper html, eg text before the <html> and after the </html>.

http://qa.piwik.org:8080/hudson/job/Piwik/ws/default/tests/results/002_UnitTests/001_response_invoke.xml/*view*/

@robocoder
Copy link
Contributor

(In [2488]) refs #818 - clean up output

@robocoder
Copy link
Contributor

(In [2489]) refs #818

@robocoder
Copy link
Contributor

Current status of our Hudson server:

  • php 5.2.13 and pdo_mysql
  • unit tests via php-cli (excludes tests/integration) passes
  • webtest install passes
  • webtest unit tests (includes tests/integration) passes
  • phpdocs generated

@mattab
Copy link
Member Author

mattab commented Jul 13, 2010

Are the phpdocs artifacts available for download? It would be cool to link the http://piwik.org/docs/tracking-api/ doc page to the PiwikTracker API page (to the doc from latest successful build maybe?).

@robocoder
Copy link
Contributor

I made some configuration changes to the job, but they're not having any effect. It appears that webtest results are treated as build artifacts, and artifacts are not published if the build fails.

I'll try scripting a workaround.

@robocoder
Copy link
Contributor

@robocoder
Copy link
Contributor

In [2502], exclude integration tests if REQUEST_UR or HTTP_HOST not defined; this means we can now fully test with php-cli if these CGI environment variables are defined.

@robocoder
Copy link
Contributor

(In [2503]) refs #818 - PATH_INFO and SCRIPT_NAME are also accepted

@mattab
Copy link
Member Author

mattab commented Jul 15, 2010

Great for artifacts. Should the URL be prefixed by the job ID? (or do we only keep artifacts for last build?)

@mattab
Copy link
Member Author

mattab commented Jul 15, 2010

When you say, "if generated", are the latest successful build doc pages always going to be there (ie. failing builds don't delete old docs). Can I safely link to http://qa.piwik.org/phpdocs/Piwik/PiwikTracker.html ?

@robocoder
Copy link
Contributor

Webtest results are only for the latest build.

Yes, should be safe to link to the docs. It's only overwritten if the build succeeds.

@mattab
Copy link
Member Author

mattab commented Jul 15, 2010

I linked the page from the bottom of: http://piwik.org/docs/tracking-api/

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Website matomo.org For issues related to our matomo.org website. Critical Indicates the severity of an issue is very critical and the issue has a very high priority. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

4 participants