Skip to content
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

get_api_test() fails when there are wait steps in API Synthetics test #1970

Closed
manojkunja opened this issue May 17, 2024 · 4 comments
Closed

Comments

@manojkunja
Copy link

manojkunja commented May 17, 2024

Describe the bug
get_api_test() gets the synthetic api test when there are no wait steps involved in the Synthetic API test, but when we add a wait step it starts to fail with TypeError: _from_openapi_data() missing 1 required positional argument: 'request'

Label the issue properly.

  • Add severity/ label.
  • Add documentation label if this issue is related to documentation changes.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Synthetics
  2. Create a multi step synthetic test
  3. Add some requests and atleast one wait step.
  4. Try to get that api test using the datadog api client. Notice that we hit this error.

Expected behavior
We should be able to get the test data irrespective of the steps.

Screenshots
image

Environment and Versions (please complete the following information):
Python 3.9.16
datadog==0.45.0
datadog-api-client==2.24.0

Additional context
Error:
Traceback (most recent call last): File "tenableio/commandline/synthetics_api.py", line 502, in <module> synth.create_synthetic_test(sites=sites, flow=flow, attrib=[template_tag]) File "tenableio/commandline/synthetics_api.py", line 361, in create_synthetic_test self.build_tests(site, flow, variable_id_map[site], attrib) File "tenableio/commandline/synthetics_api.py", line 252, in build_tests response = self.get_synthetic_test(self.public_id_map[flow]) File "tenableio/commandline/synthetics_api.py", line 180, in get_synthetic_test response = api_instance.get_api_test( File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/v1/api/synthetics_api.py", line 853, in get_api_test return self._get_api_test_endpoint.call_with_http_info(**kwargs) File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/api_client.py", line 712, in call_with_http_info return self.api_client.call_api( File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/api_client.py", line 326, in call_api return self._call_api( File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/api_client.py", line 129, in _call_api return_data = self.deserialize(response_data, response_type, check_type) File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/api_client.py", line 219, in deserialize deserialized_data = validate_and_convert_types( File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 1593, in validate_and_convert_types return attempt_convert_item( File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 1484, in attempt_convert_item return deserialize_model( File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 1403, in deserialize_model return model_class._new_from_openapi_data(**kw_args) File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 42, in wrapped_init return fn(_self, *args, **kwargs) File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 341, in _new_from_openapi_data return cls._from_openapi_data(*args, **kwargs) File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/v1/model/synthetics_api_test.py", line 110, in _from_openapi_data self.config = config File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 196, in __setattr__ self[attr] = value File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 567, in __setitem__ self.set_attribute(name, value) File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 165, in set_attribute value = validate_and_convert_types( File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 1593, in validate_and_convert_types return attempt_convert_item( File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 1484, in attempt_convert_item return deserialize_model( File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 1403, in deserialize_model return model_class._new_from_openapi_data(**kw_args) File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 42, in wrapped_init return fn(_self, *args, **kwargs) File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 341, in _new_from_openapi_data return cls._from_openapi_data(*args, **kwargs) File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/v1/model/synthetics_api_test_config.py", line 58, in _from_openapi_data self = super(SyntheticsAPITestConfig, cls)._from_openapi_data(kwargs) File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 642, in _from_openapi_data setattr(self, var_name, var_value) File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 196, in __setattr__ self[attr] = value File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 567, in __setitem__ self.set_attribute(name, value) File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 165, in set_attribute value = validate_and_convert_types( File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 1639, in validate_and_convert_types validate_and_convert_types( File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 1593, in validate_and_convert_types return attempt_convert_item( File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 1484, in attempt_convert_item return deserialize_model( File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 1403, in deserialize_model return model_class._new_from_openapi_data(**kw_args) File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 42, in wrapped_init return fn(_self, *args, **kwargs) File "/Users/mkunja/repos/catium-tenableio/venv/lib/python3.8/site-packages/datadog_api_client/model_utils.py", line 341, in _new_from_openapi_data return cls._from_openapi_data(*args, **kwargs) TypeError: _from_openapi_data() missing 1 required positional argument: 'request'

Code:

with ApiClient(self.configuration) as api_client:
            api_instance = SyntheticsApi(api_client)
            response = api_instance.get_api_test(
                public_id=test_id
            )
@manojkunja
Copy link
Author

I just noticed that update_api_test and create_synthetics_api_test also have same issue . While creating or updating an api synthetic test, its throwing an error if there is Wait Step involved.

@skarimo
Copy link
Member

skarimo commented May 21, 2024

Thanks for the report. We are looking into this.

Copy link

Thanks for your contribution!

This issue has been automatically marked as stale because it has not had activity in the last 30 days. Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity. Thank you for participating in the Datadog open source community.

If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of this project.

  2. Comment that the issue is still reproducible and include updated details requested in the issue template.

@github-actions github-actions bot added the stale label Jun 21, 2024
@jack-edmonds-dd
Copy link
Contributor

Fixed by #2009

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants