Conversation
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🔗 Commit SHA: 8ec528c | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
59a5a75 to
9694209
Compare
Bundles Sizes Evolution
🚀 CPU PerformancePending... 🧠 Memory PerformancePending... |
9694209 to
4ddaa91
Compare
| yarn test:unit --spec packages/core/src/path/to/feature.spec.ts | ||
|
|
||
| # Run tests on a specific seed | ||
| yarn test:unit --seed 123 |
02c399c to
d5103b6
Compare
| cookieString: /^dd_[\w_-]+=[^;]*;expires=[^;]+;path=\/;samesite=strict$/, | ||
| description: 'should set samesite to strict by default', | ||
| }, | ||
| { | ||
| initConfiguration: { clientToken: 'abc', useSecureSessionCookie: true }, | ||
| cookieOptions: { secure: true }, | ||
| cookieString: /^dd_cookie_test_[\w-]+=[^;]*;expires=[^;]+;path=\/;samesite=strict;secure$/, | ||
| cookieString: /^dd_[\w_-]+=[^;]*;expires=[^;]+;path=\/;samesite=strict;secure$/, | ||
| description: 'should add secure attribute when defined', | ||
| }, | ||
| { | ||
| initConfiguration: { clientToken: 'abc', trackSessionAcrossSubdomains: true }, | ||
| cookieOptions: { domain: 'foo.bar' }, | ||
| cookieString: new RegExp( | ||
| `^dd_cookie_test_[\\w-]+=[^;]*;expires=[^;]+;path=\\/;samesite=strict;domain=${getCurrentSite()}$` | ||
| `^dd_[\\w_-]+=[^;]*;expires=[^;]+;path=\\/;samesite=strict;domain=${getCurrentSite()}$` | ||
| ), | ||
| description: 'should set cookie domain when tracking accross subdomains', | ||
| }, | ||
| ].forEach(({ description, initConfiguration, cookieString }) => { | ||
| it(description, () => { | ||
| const cookieSetSpy = spyOnProperty(document, 'cookie', 'set') | ||
| selectCookieStrategy(initConfiguration) | ||
| expect(cookieSetSpy.calls.argsFor(0)[0]).toMatch(cookieString) | ||
| expect(cookieSetSpy).toHaveBeenCalled() | ||
| for (const call of cookieSetSpy.calls.all()) { | ||
| expect(call.args[0]).toMatch(cookieString) | ||
| } |
There was a problem hiding this comment.
note: this change was needed because before that PR, the getCurrentSite cache had a high chance of being defined when those tests were executed, so cookie accesses to get the current site were not taken into account. Now that the current site cache is properly reset between tests, this test was failing consistently.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d5103b670a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
packages/rum-core/src/domain/view/viewMetrics/interactionCountPolyfill.ts
Show resolved
Hide resolved
d5103b6 to
226bfcf
Compare
226bfcf to
8ec528c
Compare
Motivation
For a long time, our unit test suite did not support to be built as a single bundle -- each .spec.ts files produced a separate bundle with their dependencies, so module-level variables were not shared between spec files.
This constraint caused maintenance issues in the past (see). It also prevents us from running global cleanups in the "forEach.spec.ts" file.
Changes
runtimeChunck: falseoption so karma-webpack is building mutualizing common dependencies between spec files--seedargument so we can run the spec files for a given seed without modifying the config file (useful for letting agents investigating test failures)Test instructions
If CI is green, it should be good
Checklist