Class: ChatNotifier::TestEnvironment
- Inherits:
-
Object
- Object
- ChatNotifier::TestEnvironment
- Defined in:
- lib/chat_notifier/test_environment.rb,
lib/chat_notifier/test_environment/debug.rb,
lib/chat_notifier/test_environment/github.rb
Overview
All information about the place where the test was run
Defined Under Namespace
Instance Attribute Summary collapse
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(settings:) ⇒ TestEnvironment
constructor
A new instance of TestEnvironment.
- #job_identifier ⇒ Object
- #pull_request_ref ⇒ Object
- #ruby_version ⇒ Object
- #run_id ⇒ Object
-
#run_key ⇒ Object
Key used to group status reports by run in the parent digest.
- #test_run_url ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(settings:) ⇒ TestEnvironment
Returns a new instance of TestEnvironment.
6 7 8 |
# File 'lib/chat_notifier/test_environment.rb', line 6 def initialize(settings:) @settings = settings end |
Instance Attribute Details
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
10 11 12 |
# File 'lib/chat_notifier/test_environment.rb', line 10 def settings @settings end |
Class Method Details
Instance Method Details
#job_identifier ⇒ Object
31 32 33 34 35 36 |
# File 'lib/chat_notifier/test_environment.rb', line 31 def job_identifier settings.fetch("NOTIFY_JOB_NAME") do job = settings.fetch("GITHUB_JOB", "test") "#{job} ruby-#{RUBY_VERSION}" end end |
#pull_request_ref ⇒ Object
45 46 |
# File 'lib/chat_notifier/test_environment.rb', line 45 def pull_request_ref end |
#ruby_version ⇒ Object
20 21 22 |
# File 'lib/chat_notifier/test_environment.rb', line 20 def ruby_version "Ruby #{::RUBY_VERSION}" end |
#run_id ⇒ Object
38 39 |
# File 'lib/chat_notifier/test_environment.rb', line 38 def run_id end |
#run_key ⇒ Object
Key used to group status reports by run in the parent digest. Distinct from run_id (which URLs need bare) so re-runs can sort as newer runs.
43 |
# File 'lib/chat_notifier/test_environment.rb', line 43 def run_key = run_id |
#test_run_url ⇒ Object
28 29 |
# File 'lib/chat_notifier/test_environment.rb', line 28 def test_run_url end |
#url ⇒ Object
24 25 26 |
# File 'lib/chat_notifier/test_environment.rb', line 24 def url settings.fetch("NOTIFY_CURRENT_REPOSITORY_URL") end |