Class: FlakyTestTracker::Resolver
- Inherits:
-
Object
- Object
- FlakyTestTracker::Resolver
- Defined in:
- lib/flaky_test_tracker/resolver.rb
Overview
Test resolver.
Instance Attribute Summary collapse
-
#pretend ⇒ Boolean
Run but do not make any changes on the #storage.
-
#reporter ⇒ #tracked_tests #resolved_tests
The current value of reporter.
-
#storage ⇒ #all #create #update #delete
The current value of storage.
-
#verbose ⇒ Boolean
The current value of verbose.
Instance Method Summary collapse
-
#initialize(pretend:, storage:, reporter:, verbose:) ⇒ Resolver
constructor
A new instance of Resolver.
-
#resolve {|test| ... } ⇒ Array<Test>
Resolve tests by updating test "resolved_at" attribute to the current time on the storage.
Constructor Details
#initialize(pretend:, storage:, reporter:, verbose:) ⇒ Resolver
Returns a new instance of Resolver.
12 13 14 15 16 17 |
# File 'lib/flaky_test_tracker/resolver.rb', line 12 def initialize(pretend:, storage:, reporter:, verbose:) @pretend = pretend @storage = storage @reporter = reporter @verbose = verbose end |
Instance Attribute Details
#pretend ⇒ Boolean
Run but do not make any changes on the #storage
9 10 11 |
# File 'lib/flaky_test_tracker/resolver.rb', line 9 def pretend @pretend end |
#reporter ⇒ #tracked_tests #resolved_tests
Returns the current value of reporter.
9 10 11 |
# File 'lib/flaky_test_tracker/resolver.rb', line 9 def reporter @reporter end |
#storage ⇒ #all #create #update #delete
Returns the current value of storage.
9 10 11 |
# File 'lib/flaky_test_tracker/resolver.rb', line 9 def storage @storage end |
#verbose ⇒ Boolean
Returns the current value of verbose.
9 10 11 |
# File 'lib/flaky_test_tracker/resolver.rb', line 9 def verbose @verbose end |
Instance Method Details
#resolve {|test| ... } ⇒ Array<Test>
Resolve tests by updating test "resolved_at" attribute to the current time on the storage.
23 24 25 26 27 28 |
# File 'lib/flaky_test_tracker/resolver.rb', line 23 def resolve(&block) resolved_tests = select_tests(&block).map { |test| resolve_test(test) } reporter.resolved_tests(tests: resolved_tests) puts "\n[FlakyTestTracker][Resolver] #{resolved_tests.count} test(s) resolved" if verbose resolved_tests end |