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

Tests for share package #10

Merged
merged 2 commits into from
Oct 19, 2021
Merged

Tests for share package #10

merged 2 commits into from
Oct 19, 2021

Conversation

aspacca
Copy link
Contributor

@aspacca aspacca commented Oct 19, 2021

No description provided.

@@ -66,10 +70,17 @@ def kwargs(self) -> dict[str, Any]:

@kwargs.setter
def kwargs(self, value: dict[str, Any]) -> None:
init_kwargs: list[str] = [key for key in value if key in self._kwargs]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

validate value has all the required keys

for x in value.keys():
if x in self._kwargs:
self.__setattr__(x, value[x])
if self.__getattribute__(x) is None:
if not self.__getattribute__(x):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we want to check emptiness, not None

@@ -219,30 +230,31 @@ def add_input(self, new_input: Input) -> None:

def parse_config(config_yaml: str) -> Config:
yaml_config = yaml.safe_load(config_yaml)
assert isinstance(yaml_config, dict)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

assert proper type from config_yaml


conf: Config = Config()

if "inputs" not in yaml_config or not isinstance(yaml_config["inputs"], list):
raise ValueError("No inputs provided")

for input_config in yaml_config["inputs"]:
if "type" not in input_config:
raise ValueError("Must be provided type for input")
if "type" not in input_config or not isinstance(input_config["type"], str):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

check type as well


if "id" not in input_config:
raise ValueError("Must be provided id for input")
if "id" not in input_config or not isinstance(input_config["id"], str):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

check type as well


current_input: Input = Input(input_type=input_config["type"], input_id=input_config["id"])

if "outputs" not in input_config or not isinstance(input_config["outputs"], list):
raise ValueError("No valid outputs for input")

for output_config in input_config["outputs"]:
if "type" not in output_config:
raise ValueError("Must be provided type for output")
if "type" not in output_config or not isinstance(output_config["type"], str):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

check type as well


if "args" not in output_config:
raise ValueError("Must be provided args for output")
if "args" not in output_config or not isinstance(output_config["args"], dict):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

check type as well

@@ -50,7 +50,7 @@ def create(output: str, **kwargs: Any) -> CommonShipper:
output_builder: Callable[..., CommonShipper] = output_definition["class"]

init_kwargs: list[str] = [key for key in kwargs.keys() if key in output_kwargs and kwargs[key]]
if len(init_kwargs) is not len(output_kwargs):
if len(init_kwargs) != len(output_kwargs):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

proper check

@@ -28,7 +28,7 @@ def create(storage_type: str, **kwargs: Any) -> CommonStorage:
storage_builder: Callable[..., CommonStorage] = storage_definition["class"]

init_kwargs: list[str] = [key for key in kwargs.keys() if key in storage_kwargs and kwargs[key]]
if len(init_kwargs) is not len(storage_kwargs):
if len(init_kwargs) != len(storage_kwargs):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

proper check

@@ -1,4 +1,4 @@
git+git://github.com/basepi/apm-agent-python.git@lambda
elastic-apm>=6.6.0,<6.7
Copy link
Contributor Author

Choose a reason for hiding this comment

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

lambda support is now released

@elasticmachine
Copy link

elasticmachine commented Oct 19, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-10-19T14:44:53.197+0000

  • Duration: 5 min 5 sec

  • Commit: c32a1c9

Test stats 🧪

Test Results
Failed 0
Passed 19
Skipped 0
Total 19

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@aspacca aspacca merged commit 41029f3 into elastic:main Oct 19, 2021
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.

3 participants