Skip to content

Commit d1d36a0

Browse files
committed
chore: address everyone's feedback
1 parent dd786ed commit d1d36a0

File tree

7 files changed

+38
-8
lines changed

7 files changed

+38
-8
lines changed

tests/e2e/metrics/conftest.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ def infrastructure(request: pytest.FixtureRequest, tmp_path_factory: pytest.Temp
1010
1111
Parameters
1212
----------
13-
request : fixtures.SubRequest
14-
test fixture containing metadata about test execution
13+
request : pytest.FixtureRequest
14+
pytest request fixture to introspect absolute path to test being executed
15+
tmp_path_factory : pytest.TempPathFactory
16+
pytest temporary path factory to discover shared tmp when multiple CPU processes are spun up
17+
worker_id : str
18+
pytest-xdist worker identification to detect whether parallelization is enabled
1519
1620
Yields
1721
------

tests/e2e/tracer/conftest.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ def infrastructure(request: pytest.FixtureRequest, tmp_path_factory: pytest.Temp
1010
1111
Parameters
1212
----------
13-
request : fixtures.SubRequest
14-
test fixture containing metadata about test execution
13+
request : pytest.FixtureRequest
14+
pytest request fixture to introspect absolute path to test being executed
15+
tmp_path_factory : pytest.TempPathFactory
16+
pytest temporary path factory to discover shared tmp when multiple CPU processes are spun up
17+
worker_id : str
18+
pytest-xdist worker identification to detect whether parallelization is enabled
1519
1620
Yields
1721
------

tests/e2e/tracer/handlers/sync_async_capture.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ def get_todos():
1414

1515
@tracer.capture_method
1616
async def async_get_users():
17+
# dummy block to prevent basic failures where
18+
# we weren't priming coroutines correctly in the past but returning unresolved
1719
await asyncio.sleep(1)
1820
return [{"id": f"{uuid4()}"} for _ in range(5)]
1921

tests/e2e/tracer/infrastructure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ class TracerStack(BaseInfrastructureV2):
1212
def __init__(self, handlers_dir: Path, feature_name: str = "tracer") -> None:
1313
super().__init__(feature_name, handlers_dir)
1414

15-
def create_resources(self):
15+
def create_resources(self) -> None:
1616
env_vars = {"POWERTOOLS_SERVICE_NAME": self.SERVICE_NAME}
1717
self.create_lambda_functions(function_props={"environment": env_vars})

tests/e2e/utils/data_builder/metrics.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,26 @@ def build_metric_query_data(
1313
stat: str = "Sum",
1414
dimensions: Optional[List[DimensionTypeDef]] = None,
1515
) -> List[MetricDataQueryTypeDef]:
16+
"""Create input for CloudWatch GetMetricData API call
17+
18+
Parameters
19+
----------
20+
namespace : str
21+
Metric namespace to search for
22+
metric_name : str
23+
Metric name to search for
24+
period : int, optional
25+
Time period in seconds to search metrics, by default 60
26+
stat : str, optional
27+
Aggregate function to use for results, by default "Sum"
28+
dimensions : Optional[List[DimensionTypeDef]], optional
29+
Metric dimensions to search for, by default None
30+
31+
Returns
32+
-------
33+
List[MetricDataQueryTypeDef]
34+
_description_
35+
"""
1636
dimensions = dimensions or []
1737
data_query: List[MetricDataQueryTypeDef] = [
1838
{

tests/e2e/utils/data_fetcher/metrics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def get_metrics(
4646
Returns
4747
-------
4848
MetricDataResultTypeDef
49-
_description_
49+
Dict with metric values found
5050
5151
Raises
5252
------

tests/e2e/utils/infrastructure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,12 @@ def deploy(self) -> Dict[str, str]:
312312
assets.upload()
313313
return self._deploy_stack(self.stack_name, template)
314314

315-
def delete(self):
315+
def delete(self) -> None:
316316
"""Delete CloudFormation Stack"""
317317
self.cfn.delete_stack(StackName=self.stack_name)
318318

319319
@abstractmethod
320-
def create_resources(self):
320+
def create_resources(self) -> None:
321321
"""Create any necessary CDK resources. It'll be called before deploy
322322
323323
Examples

0 commit comments

Comments
 (0)