Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ GEM

PLATFORMS
aarch64-linux
x86_64-linux

DEPENDENCIES
rake (~> 13.2)
Expand Down
13 changes: 7 additions & 6 deletions lib/ctrf/r_spec_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def initialize(output)

def start(_notification)
@tests = {}
@run_start = Time.now.to_i
@run_start = Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
end

def example_started(notification)
Expand All @@ -29,7 +29,8 @@ def example_started(notification)
# Otherwise, this could is the location of the `it` - even if that's in a helper file unrelated to the test
filePath: notification.example.id,
extra: {
hash: notification.example.hash
hash: notification.example.hash,
filePathLocation: notification.example.location
}
}
end
Expand All @@ -52,9 +53,9 @@ def retry(example)
def example_finished(notification)
test = @tests[notification.example.hash]

test[:duration] = notification.example.execution_result.run_time * 1000
test[:start] = notification.example.execution_result.started_at.to_i
test[:stop] = notification.example.execution_result.finished_at.to_i
test[:duration] = notification.example.execution_result.run_time.to_i * 1000
test[:start] = notification.example.execution_result.started_at.to_i * 1000
test[:stop] = notification.example.execution_result.finished_at.to_i * 1000

test[:status] = notification.example.execution_result.status.to_s
test[:rawStatus] = notification.example.execution_result.status
Expand Down Expand Up @@ -90,7 +91,7 @@ def stop(_notification)
skipped: @tests.values.select { |test| test[:status] == 'skipped' }.count,
other: @tests.values.select { |test| test[:status] == 'other' }.count,
start: @run_start,
stop: Time.now.to_i
stop: Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
},
tests: @tests.values
}
Expand Down