-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test optional resource load attributes #236
base: next
Are you sure you want to change the base?
Conversation
I'm open to other options, but this seemed to make sense to me |
Browser bundle sizeNPM build
CDN build
Code coverageCoverage values did not change👌. Total:
Generated against 6661fb4 on 1 September 2023 at 15:24:01 UTC |
Could we assert these are present on browsers that should definitely support them, in the same way we do other browser support things? i.e. rather than |
a96a7e7
to
9e1aebc
Compare
Actually followed a similar pattern to the flutter notifier, and created a step that checks browser version before running a given step. only improvement now would be to show the step was skipped (in blue) if it's not in the supported list |
|
||
# Image status code and body size have patchy browser coverage | ||
And on the browser Chrome 109: the trace payload field "resourceSpans.0.scopeSpans.0.spans.1" integer attribute "http.status_code" equals 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reads a lot like "on Chrome 109 and only Chrome 109 …" to me
In bugsnag-laravel there's a step that lets you use operators so this could be:
And on Chrome versions >= 109:
"""
the trace payload field "resourceSpans.0.scopeSpans.0.spans.1" integer attribute "http.status_code" equals 200
"""
Would a similar thing make sense here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's quite a nice pattern, think we could make it work for Chrome versions >= 109, Firefox versions >= 76, Safari >= 16
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this should do it:
Then(/^on ((?:[A-z]+ versions (?:>=?|<=?|==) [0-9.]+(?:, )?)+):$/) do |browser_specs, steps_to_run|
spec_matcher = /^([A-z]+) versions (>=?|<=?|==) ([0-9.]+)$/
browser_specs.split(", ").each do |browser_spec|
browser_spec.scan(spec_matcher) do |name, operator, version|
should_run_steps = $browser.name.casecmp?(name) && $browser.version.send(operator, version)
# make sure this step is debuggable!
$logger.debug("#{$browser.name} == #{name} && v#{$browser.version} #{operator} #{version}? #{should_run_steps}")
if should_run_steps
steps_to_run.each_line(chomp: true) do |step_to_run|
step(step_to_run)
end
else
indent = " " * 4
# e.g. "a step\nanother step\n" -> " 1) a step\n 2) another step"
steps_indented = steps_to_run.each_line.map.with_index(1) { |step, i| "#{indent}#{i}) #{step.chomp}" }.join("\n")
$logger.info("Skipping steps on #{$browser.name} v#{$browser.version}:\n#{steps_indented}")
end
end
end
end
c4751bd
to
0974e0a
Compare
@@ -195,6 +195,31 @@ | |||
end | |||
end | |||
|
|||
Then(/^on ((?:[A-z]+ versions (?:>=?|<=?|==) [0-9.]+(?:, )?)+):$/) do |browser_specs, steps_to_run| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't working:
[10:23:59] INFO: Skipping steps on chrome vInfinity:
1) the trace payload field "resourceSpans.0.scopeSpans.0.spans.1" integer attribute "http.response_content_length" equals 2202
2) the trace payload field "resourceSpans.0.scopeSpans.0.spans.1" integer attribute "http.response_content_length_uncompressed" equals 2202
[10:23:59] INFO: Skipping steps on chrome vInfinity:
1) the trace payload field "resourceSpans.0.scopeSpans.0.spans.1" integer attribute "http.response_content_length" equals 2202
2) the trace payload field "resourceSpans.0.scopeSpans.0.spans.1" integer attribute "http.response_content_length_uncompressed" equals 2202
[10:23:59] INFO: Skipping steps on chrome vInfinity:
1) the trace payload field "resourceSpans.0.scopeSpans.0.spans.1" integer attribute "http.response_content_length" equals 2202
2) the trace payload field "resourceSpans.0.scopeSpans.0.spans.1" integer attribute "http.response_content_length_uncompressed" equals 2202
[10:23:59] INFO: Skipping steps on chrome vInfinity:
1) the trace payload field "resourceSpans.0.scopeSpans.0.spans.1" integer attribute "http.response_content_length" equals 2202
2) the trace payload field "resourceSpans.0.scopeSpans.0.spans.1" integer attribute "http.response_content_length_uncompressed" equals 2202
[10:23:59] INFO: Skipping steps on chrome vInfinity:
1) the trace payload field "resourceSpans.0.scopeSpans.0.spans.1" integer attribute "http.response_content_length" equals 2202
2) the trace payload field "resourceSpans.0.scopeSpans.0.spans.1" integer attribute "http.response_content_length_uncompressed" equals 2202
dee3cfa
to
4cc5644
Compare
4cc5644
to
6661fb4
Compare
Goal
HTTP status code and body size attributes (encoded and decoded) have patchy browser coverage, and by adding new step that runs any given step depending on browser version, we can assert these attributes are correct on the supported browsers