Skip to content

Fix remote configuration assertion for is_agent and config_states#1074

Merged
GustavoCaso merged 11 commits into
mainfrom
fix-remote-assertions
Apr 27, 2023
Merged

Fix remote configuration assertion for is_agent and config_states#1074
GustavoCaso merged 11 commits into
mainfrom
fix-remote-assertions

Conversation

@GustavoCaso

@GustavoCaso GustavoCaso commented Apr 14, 2023

Copy link
Copy Markdown
Contributor

Description

Fix remote configuration assertion for is_agent and config_states

Workflow

  1. ⚠️⚠️ Create your PR as draft (we're receiving lot of PR, it saves us lot of time) ⚠️⚠️
  2. Follows the style guidelines of this project (See how to easily lint the code)
  3. Work on you PR until the CI passes (if something not related to your task is failing, you can ignore it)
  4. Mark it as ready for review

NOTE: By default in PR only default scenario tests will be launched. Please refer to the documentation to run all scenarios in your PR if needed.

Once your PR is reviewed, you can merge it ! ❤️


# verify that the tracer is properly storing and reporting on its config state
expected_config_states = client_state.get("config_states")
expected_config_states = expected.get("config_states")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were not using the expected here so we always compared the same client state

config_states = client_state.get("config_states")
if expected_config_states is None and config_states is not None:

if expected_config_states is None and (config_states is not None and len(config_states) > 0):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Base on the RFC config_states can be null or empty list

client_tracer = client["client_tracer"]

assert "is_agent" not in client, "'client.is_agent' MUST either NOT be set or set to false"
assert "is_agent" not in client or client['is_agent'] == False, "'client.is_agent' MUST either NOT be set or set to false"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_agent could be false

@GustavoCaso
GustavoCaso force-pushed the fix-remote-assertions branch from cb7c4ee to 7503b75 Compare April 14, 2023 11:02
@GustavoCaso
GustavoCaso marked this pull request as ready for review April 14, 2023 11:03
@GustavoCaso
GustavoCaso requested review from a team as code owners April 14, 2023 11:03
@GustavoCaso
GustavoCaso force-pushed the fix-remote-assertions branch from 7503b75 to 634edfa Compare April 14, 2023 14:08

@cbeauchesne cbeauchesne left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI is massively failing, I need to take some time to understand what's happening, I will do it asap

@cbeauchesne

Copy link
Copy Markdown
Collaborator

Ok, once the test is fixed, turns out java and go seems no to be compliant. Just wait for confirmation before merging.

@cbeauchesne
cbeauchesne requested review from Hellzy and smola April 25, 2023 08:15
@cbeauchesne

Copy link
Copy Markdown
Collaborator

Adding @Hellzy and @smola as we skip some tests for java and golang

@smola smola left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix for Java coming up on: DataDog/dd-trace-java#5114

Comment thread tests/remote_config/test_remote_configuration.py Outdated
Comment thread tests/remote_config/test_remote_configuration.py Outdated
@cbeauchesne
cbeauchesne requested a review from a team as a code owner April 27, 2023 09:03
@cbeauchesne
cbeauchesne force-pushed the fix-remote-assertions branch from 992ffde to f2af2b0 Compare April 27, 2023 13:45
@GustavoCaso
GustavoCaso merged commit 85ce4ce into main Apr 27, 2023
@GustavoCaso
GustavoCaso deleted the fix-remote-assertions branch April 27, 2023 15:11
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.

5 participants