Edit Project

Built 51b4900 successfully

added reference to CI server

by: Marco Otte-Witte | on Sep 18th | commit: 51b49004e197edbced94eb626c6eed58cc7a4e72

Build Output:

(in /srv/www/ci.simplabs.com/builds/marcoow-reports_as_sparkline-master)
-- create_table(:users, {:force=>true})
   -> 0.2649s
-- create_table(:reports_as_sparkline_cache, {:force=>true})
   -> 0.0132s
-- add_index(:reports_as_sparkline_cache, [:model_name, :report_name, :grouping, :aggregation], {:name=>:name_model_grouping_agregation_run_limit})
   -> 0.0048s
-- add_index(:reports_as_sparkline_cache, [:model_name, :report_name, :grouping, :aggregation, :reporting_period], {:name=>:name_model_grouping_aggregation_period_run_limit, :unique=>true})
   -> 0.0039s
-- initialize_schema_migrations_table()
   -> 0.0003s
-- assume_migrated_upto_version(1)
   -> 0.0003s

Simplabs::ReportsAsSparkline::CumulatedReport#run
- should cumulate the data
- should return an array of the same length as the specified limit when :live_data is false
- should return an array of the same length as the specified limit + 1 when :live_data is true

Simplabs::ReportsAsSparkline::CumulatedReport#run for grouping hour with :live_data = true
- should return correct data for aggregation :count
- should return correct data for aggregation :sum
- should return correct data for aggregation :count when custom conditions are specified
- should return correct data for aggregation :sum when custom conditions are specified

Simplabs::ReportsAsSparkline::CumulatedReport#run for grouping hour with :live_data = true the returned result
- should be an array starting reporting period (Time.now - limit.hour)
- should be data ending with the current reporting period

Simplabs::ReportsAsSparkline::CumulatedReport#run for grouping hour with :live_data = false
- should return correct data for aggregation :count
- should return correct data for aggregation :sum
- should return correct data for aggregation :count when custom conditions are specified
- should return correct data for aggregation :sum when custom conditions are specified

Simplabs::ReportsAsSparkline::CumulatedReport#run for grouping hour with :live_data = false the returned result
- should be an array starting reporting period (Time.now - limit.hour)
- should be data ending with the reporting period before the current

Simplabs::ReportsAsSparkline::CumulatedReport#run for grouping day with :live_data = true
- should return correct data for aggregation :count
- should return correct data for aggregation :sum
- should return correct data for aggregation :count when custom conditions are specified
- should return correct data for aggregation :sum when custom conditions are specified

Simplabs::ReportsAsSparkline::CumulatedReport#run for grouping day with :live_data = true the returned result
- should be an array starting reporting period (Time.now - limit.day)
- should be data ending with the current reporting period

Simplabs::ReportsAsSparkline::CumulatedReport#run for grouping day with :live_data = false
- should return correct data for aggregation :count
- should return correct data for aggregation :sum
- should return correct data for aggregation :count when custom conditions are specified
- should return correct data for aggregation :sum when custom conditions are specified

Simplabs::ReportsAsSparkline::CumulatedReport#run for grouping day with :live_data = false the returned result
- should be an array starting reporting period (Time.now - limit.day)
- should be data ending with the reporting period before the current

Simplabs::ReportsAsSparkline::CumulatedReport#run for grouping week with :live_data = true
- should return correct data for aggregation :count
- should return correct data for aggregation :sum
- should return correct data for aggregation :count when custom conditions are specified
- should return correct data for aggregation :sum when custom conditions are specified

Simplabs::ReportsAsSparkline::CumulatedReport#run for grouping week with :live_data = true the returned result
- should be an array starting reporting period (Time.now - limit.week)
- should be data ending with the current reporting period

Simplabs::ReportsAsSparkline::CumulatedReport#run for grouping week with :live_data = false
- should return correct data for aggregation :count
- should return correct data for aggregation :sum
- should return correct data for aggregation :count when custom conditions are specified
- should return correct data for aggregation :sum when custom conditions are specified

