Opened 20 months ago

Closed 18 months ago

Last modified 12 months ago

#3323 closed Task (fixed)

Include scheduled reports in integration tests

Reported by: JulienM Owned by: JulienM
Priority: normal Milestone: 1.9.2 - Piwik 1.9.2
Component: Core Keywords:
Cc: Sensitive: no

Description

Scheduled reports (PDF, HTML, SMS) are currently not part of the integration test suite.

Questions to address :

  • which format should be tested, in particular, PDF might be trickier (see attached example files)
  • whether graphs (images) should be included
  • which information should be removed, e.g: dates
  • which period(s) should be tested
  • I have attached a patch for OneVisitorTwoVisitsTest.php, how can it be applied to all integration tests with minimum code duplication ?

Change History (27)

comment:1 Changed 20 months ago by matt (mattab)

  • Milestone set to 1.8.4 - Piwik 1.8.4

Feedback

  • The attached html/pdf look good!
  • I don't think we should run the pdf/html tests on ALL tests. This would be too slow and not so useful. I think the main goal is to check that the basic use cases (ie. a report with tables, graphs, icons, etc.) work.
  • Graphs should be included... since they are not currently tested we could do "une pierre 2 coups". Maybe only put graphs in the PDF only to keep it simple?
  • TODO this maybe need to be updated after adding OUTPUT_RETURN It looks good like it, since we want to compare the output including the graphs inlined in the doc.

Thanks for looking into it: it always made me uneasy that HTML/PDF reports were not tested. Now that we also have SMS reports, and that the 2 plugins are loosely coupled, it is very good improvement to our QA to add these tests!

comment:2 Changed 20 months ago by matt (mattab)

which information should be removed, e.g: dates

Dates should stay since they won't/shouldn't change from run to run.

which period(s) should be tested

I'd say the period with the most data so that code coverage is maximum. For the test OneVisitorTwoVisits visits are on the same day so period=day is good enough.

comment:3 Changed 20 months ago by JulienM (JulienMoumne)

(In [6849]) refs #3323 #3088 #2708 #71 #2318

  • generate and compare HTML, PDF & SMS reports in Test_Piwik_Integration_EcommerceOrderWithItems & Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays
  • report content as return value of PDFReports->generateReport() with new output type OUTPUT_RETURN

comment:4 Changed 20 months ago by JulienM (JulienMoumne)

(In [6883]) refs #3323

  • integration test files can now have custom file extensions (e.g: .pdf, .html, .sms.txt)
  • removing hard coded list of reports


TODO: expected integration files need to be updated, pending GD discrepancy issues

comment:5 Changed 20 months ago by JulienM (JulienMoumne)

(In [6932]) refs #3323 - include images in scheduled reports only if system under test matches some technical characteristics of the Piwik QA Server

TODO

  • update method 'canImagesBeIncludedInScheduledReports' to match the new Piwik QA server when it will be up and running
  • build a vagrant VM with QA server specs, generate reports using it and override expected files

comment:6 Changed 20 months ago by SteveG (sgiehl)

Is there a reason why you made setUpScheduledReports non-static and moved the call to a seperate test case? I guess it was more correct before, as reports should be setup before running the tests (it's more part of the setup than of a test case). Btw: now it won't be possible only to run the api tests

comment:7 Changed 20 months ago by JulienM (JulienMoumne)

(In [6936]) refs #3323 follow best practices per comment:6:ticket:3323

comment:8 Changed 20 months ago by JulienM (JulienMoumne)

Do tell me if it's better like that. The idea is to warn the developer that some tests are being skipped because of system incompatibilities.

comment:9 Changed 20 months ago by JulienM (JulienMoumne)

  • Owner set to JulienM
  • Status changed from new to assigned

comment:10 Changed 20 months ago by JulienM (JulienMoumne)

(In [6946]) refs #3323 ignoring *.html, *.pdf and *.txt files in processed directory

comment:11 Changed 18 months ago by matt (mattab)

Looks good like that. I'm wondering if we should really test for images at all now, since most developers won't have images generated, but it could be helpful.. Can the ticket be closed?

comment:12 Changed 18 months ago by JulienM (JulienMoumne)

  • Resolution set to fixed
  • Status changed from assigned to closed

static png graphs will be tested on the integration server
this insures no regression will occur, especially since we are likely to refactor underlying libraries (pChart)

comment:13 Changed 17 months ago by JulienM (JulienMoumne)

(In [7557]) refs #3323 updating qa server specs for inclusion of static images in integration testing

comment:14 Changed 16 months ago by matt (mattab)

(In [7604]) Refs #3323 Scheduled Reports integration tests until they are generate in expected/ with the static images same features as Jenkins build

comment:15 Changed 16 months ago by JulienM (JulienMoumne)

(In [7613]) refs #3323

  • include back scheduled reports in integration tests
  • add readme section

comment:16 Changed 16 months ago by matt (mattab)

(In [7675]) refs #3323 some ubuntu precise simply output ubuntu, lets try to widen the boxes that can run static images in tests

PS: all pdf tests on my box!

comment:17 Changed 13 months ago by Julien Moumné

In f387a8914484fca089bd221bac660dd88909ec56:

refs #3323 enable static png images in integration tests across additional php versions

comment:18 Changed 12 months ago by Julien Moumné

In 824eceda83ccaaa96291301c81d90c2f6b2d6865:

refs #3323 remove unused expected integration files

comment:19 Changed 12 months ago by Julien Moumné

In 545c9998b75a38739e761b9157e988cf4aab77bd:

refs #3323 enable static png images in integration tests for travis-ci

comment:20 Changed 12 months ago by Julien Moumné

In efa5344a7f0618997d2a60edcb0bfb8c7d82c957:

refs #3323 exclude static png graph tests in travis-ci until I can set-up travis-ci gd version on my box

comment:21 Changed 12 months ago by matt (mattab)

thanks, travis is now green again :)

It will be good to use gd 2.0.34: I just realized most servers in productions are using this version.

Julien, after talking to Fabian, I think we should use phpenv on our dev boxes. Would you like to give it a try? I will also try to install it but if you do it first, thanks for posting here any instructions for ubuntu (which we can then add in the tests/README).

comment:23 Changed 12 months ago by Julien Moumné

In b993d279014b941611eb3fd9abca51bc8cfe7fa5:

refs #3323 test for one row evolution based png graph

Note: See TracTickets for help on using tickets.