Skip to content

Commit

Permalink
[ci] Comments for things only needed in the tests
Browse files Browse the repository at this point in the history
Add comments of things that things that can be improved when we remove the old
test suite.
  • Loading branch information
Ana06 committed Mar 17, 2017
1 parent df9d938 commit d561995
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/api/app/models/package.rb
Expand Up @@ -399,6 +399,8 @@ def sources_changed(opts = {})
dir_xml = opts[:dir_xml]

# to call update_activity before filter
# NOTE: We need `Time.now`, otherwise the old tests suite doesn't work,
# remove it when removing the tests
update({updated_at: Time.now})

# mark the backend infos "dirty"
Expand Down Expand Up @@ -802,7 +804,8 @@ def to_axml(_opts = {})

def self.activity_algorithm
# this is the algorithm (sql) we use for calculating activity of packages
# we use Time.now.to_i instead of UNIX_TIMESTAMP() so we can test with frozen ruby time
# NOTE: We use Time.now.to_i instead of UNIX_TIMESTAMP() so we can test with frozen ruby time in the old tests suite,
# change it when removing the tests
'( packages.activity_index * ' +
"POWER( 2.3276, (UNIX_TIMESTAMP(packages.updated_at) - #{Time.now.to_i})/10000000 ) " +
') as activity_value'
Expand Down

0 comments on commit d561995

Please sign in to comment.