Skip to content

Adds E2E log test for RDS database interactions for Python #132

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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/python-eks-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ jobs:
--platform-info ${{ env.CLUSTER_NAME }}
--service-name python-application-${{ env.TESTING_ID }}
--remote-service-deployment-name ${{ env.REMOTE_SERVICE_DEPLOYMENT_NAME }}
--remote-resource-identifier "information_schema|${{env.RDS_MYSQL_CLUSTER_ENDPOINT}}|3306"
--query-string ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }}
--rollup'

Expand All @@ -378,6 +379,7 @@ jobs:
--service-name python-application-${{ env.TESTING_ID }}
--remote-service-name python-remote-application-${{ env.TESTING_ID }}
--remote-service-deployment-name ${{ env.REMOTE_SERVICE_DEPLOYMENT_NAME }}
--remote-resource-identifier "information_schema|${{env.RDS_MYSQL_CLUSTER_ENDPOINT}}|3306"
--query-string ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }}
--rollup'

Expand All @@ -394,6 +396,7 @@ jobs:
--platform-info ${{ env.CLUSTER_NAME }}
--service-name python-application-${{ env.TESTING_ID }}
--remote-service-deployment-name ${{ env.REMOTE_SERVICE_DEPLOYMENT_NAME }}
--remote-resource-identifier "information_schema|${{env.RDS_MYSQL_CLUSTER_ENDPOINT}}|3306"
--query-string ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }}
--rollup'

Expand Down
4 changes: 4 additions & 0 deletions validator/src/main/java/com/amazon/aoc/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ public class App implements Callable<Integer> {
@CommandLine.Option(names = {"--remote-service-deployment-name"})
private String remoteServiceDeploymentName;

@CommandLine.Option(names = {"--remote-resource-identifier"})
private String remoteResourceIdentifier;

@CommandLine.Option(names = {"--endpoint"})
private String endpoint;

Expand Down Expand Up @@ -170,6 +173,7 @@ public Integer call() throws Exception {
context.setServiceName(this.serviceName);
context.setRemoteServiceName(this.remoteServiceName);
context.setRemoteServiceDeploymentName(this.remoteServiceDeploymentName);
context.setRemoteResourceIdentifier(this.remoteResourceIdentifier);
context.setEndpoint(this.endpoint);
context.setQueryString(this.queryString);
context.setLogGroup(this.logGroup);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ public enum PredefinedExpectedTemplate implements FileConfig {
PYTHON_EKS_CLIENT_CALL_METRIC("/expected-data-template/python/eks/client-call-metric.mustache"),
PYTHON_EKS_CLIENT_CALL_TRACE("/expected-data-template/python/eks/client-call-trace.mustache"),

PYTHON_EKS_RDS_MYSQL_LOG("/expected-data-template/python/eks/rds-mysql-log.mustache"),
PYTHON_EKS_RDS_MYSQL_METRIC("/expected-data-template/python/eks/rds-mysql-metric.mustache"),
PYTHON_EKS_RDS_MYSQL_TRACE("/expected-data-template/python/eks/rds-mysql-trace.mustache"),

/** Python EC2 Default Test Case Validations */
PYTHON_EC2_DEFAULT_OUTGOING_HTTP_CALL_LOG("/expected-data-template/python/ec2/default/outgoing-http-call-log.mustache"),
PYTHON_EC2_DEFAULT_OUTGOING_HTTP_CALL_METRIC("/expected-data-template/python/ec2/default/outgoing-http-call-metric.mustache"),
Expand Down
2 changes: 2 additions & 0 deletions validator/src/main/java/com/amazon/aoc/models/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public class Context {

private String remoteServiceDeploymentName;

private String remoteResourceIdentifier;

private String endpoint;

private String queryString;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[{
"EC2.AutoScalingGroup": "^eks-.+",
"EC2.InstanceId": "^i-[A-Za-z0-9]{17}$",
"EKS.Cluster": "^{{platformInfo}}$",
"Environment": "^eks:{{platformInfo}}/{{appNamespace}}$",
"K8s.Namespace": "^{{appNamespace}}$",
"K8s.Node": "^i-[A-Za-z0-9]{17}$",
"K8s.Pod": "^python-app-deployment-{{testingId}}(-[A-Za-z0-9]*)*$",
"K8s.Workload": "^python-app-deployment-{{testingId}}$",
"PlatformType": "^AWS::EKS$",
"Service": "^{{serviceName}}$",
"Operation": "GET mysql",
"Version": "^1$",
"Telemetry.Source": "^LocalRootSpan$",
"Host": "^ip(-[0-9]{1,3}){4}.*$"
},
{
"EC2.AutoScalingGroup": "^eks-.+",
"EC2.InstanceId": "^i-[A-Za-z0-9]{17}$",
"EKS.Cluster": "^{{platformInfo}}$",
"Environment": "^eks:{{platformInfo}}/{{appNamespace}}$",
"K8s.Namespace": "^{{appNamespace}}$",
"K8s.Node": "^i-[A-Za-z0-9]{17}$",
"K8s.Pod": "^python-app-deployment-{{testingId}}(-[A-Za-z0-9]*)*$",
"K8s.Workload": "^python-app-deployment-{{testingId}}$",
"PlatformType": "^AWS::EKS$",
"Service": "^{{serviceName}}$",
"Operation": "GET mysql",
"Version": "^1$",
"Telemetry.Source": "^ClientSpan$",
"Host": "^ip(-[0-9]{1,3}){4}.*$",
"RemoteService": "mysql",
"RemoteOperation": "SELECT",
"RemoteResourceType": "DB::Connection",
"RemoteResourceIdentifier": "^{{remoteResourceIdentifier}}$"
}]
Loading