Skip to content
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

Add integration tests for tracing compliance #662

Merged
merged 9 commits into from
Apr 17, 2022

Conversation

yuktea
Copy link
Contributor

@yuktea yuktea commented Apr 14, 2022

Some additional tests for the Span Builder SDK that verify:

  1. Attributes are merged correctly
  2. Setting attributes after calling startSpan() should not work
    plus some additional tests for setting null and empty string values to attributes.

UPDATE: I commented out one of the tests that I was not totally sure of.
(unsure if setAttribute() should work with empty string '' values.)

@yuktea yuktea marked this pull request as draft April 14, 2022 16:15
@yuktea yuktea marked this pull request as ready for review April 14, 2022 16:26
@codecov
Copy link

codecov bot commented Apr 14, 2022

Codecov Report

Merging #662 (b5c2cee) into main (ca05f51) will decrease coverage by 0.16%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #662      +/-   ##
============================================
- Coverage     84.45%   84.28%   -0.17%     
- Complexity     1141     1153      +12     
============================================
  Files           127      128       +1     
  Lines          2766     2788      +22     
============================================
+ Hits           2336     2350      +14     
- Misses          430      438       +8     
Flag Coverage Δ
7.4 84.23% <ø> (-0.17%) ⬇️
8.0 84.28% <ø> (-0.17%) ⬇️
8.1 84.28% <ø> (-0.17%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/SDK/Common/Dev/Compatibility/Util.php 92.59% <0.00%> (-7.41%) ⬇️
src/SDK/Trace/TracerProvider.php 100.00% <0.00%> (ø)
src/Contrib/Otlp/SpanConverter.php 100.00% <0.00%> (ø)
src/SDK/Resource/ResourceInfoFactory.php 0.00% <0.00%> (ø)
src/SDK/Common/Instrumentation/KeyGenerator.php 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca05f51...b5c2cee. Read the comment docs.

@brettmc
Copy link
Collaborator

brettmc commented Apr 14, 2022

any tests which are verifying behaviour from the spec compliance matrix need a group annotation, please

Modified the names of the tests to be more descriptive and added the
`@group compliance` notation.
Additionally, I commented out one of the tests that I was not totally
sure of. (unsure if `setAttribute()` should work with empty string `''`
values.
@yuktea yuktea marked this pull request as draft April 15, 2022 08:11
@yuktea yuktea marked this pull request as ready for review April 15, 2022 08:24
tests/Integration/SDK/SpanBuilderTest.php Outdated Show resolved Hide resolved
tests/Integration/SDK/SpanBuilderTest.php Outdated Show resolved Hide resolved
tests/Integration/SDK/SpanBuilderTest.php Outdated Show resolved Hide resolved
tests/Integration/SDK/SpanBuilderTest.php Show resolved Hide resolved
tests/Integration/SDK/SpanBuilderTest.php Outdated Show resolved Hide resolved
tests/Integration/SDK/SpanBuilderTest.php Outdated Show resolved Hide resolved
tests/Integration/SDK/SpanBuilderTest.php Show resolved Hide resolved
Removed `$span->end()` calls as they shouldn't be necessary
@yuktea yuktea marked this pull request as draft April 16, 2022 20:00
@yuktea yuktea changed the title Add integration tests for span builder Add integration tests for tracing compliance Apr 16, 2022
Test to get default tracer. Also, added `@group` php unit annotation for
tests to check specification compliance
@yuktea yuktea marked this pull request as ready for review April 16, 2022 21:09
@tidal
Copy link
Member

tidal commented Apr 17, 2022

@yuktea
Thx! LGTM

@tidal tidal merged commit 1d5283b into open-telemetry:main Apr 17, 2022
@yuktea yuktea deleted the span-builder-compliance-tests branch June 2, 2022 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants