Class: FtrRuby::TestInfra
- Inherits:
-
Object
- Object
- FtrRuby::TestInfra
- Defined in:
- lib/test_infrastructure.rb
Instance Attribute Summary collapse
-
#basepath ⇒ Object
Returns the value of attribute basepath.
-
#test_host ⇒ Object
Returns the value of attribute test_host.
-
#test_protocol ⇒ Object
Returns the value of attribute test_protocol.
Instance Method Summary collapse
-
#get_tests_metrics(tests:) ⇒ Object
there is a need to map between a test and its registered Metric in FS.
-
#initialize(test_host:, basepath:, test_protocol:) ⇒ TestInfra
constructor
A new instance of TestInfra.
Constructor Details
#initialize(test_host:, basepath:, test_protocol:) ⇒ TestInfra
Returns a new instance of TestInfra.
7 8 9 10 11 |
# File 'lib/test_infrastructure.rb', line 7 def initialize(test_host:, basepath:, test_protocol:) @test_host = test_host @test_protocol = test_protocol @basepath = basepath end |
Instance Attribute Details
#basepath ⇒ Object
Returns the value of attribute basepath.
5 6 7 |
# File 'lib/test_infrastructure.rb', line 5 def basepath @basepath end |
#test_host ⇒ Object
Returns the value of attribute test_host.
5 6 7 |
# File 'lib/test_infrastructure.rb', line 5 def test_host @test_host end |
#test_protocol ⇒ Object
Returns the value of attribute test_protocol.
5 6 7 |
# File 'lib/test_infrastructure.rb', line 5 def test_protocol @test_protocol end |
Instance Method Details
#get_tests_metrics(tests:) ⇒ Object
there is a need to map between a test and its registered Metric in FS. This will return the label for the test in principle, we cojuld return a more complex object, but all I need now is the label
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/test_infrastructure.rb', line 17 def get_tests_metrics(tests:) threads = tests.map { |testid| Thread.new(testid) { |tid| fetch_metric(tid) } } labels = {} landingpages = {} threads.each do |t| tid, label, lpage = t.value labels[tid] = label landingpages[tid] = lpage end [labels, landingpages] end |