Simplabs::ReportsAsSparkline::CumulatedReport#run for grouping week with :live_data = false the returned result
- should be an array starting reporting period (Time.now - limit.week)
- should be data ending with the reporting period before the current

Simplabs::ReportsAsSparkline::CumulatedReport#run for grouping month with :live_data = true
- should return correct data for aggregation :count
- should return correct data for aggregation :sum
- should return correct data for aggregation :count when custom conditions are specified
- should return correct data for aggregation :sum when custom conditions are specified

Simplabs::ReportsAsSparkline::CumulatedReport#run for grouping month with :live_data = true the returned result
- should be an array starting reporting period (Time.now - limit.month)
- should be data ending with the current reporting period

Simplabs::ReportsAsSparkline::CumulatedReport#run for grouping month with :live_data = false
- should return correct data for aggregation :count
- should return correct data for aggregation :sum
- should return correct data for aggregation :count when custom conditions are specified
- should return correct data for aggregation :sum when custom conditions are specified

Simplabs::ReportsAsSparkline::CumulatedReport#run for grouping month with :live_data = false the returned result
- should be an array starting reporting period (Time.now - limit.month)
- should be data ending with the reporting period before the current

Simplabs::ReportsAsSparkline::CumulatedReport#cumulate
- should correctly cumulate the given data

Simplabs::ReportsAsSparkline::Grouping#new
- should raise an error if an unsupported grouping is specified

Simplabs::ReportsAsSparkline::Grouping#to_sql for MySQL
- should use DATE_FORMAT with format string "%Y/%m/%d/%H" for grouping :hour
- should use DATE_FORMAT with format string "%Y/%m/%d" for grouping :day
- should use YEARWEEK with mode 3 for grouping :week
- should use DATE_FORMAT with format string "%Y/%m" for grouping :month

Simplabs::ReportsAsSparkline::Grouping#to_sql for PostgreSQL
- should use date_trunc with truncation identifier "hour" for grouping :hour
- should use date_trunc with truncation identifier "day" for grouping :day
- should use date_trunc with truncation identifier "week" for grouping :week
- should use date_trunc with truncation identifier "month" for grouping :month

Simplabs::ReportsAsSparkline::Grouping#to_sql for SQLite3
- should use strftime with format string "%Y/%m/%d/%H" for grouping :hour
- should use strftime with format string "%Y/%m/%d" for grouping :day
- should use date with mode "weekday 0" for grouping :week
- should use strftime with format string "%Y/%m" for grouping :month

Simplabs::ReportsAsSparkline::Grouping#date_parts_from_db_string for SQLite3
- should split the string with '/' for grouping :hour
- should split the string with '/' for grouping :day
- should split the string with '/' for grouping :month
- should split the string with "-" and return teh calendar year and week for grouping :week

Simplabs::ReportsAsSparkline::Grouping#date_parts_from_db_string for PostgreSQL
- should split the date part of the string with "-" and read out the hour for grouping :hour
- should split the date part of the string with "-" for grouping :day
- should split the date part of the string with "-" and calculate the calendar week for grouping :week
- should split the date part of the string with "-" and return year and month for grouping :month

Simplabs::ReportsAsSparkline::Grouping#date_parts_from_db_string for MySQL
- should split the string with '/' for grouping :hour
- should split the string with '/' for grouping :day
- should split the string with '/' for grouping :month
- should use the first 4 numbers for the year and the last 2 numbers for the week for grouping :week

Simplabs::ReportsAsSparkline::ReportCache.clear_for
- should delete all entries in the cache for the klass and report name

Simplabs::ReportsAsSparkline::ReportCache.process
- should raise an ArgumentError if no block is given
- sould start a transaction
- should read existing data from the cache
- should utilize the end_date in the conditions
- should read existing data from the cache for the correct grouping if one other than the report's default grouping is specified
- should yield the first reporting period if the cache is empty

