-
Notifications
You must be signed in to change notification settings - Fork 129
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
Integration with CI Visibility tests #761
Conversation
RUM is now able to detect if its being run inside a test instrumented with CI Visibility and perform the following changes then: * Sets `session.type` to `ci_test` * Injects `ci_visibility.test_execution_id` to every event * Set `_dd.origin` to `ciapp-test` so that APM traces from RUM in CI Visibility mode can be distinguished. * Send a message to a Mach Port initialized in the CI Visibility framework (TestMachPort) to notify RUM is enabled * Creates a new Mach Port (RUMMachPort) that will receive a message when the test ends. RUM will flush the RUM events when the message is received.
…` value when setting instead of in initialisation. Fix some tests
Very nice use of Also, I'm fine with exposing flushing methods internally 👍 |
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.
Looks really good 👍. I left few suggestions on making this integration fit our codebase a bit simpler.
- Modify CITestIntegration to be object oriented - Change a messageID value to be a bit more descriptive - Fix some tests
Add a test to validate CITestIntegration is off by default
docs/trace_collection.md
Outdated
|
||
**Note**: Tracing auto instrumentation uses `URLSession` swizzling, but it is opt-in: if you do not specify `firstPartyHosts`, no swizzling is applied. | ||
**Note**: Tracing auto-instrumentation uses `URLSession` swizzling and is opt-in. If you do not specify `firstPartyHosts`, swizzling is not applied. |
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.
Is "swizzling" defined elsewhere, or is it a commonly understood term? It is a bit confusing to me, but this is outside my normal subject area.
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.
Yes, is a commonly understood term in iOS programming. Anyway this change was not supposed to be here so I reverted it
58a0381
to
62928a2
Compare
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.
👍
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.
👌👏
What and why?
This PR enables a much deeper integration of RUM with CI Visibility product (dd-sdk-swift-testing). If a UI test instrumented with CI Visibility is run and a RUM sessions is configured, the session will be identified as a created by CI App and will be shown as part of the test.
There is a related PR with the needed changes in the dd-sdk-swift-testing framework
How?
RUM now detects on loading if is running under an instrumented test by checking if the environment variable
CI_VISIBILITY_TEST_EXECUTION_ID
is available, which contains the test identifier. If so it makes the following changes:session.type
toci-test
ci_visibility.test_execution_id
to every event_dd.origin
tociapp-test
so that APM traces from RUM in CI Visibility mode can be distinguished.Review checklist