Skip to content

Commit

Permalink
Update acktest and rename TestBootstrapResources (#5)
Browse files Browse the repository at this point in the history
Description of changes:
- Updated `acktest` to remove typo in `deserialize`
- Renamed `TestBootstrapResources` to `BootstrapResources` so `pytest` will stop complaining that it's not a test class

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license.
  • Loading branch information
RedbackThomson authored Aug 29, 2021
1 parent 191a020 commit ad3da64
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions test/e2e/bootstrap_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
from e2e import bootstrap_directory

@dataclass
class TestBootstrapResources(Resources):
class BootstrapResources(Resources):
ClusterVPC: VPC
ClusterRole: Role
FargatePodRole: Role

_bootstrap_resources = None

def get_bootstrap_resources(bootstrap_file_name: str = "bootstrap.pkl") -> TestBootstrapResources:
def get_bootstrap_resources(bootstrap_file_name: str = "bootstrap.pkl") -> BootstrapResources:
global _bootstrap_resources
if _bootstrap_resources is None:
_bootstrap_resources = TestBootstrapResources.deseralize(bootstrap_directory, bootstrap_file_name=bootstrap_file_name)
_bootstrap_resources = BootstrapResources.deserialize(bootstrap_directory, bootstrap_file_name=bootstrap_file_name)
return _bootstrap_resources
2 changes: 1 addition & 1 deletion test/e2e/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
acktest @ git+https://github.com/aws-controllers-k8s/test-infra.git@955d7831ee374a212250179e95a5f3b75e555fd9
acktest @ git+https://github.com/aws-controllers-k8s/test-infra.git@8b21fd1a3374f506d35efe7426d5deed8b1bb1bf
6 changes: 2 additions & 4 deletions test/e2e/service_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@
from acktest.bootstrapping.iam import Role
from acktest.bootstrapping.vpc import VPC
from e2e import bootstrap_directory
from e2e.bootstrap_resources import (
TestBootstrapResources,
)
from e2e.bootstrap_resources import BootstrapResources

def service_bootstrap() -> Resources:
logging.getLogger().setLevel(logging.INFO)

resources = TestBootstrapResources(
resources = BootstrapResources(
ClusterRole=Role("cluster-role", "eks.amazonaws.com", ["arn:aws:iam::aws:policy/AmazonEKSClusterPolicy"]),
FargatePodRole=Role("fargate-pod-role", "eks-fargate-pods.amazonaws.com", ["arn:aws:iam::aws:policy/AmazonEKSFargatePodExecutionRolePolicy"]),
ClusterVPC=VPC(name_prefix="cluster-vpc", num_public_subnet=2, num_private_subnet=2)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/service_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
def service_cleanup():
logging.getLogger().setLevel(logging.INFO)

resources = Resources.deseralize(bootstrap_directory)
resources = Resources.deserialize(bootstrap_directory)
resources.cleanup()

if __name__ == "__main__":
Expand Down

0 comments on commit ad3da64

Please sign in to comment.