Simplabs::ReportsAsSparkline::ReportCache.process with :live_data = true
- should yield to the given block
- should yield the first reporting period if not all required data could be retrieved from the cache
- should yield the reporting period after the last one in the cache if all required data could be retrieved from the cache

Simplabs::ReportsAsSparkline::ReportCache.process with :live_data = false
- should not yield if all required data could be retrieved from the cache
- should yield to the block if no data could be retrieved from the cache

Simplabs::ReportsAsSparkline::ReportCache.process with :live_data = false with :end_date = <some date>
- should yield the last date and time of the reporting period for the specified end date

Simplabs::ReportsAsSparkline::ReportCache.process with cache = false
- should not read any data from cache
- should yield the first reporting period

Simplabs::ReportsAsSparkline::ReportCache.prepare_result
- should create :limit instances of Simplabs::ReportsAsSparkline::ReportCache with value 0.0 if no new data has been read and nothing was cached
- should create a new Simplabs::ReportsAsSparkline::ReportCache with the correct value if new data has been read
- should save the created Simplabs::ReportsAsSparkline::ReportCache
- should return an array of arrays of Dates and Floats

Simplabs::ReportsAsSparkline::ReportCache.prepare_result with :live_data = false
- should return an array of length :limit
- should not include an entry for the current reporting period

Simplabs::ReportsAsSparkline::ReportCache.prepare_result with :live_data = true
- should return an array of length (:limit + 1)
- should include an entry for the current reporting period

Simplabs::ReportsAsSparkline::ReportCache.prepare_result with cache = false
- should not save the created Simplabs::ReportsAsSparkline::ReportCache

Simplabs::ReportsAsSparkline::ReportCache.find_value
- should return the correct value when new data has been read for the reporting period
- should return 0.0 when no data has been read for the reporting period

Simplabs::ReportsAsSparkline::Report#options
- should be frozen

Simplabs::ReportsAsSparkline::Report#run
- should process the data with the report cache
- should process the data with the report cache and specify cache = false when custom conditions are given
- should validate the specified options for the :run context
- should use a custom grouping if one is specified
- should return an array of the same length as the specified limit when :live_data is false
- should return an array of the same length as the specified limit + 1 when :live_data is true

Simplabs::ReportsAsSparkline::Report#run for grouping :hour when :end_date is specified
- should not raise a SQL duplicate key error after multiple runs

Simplabs::ReportsAsSparkline::Report#run for grouping :hour when :end_date is specified the returned result
- should start with the reporting period (end_date - limit.hour)
- should end with the reporting period of the specified end date

Simplabs::ReportsAsSparkline::Report#run for grouping :hour with :live_data = true
- should return correct data for aggregation :count
- should return correct data for aggregation :sum
- should return correct data for aggregation :maximum
- should return correct data for aggregation :minimum
- should return correct data for aggregation :average
- should return correct data for aggregation :count when custom conditions are specified
- should return correct data for aggregation :sum when custom conditions are specified
- should return correct results when run twice in a row with a higher limit on the second run

Simplabs::ReportsAsSparkline::Report#run for grouping :hour with :live_data = true the returned result
- should be an array starting reporting period (Time.now - limit.hour)
- should be data ending with the current reporting period

Simplabs::ReportsAsSparkline::Report#run for grouping :hour with :live_data = false
- should return correct data for aggregation :count
- should return correct data for aggregation :sum
- should return correct data for aggregation :maximum
- should return correct data for aggregation :minimum
- should return correct data for aggregation :average
- should return correct data for aggregation :count when custom conditions are specified
- should return correct data for aggregation :sum when custom conditions are specified
- should return correct results when run twice in a row with a higher limit on the second run
- should return correct data for aggregation :count when :end_date is specified
- should return correct data for aggregation :sum when :end_date is specified
- should return correct results when run twice in a row with an end date further in the past on the second run

Simplabs::ReportsAsSparkline::Report#run for grouping :hour with :live_data = false the returned result
- should be an array starting reporting period (Time.now - limit.hour)
- should be data ending with the reporting period before the current

Simplabs::ReportsAsSparkline::Report#run for grouping :day when :end_date is specified
- should not raise a SQL duplicate key error after multiple runs

Simplabs::ReportsAsSparkline::Report#run for grouping :day when :end_date is specified the returned result
- should start with the reporting period (end_date - limit.day)
- should end with the reporting period of the specified end date

Simplabs::ReportsAsSparkline::Report#run for grouping :day with :live_data = true
- should return correct data for aggregation :count
- should return correct data for aggregation :sum
- should return correct data for aggregation :maximum
- should return correct data for aggregation :minimum
- should return correct data for aggregation :average
- should return correct data for aggregation :count when custom conditions are specified
- should return correct data for aggregation :sum when custom conditions are specified
- should return correct results when run twice in a row with a higher limit on the second run

Simplabs::ReportsAsSparkline::Report#run for grouping :day with :live_data = true the returned result
- should be an array starting reporting period (Time.now - limit.day)
- should be data ending with the current reporting period

Simplabs::ReportsAsSparkline::Report#run for grouping :day with :live_data = false
- should return correct data for aggregation :count
- should return correct data for aggregation :sum
- should return correct data for aggregation :maximum
- should return correct data for aggregation :minimum
- should return correct data for aggregation :average
- should return correct data for aggregation :count when custom conditions are specified
- should return correct data for aggregation :sum when custom conditions are specified
- should return correct results when run twice in a row with a higher limit on the second run
- should return correct data for aggregation :count when :end_date is specified
- should return correct data for aggregation :sum when :end_date is specified
- should return correct results when run twice in a row with an end date further in the past on the second run

Simplabs::ReportsAsSparkline::Report#run for grouping :day with :live_data = false the returned result
- should be an array starting reporting period (Time.now - limit.day)
- should be data ending with the reporting period before the current

Simplabs::ReportsAsSparkline::Report#run for grouping :week when :end_date is specified
- should not raise a SQL duplicate key error after multiple runs

Simplabs::ReportsAsSparkline::Report#run for grouping :week when :end_date is specified the returned result
- should start with the reporting period (end_date - limit.week)
- should end with the reporting period of the specified end date

Simplabs::ReportsAsSparkline::Report#run for grouping :week with :live_data = true
- should return correct data for aggregation :count
- should return correct data for aggregation :sum
- should return correct data for aggregation :maximum
- should return correct data for aggregation :minimum
- should return correct data for aggregation :average
- should return correct data for aggregation :count when custom conditions are specified
- should return correct data for aggregation :sum when custom conditions are specified
- should return correct results when run twice in a row with a higher limit on the second run

Simplabs::ReportsAsSparkline::Report#run for grouping :week with :live_data = true the returned result
- should be an array starting reporting period (Time.now - limit.week)
- should be data ending with the current reporting period

Simplabs::ReportsAsSparkline::Report#run for grouping :week with :live_data = false
- should return correct data for aggregation :count
- should return correct data for aggregation :sum
- should return correct data for aggregation :maximum
- should return correct data for aggregation :minimum
- should return correct data for aggregation :average
- should return correct data for aggregation :count when custom conditions are specified
- should return correct data for aggregation :sum when custom conditions are specified
- should return correct results when run twice in a row with a higher limit on the second run
- should return correct data for aggregation :count when :end_date is specified
- should return correct data for aggregation :sum when :end_date is specified
- should return correct results when run twice in a row with an end date further in the past on the second run

Simplabs::ReportsAsSparkline::Report#run for grouping :week with :live_data = false the returned result
- should be an array starting reporting period (Time.now - limit.week)
- should be data ending with the reporting period before the current

Simplabs::ReportsAsSparkline::Report#run for grouping :month when :end_date is specified
- should not raise a SQL duplicate key error after multiple runs

Simplabs::ReportsAsSparkline::Report#run for grouping :month when :end_date is specified the returned result
- should start with the reporting period (end_date - limit.month)
- should end with the reporting period of the specified end date

Simplabs::ReportsAsSparkline::Report#run for grouping :month with :live_data = true
- should return correct data for aggregation :count
- should return correct data for aggregation :sum
- should return correct data for aggregation :maximum
- should return correct data for aggregation :minimum
- should return correct data for aggregation :average
- should return correct data for aggregation :count when custom conditions are specified
- should return correct data for aggregation :sum when custom conditions are specified
- should return correct results when run twice in a row with a higher limit on the second run

Simplabs::ReportsAsSparkline::Report#run for grouping :month with :live_data = true the returned result
- should be an array starting reporting period (Time.now - limit.month)
- should be data ending with the current reporting period

Simplabs::ReportsAsSparkline::Report#run for grouping :month with :live_data = false
- should return correct data for aggregation :count
- should return correct data for aggregation :sum
- should return correct data for aggregation :maximum
- should return correct data for aggregation :minimum
- should return correct data for aggregation :average
- should return correct data for aggregation :count when custom conditions are specified
- should return correct data for aggregation :sum when custom conditions are specified
- should return correct results when run twice in a row with a higher limit on the second run
- should return correct data for aggregation :count when :end_date is specified
- should return correct data for aggregation :sum when :end_date is specified
- should return correct results when run twice in a row with an end date further in the past on the second run

Simplabs::ReportsAsSparkline::Report#run for grouping :month with :live_data = false the returned result
- should be an array starting reporting period (Time.now - limit.month)
- should be data ending with the reporting period before the current

Simplabs::ReportsAsSparkline::Report#run for grouping week with data ranging over two years with the first week of the second year belonging to the first year
- should return correct data for aggregation :count

Simplabs::ReportsAsSparkline::Report#run for grouping week with data ranging over two years with the first week of the second year belonging to the second year
- should return correct data for aggregation :count

Simplabs::ReportsAsSparkline::Report#read_data
- should invoke the aggregation method on the model
- should setup the conditions

Simplabs::ReportsAsSparkline::Report#setup_conditions
- should return conditions for date_column BETWEEN begin_at and end_at only when no custom conditions are specified and both begin and end date are specified
- should return conditions for date_column >= begin_at when no custom conditions and a begin_at are specified
- should return conditions for date_column <= end_at when no custom conditions and a end_at are specified
- should raise an argument error when neither begin_at or end_at are specified
- should return conditions for date_column BETWEEN begin_at and end_date only when an empty Hash of custom conditions is specified
- should return conditions for date_column BETWEEN begin_at and end_date only when an empty Array of custom conditions is specified
- should correctly include custom conditions if they are specified as a Hash
- should correctly include custom conditions if they are specified as an Array

Simplabs::ReportsAsSparkline::Report#ensure_valid_options
- should raise an error if malformed conditions are specified
- should not raise an error if conditions are specified as an Array
- should not raise an error if conditions are specified as a Hash
- should raise an error if an invalid grouping is specified
- should raise an error if an end date is specified that is not a DateTime
- should raise an error if an end date is specified that is in the future
- should raise an error if both an end date and :live_data = true are specified
- should not raise an error if both an end date and :live_data = false are specified

Simplabs::ReportsAsSparkline::Report#ensure_valid_options for context :initialize
- should not raise an error if valid options are specified
- should raise an error if an unsupported option is specified
- should raise an error if an invalid aggregation is specified
- should raise an error if aggregation :sum is spesicied but no :value_column

Simplabs::ReportsAsSparkline::Report#ensure_valid_options for context :run
- should not raise an error if valid options are specified
- should raise an error if an unsupported option is specified

Simplabs::ReportsAsSparkline::ReportingPeriod#date_time
- should return the date and time with minutes = seconds = 0 for grouping :hour
- should return the date part only for grouping :day
- should return the date with day = 1 for grouping :month

