Fixed a lot of linter warnings
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2023-12-11 13:08:46 -05:00
parent 34741691ed
commit 516f125ea7
14 changed files with 76 additions and 34 deletions

View File

@ -1,27 +1,30 @@
# frozen_string_literal: true
# Test - database model for PC hardware tests
class Test < Sequel::Model
one_to_many :results # link Test model to its related results
many_to_one :benchmark # link Test model back to its benchmark
many_to_one :hardware # link Test model back to hardware used in test
one_to_many :results # link Test model to its related results
many_to_one :benchmark # link Test model back to its benchmark
many_to_one :hardware # link Test model back to hardware used in test
# formats the name of the test for display in the web UI
def formatted_name()
return "#{self.date_tag} - #{self.hardware.name} / #{self.benchmark.name}"
def formatted_name
return "#{@date_tag} - #{@hardware.name} / #{@benchmark.name}"
end
# formats the name of the test for use in a graph
def graph_name()
return "#{self.hardware.name} (#{self.date_tag})"
def graph_name
return "#{@hardware.name} (#{@date_tag})"
end
# determines whether the test has enough results to fulfill the requirement
def valid?()
return (self.results.length >= $conf.get('testing.minimum_results_required'))
def valid?
return (@results.length >= $conf.get('testing.minimum_results_required'))
end
# determines how many results are still missing for a test
def missing_results()
return ($conf.get('testing.minimum_results_required') - self.results.length)
def missing_results
return ($conf.get('testing.minimum_results_required') - @results.length)
end
end