Draft: Resolve "Find way to test Snowplow event tracking without creating new thread"
requested to merge 238552-find-way-to-test-snowplow-event-tracking-without-creating-new-thread into master
What does this MR do?
Create an rspec hook to help test snowplow events. This hook will be applied to all tests annotated with snowplow
. It does two things:
- Enable the application setting for snowplow.
- Replace the
AsyncEmitter
withEmitter
. We want to avoidAsyncEmitter
because it does some work in a separate thread, and we want any failures to occur in the same thread as the test.
Instead of stubbing Gitlab::Tracking
, we want to ensure that tests execute this code. The SnowplowTracker
library does type checks for parameters passed to it, and we want these type errors to surface in the tests, rather than at runtime.
Related to #238552 (closed)
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Closes #238552 (closed)
Edited by Alishan Ladhani