Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

IndexedByDate.getDataTableFromNumeric() lack of 'order by' breaks integration tests #2154

Closed
JulienMoumne opened this Issue · 2 comments

2 participants

Julien Moumné Anthon Pang
Julien Moumné
Collaborator

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.

Anthon Pang
Collaborator

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.

Julien Moumné
Collaborator

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

Julien Moumné JulienMoumne added this to the Piwik 1.2.1 milestone
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.