Simplabs::ReportsAsSparkline::ReportingPeriod#date_time for grouping :week
- should return the date of the monday of the week date_time is in for any day in that week
- should return the date of the monday of the week date_time is in when the specified date is a monday already
- should return the date of the monday of the week date_time is in when the monday is in a different month than the specified date
- should return the date of the monday of the week date_time is in when the monday is in a different year than the specified date

Simplabs::ReportsAsSparkline::ReportingPeriod#last_date_time
- should return the date and time with minutes = seconds = 59 for grouping :hour
- should return the date part with hour = 23 and minute = seconds = 59 for grouping :day
- should return the date of the last day of the month for grouping :month

Simplabs::ReportsAsSparkline::ReportingPeriod#last_date_time for grouping :week
- should return the date of the sunday of the week date_time is in for any day in that week
- should return the date of the sunday of the week date_time is in when the sunday is in a different month than the specified date
- should return the date of the sunday of the week date_time is in when the sunday is in a different year than the specified date

Simplabs::ReportsAsSparkline::ReportingPeriod.from_db_string
- should return a reporting period with the correct date and time and with minutes = seconds = 0 for grouping :hour
- should return a reporting period with the date part only for grouping :day
- should return a reporting period with the date part of the monday of the week the date is in for grouping :week
- should return a reporting period with the correct date and with day = 1 for grouping :month

Simplabs::ReportsAsSparkline::ReportingPeriod#next
- should return a reporting period with date and time one hour after the current period for grouping :hour
- should return a reporting period with date one day after the current period for grouping :day
- should return a reporting period with date one week after the current period for grouping :week
- should return a reporting period with date of the first day in the month one month after the current period

Simplabs::ReportsAsSparkline::ReportingPeriod#previous
- should return a reporting period with date and time one hour before the current period for grouping :hour
- should return a reporting period with date one day before the current period for grouping :day
- should return a reporting period with date one week before the current period for grouping :week
- should return a reporting period with date of the first day in the month one month before the current period

Simplabs::ReportsAsSparkline::ReportingPeriod#==
- should return true for 2 reporting periods with the same date_time and grouping
- should return false for 2 reporting periods with the same date_time but different groupings
- should return true for 2 reporting periods with the same grouping but different date_times if the date times evaluate to the same reporting period identifier
- should return false for 2 reporting periods with the same grouping but different date_times if the date times evaluate to different reporting period identifiers

Simplabs::ReportsAsSparkline::ReportingPeriod#== when invoked with DateTimes or Times for grouping :hour
- should return true when the date and hour are equal

Simplabs::ReportsAsSparkline::ReportingPeriod#== when invoked with DateTimes or Times for grouping :day
- should return true when the date is equal

Simplabs::ReportsAsSparkline::ReportingPeriod#== when invoked with DateTimes or Times for grouping :week
- should return true when the date of the first day in that week is equal

Simplabs::ReportsAsSparkline::ReportingPeriod#== when invoked with DateTimes or Times for grouping :month
- should return true when the date of the first day in that month is equal

Simplabs::ReportsAsSparkline::ReportingPeriod.first
- should return a reporting period with the date part of (DateTime.now - limit.hours with minutes = seconds = 0 for grouping :hour
- should return a reporting period with the date part of (DateTime.now - limit.days) for grouping :day
- should return a reporting period with the date of the first day of the month at (DateTime.now - limit.months) for grouping :month
- should return a reporting period with the date of the monday of the week at (DateTime.now - limit.weeks) for grouping :week

Simplabs::ReportsAsSparkline for inherited models
- should include all data when invoked on the base model class
- should include only data for instances of the inherited model when invoked on the inherited model class

Simplabs::ReportsAsSparkline::SparklineTagHelper#sparkline_tag
- should render an image with the correct source
- should add parameters for labels to the source of the image if rendering of lables is specified
- should set the parameters for custom colors if custom colors are specified

Finished in 22.327703 seconds

282 examples, 0 failures

Previous builds