Test: Allow FakeAgent to respond to remote config requests#4626
Test: Allow FakeAgent to respond to remote config requests#4626
Conversation
Overall package sizeSelf size: 6.99 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | @datadog/native-appsec | 8.0.1 | 15.59 MB | 15.6 MB | | @datadog/native-iast-taint-tracking | 3.1.0 | 12.27 MB | 12.28 MB | | @datadog/pprof | 5.3.0 | 9.85 MB | 10.22 MB | | protobufjs | 7.2.5 | 2.77 MB | 5.16 MB | | @datadog/native-iast-rewriter | 2.4.1 | 2.14 MB | 2.23 MB | | @opentelemetry/core | 1.14.0 | 872.87 kB | 1.47 MB | | @datadog/native-metrics | 2.0.0 | 898.77 kB | 1.3 MB | | @opentelemetry/api | 1.8.0 | 1.21 MB | 1.21 MB | | import-in-the-middle | 1.8.1 | 71.67 kB | 785.15 kB | | msgpack-lite | 0.1.26 | 201.16 kB | 281.59 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | pprof-format | 2.1.0 | 111.69 kB | 111.69 kB | | @datadog/sketches-js | 2.1.0 | 109.9 kB | 109.9 kB | | semver | 7.6.3 | 95.82 kB | 95.82 kB | | lodash.sortby | 4.7.0 | 75.76 kB | 75.76 kB | | lru-cache | 7.14.0 | 74.95 kB | 74.95 kB | | ignore | 5.3.1 | 51.46 kB | 51.46 kB | | int64-buffer | 0.1.10 | 49.18 kB | 49.18 kB | | shell-quote | 1.8.1 | 44.96 kB | 44.96 kB | | istanbul-lib-coverage | 3.2.0 | 29.34 kB | 29.34 kB | | tlhunter-sorted-set | 0.1.0 | 24.94 kB | 24.94 kB | | limiter | 1.1.5 | 23.17 kB | 23.17 kB | | dc-polyfill | 0.1.4 | 23.1 kB | 23.1 kB | | retry | 0.13.1 | 18.85 kB | 18.85 kB | | jest-docblock | 29.7.0 | 8.99 kB | 12.76 kB | | crypto-randomuuid | 1.0.0 | 11.18 kB | 11.18 kB | | path-to-regexp | 0.1.7 | 6.78 kB | 6.78 kB | | koalas | 1.0.2 | 6.47 kB | 6.47 kB | | module-details-from-path | 1.0.3 | 4.47 kB | 4.47 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4626 +/- ##
===========================================
+ Coverage 68.65% 90.65% +22.00%
===========================================
Files 252 123 -129
Lines 11047 4420 -6627
Branches 33 33
===========================================
- Hits 7584 4007 -3577
+ Misses 3463 413 -3050 ☔ View full report in Codecov by Sentry. |
adbb6e2 to
a722990
Compare
BenchmarksBenchmark execution time: 2024-08-28 14:22:40 Comparing candidate commit 9fe4ffb in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 260 metrics, 6 unstable metrics. |
a9802cd to
9a3528a
Compare
9a3528a to
d15767b
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
d15767b to
48ebf08
Compare
|
I see there is no mention of RC capabilities. The |
48ebf08 to
e36ae29
Compare
That was my idea, which is why I didn't bother validating the |
e36ae29 to
c0243f8
Compare
bengl
left a comment
There was a problem hiding this comment.
Just the file name change, that's all.
c0243f8 to
cb408e0
Compare
cb408e0 to
899e115
Compare
899e115 to
bc05f98
Compare
|
FYI, you can see this new capability of the |
simon-id
left a comment
There was a problem hiding this comment.
I would say let's remove all the superfluous fields. RC is complicated enough as it is haha. Let's keep the futurproofing for the futur, and focus on what we need to work first.
Lots of coments here sorry!
This commit performs three operations: 1. Move `integration-tests/helpers.js` to `integration-tests/helpers/index.js`. 2. Move `FakeAgent` from inside `integration-tests/helpers/index.js` to its own file called `integration-tests/helpers/fake_agent.js`. 3. Move the setting up of the Express app inside the `FakeAgent.start` method to a private helper function.
bc05f98 to
f9cdc04
Compare
|
FYI, I've updated the #4492 PR with usage of |
Co-authored-by: simon-id <simon.id@datadoghq.com>
Allow integration tests to mock the remote config abilities of the agent. This is done by first setting up a new remote config "file" using the new `FakeAgent#addRemoteConfig` method before running the main part of the integration test. This primes the fake agent to respond with this config for http requests to the `/v0.7/config` endpoint.
Allow integration tests to mock the remote config abilities of the agent. This is done by first setting up a new remote config "file" using the new `FakeAgent#addRemoteConfig` method before running the main part of the integration test. This primes the fake agent to respond with this config for http requests to the `/v0.7/config` endpoint.
Allow integration tests to mock the remote config abilities of the agent. This is done by first setting up a new remote config "file" using the new `FakeAgent#addRemoteConfig` method before running the main part of the integration test. This primes the fake agent to respond with this config for http requests to the `/v0.7/config` endpoint.
Allow integration tests to mock the remote config abilities of the agent. This is done by first setting up a new remote config "file" using the new `FakeAgent#addRemoteConfig` method before running the main part of the integration test. This primes the fake agent to respond with this config for http requests to the `/v0.7/config` endpoint.

Allow integration tests to mock the remote config abilities of the agent.
This is done by first setting up a new remote config "file" using the new
FakeAgent#addRemoteConfigmethod before running the main part of the integration test. This primes the fake agent to respond with this config for http requests to the/v0.7/configendpoint.Note to reviewers
This ability is needed by the integration tests in an upcoming Dynamic Instrumentation PR. I've separated it into its own PR to make the review easier.
I have not updated any of the existing tests to make uses of this ability. So this new ability of the
FakeAgentclass isn't actually used by any of our existing code in this PR. Let me know if there's an obvious place where we could make use of this so that I can update the PR to do so.To make the review process easier, I've split this PR into two commits:
Usage example
Here's an example of how we'd use the new
FakeAgent#addRemoteConfigmethod to register a Remote Config file for use in Dynamic Instrumentation: