@julienmoumne opened this Issue on March 6th 2011 Member

I have a failing integration test concerning test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_day.xml

Expected is

            <nb_uniq_visitors_returning>1</nb_uniq_visitors_returning>
            <nb_visits_returning>1</nb_visits_returning>
            <nb_actions_returning>4</nb_actions_returning>
            <max_actions_returning>4</max_actions_returning>
            <sum_visit_length_returning>900</sum_visit_length_returning>
            <bounce_rate_returning>0%</bounce_rate_returning>
            <nb_actions_per_visit_returning>4</nb_actions_per_visit_returning>
            <avg_time_on_site_returning>900</avg_time_on_site_returning>

I have


            <max_actions_returning>4</max_actions_returning>
            <nb_actions_returning>4</nb_actions_returning>
            <nb_uniq_visitors_returning>1</nb_uniq_visitors_returning>
            <nb_visits_returning>1</nb_visits_returning>
            <sum_visit_length_returning>900</sum_visit_length_returning>
            <bounce_rate_returning>0%</bounce_rate_returning>
            <nb_actions_per_visit_returning>4</nb_actions_per_visit_returning>
            <avg_time_on_site_returning>900</avg_time_on_site_returning>

Markups are not in the same order.

There is no 'order by' clause at https://github.com/piwik/piwik/blob/master/core/Archive/Array/IndexedByDate.php#L108 so it's not clear which order should be tested.

Same is true for test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_day.xml.

@robocoder commented on March 7th 2011 Contributor

There's a ksort on timestamps on line 136. I suppose we can either:

  • at line 141, insert a ksort($contentArray($timestamp)) inside the foreach loop, or
  • remove the ksort and add an "ORDER BY date1,name".

Not sure how much peak memory usage it'll reduce, but I'd go with the latter.

@julienmoumne commented on March 9th 2011 Member

(In [4051]) fixes #2154 - ordering getDataTableFromNumeric query by date and name & updating expected output

This Issue was closed on March 9th 2011
Powered by GitHub Issue Mirror