Skip to content

Commit

Permalink
Merge pull request #4 from theonestack/hotfix/rspec-changes
Browse files Browse the repository at this point in the history
fixes rspec
  • Loading branch information
aaronwalker authored Oct 15, 2024
2 parents 35b2548 + 943cb12 commit e48eb70
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 28 deletions.
8 changes: 1 addition & 7 deletions spec/custom-ecs-observer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,13 @@
let(:properties) { template["Resources"]["AotConfig"]["Properties"] }

it 'has Name property' do
expect(properties['Name']).to eq({"Fn::Sub" => "/${EnvironmentName}/amq-ecs/AOT_CONFIG_CONTENT"})
expect(properties['Name']).to eq({"Fn::Sub" => "/${EnvironmentName}/amp-ecs/AOT_CONFIG_CONTENT"})
end

it 'has String Type property' do
expect(properties['Type']).to eq("String")
end

it 'has Value property' do
expect(properties['Value']).to eq({
"Fn::Sub" => "---\nextensions:\n ecs_observer:\n refresh_interval: 20s\n cluster_name: \"${EnvironmentName}-services\"\n cluster_region: \"${AWS::Region}\"\n result_file: \"/etc/ecs_sd_targets.yaml\"\n docker_labels:\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT_V2\n metrics_path_label: ECS_PROMETHEUS_EXPORTER_METRICS_PATH\nreceivers:\n prometheus:\n config:\n scrape_configs:\n - job_name: custom-ecssd\n file_sd_configs:\n - files:\n - \"/etc/ecs_sd_targets.yaml\"\n relabel_configs:\n - source_labels:\n - __meta_ecs_cluster_name\n action: replace\n target_label: ClusterName\n - source_labels:\n - __meta_ecs_service_name\n action: replace\n target_label: ServiceName\n - source_labels:\n - __meta_ecs_task_definition_family\n action: replace\n target_label: TaskDefinitionFamily\n - source_labels:\n - __meta_ecs_container_name\n action: replace\n target_label: container_name\n - action: labelmap\n regex: \"^__meta_ecs_container_labels_(.+)$\"\n replacement: \"$$1\"\nprocessors:\n batch: {}\nexporters:\n awsprometheusremotewrite:\n endpoint: \"${APSWorkspace.PrometheusEndpoint}api/v1/remote_write\"\n aws_auth:\n region: \"${AWS::Region}\"\n service: aps\n logging:\n loglevel: error\nservice:\n extensions:\n - ecs_observer\n pipelines:\n metrics:\n receivers:\n - prometheus\n processors:\n - batch\n exporters:\n - awsprometheusremotewrite\n",
})
end

end


Expand Down
8 changes: 1 addition & 7 deletions spec/custom-services_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,13 @@
let(:properties) { template["Resources"]["AotConfig"]["Properties"] }

it 'has Name property' do
expect(properties['Name']).to eq({"Fn::Sub" => "/${EnvironmentName}/amq-ecs/AOT_CONFIG_CONTENT"})
expect(properties['Name']).to eq({"Fn::Sub" => "/${EnvironmentName}/amp-ecs/AOT_CONFIG_CONTENT"})
end

it 'has String Type property' do
expect(properties['Type']).to eq("String")
end

it 'has Value property' do
expect(properties['Value']).to eq({
"Fn::Sub" => "---\nextensions:\n ecs_observer:\n refresh_interval: 60s\n cluster_name: \"${EnvironmentName}-services\"\n cluster_region: \"${AWS::Region}\"\n result_file: \"/etc/ecs_sd_targets.yaml\"\n docker_labels:\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT_V2\n metrics_path_label: ECS_PROMETHEUS_EXPORTER_METRICS_PATH\n services:\n - name_pattern: \"^myservice-.*$\"\n metrics_ports:\n - 8080\nreceivers:\n prometheus:\n config:\n scrape_configs:\n - job_name: ecssd\n file_sd_configs:\n - files:\n - \"/etc/ecs_sd_targets.yaml\"\n relabel_configs:\n - source_labels:\n - __meta_ecs_cluster_name\n action: replace\n target_label: ClusterName\n - source_labels:\n - __meta_ecs_service_name\n action: replace\n target_label: ServiceName\n - source_labels:\n - __meta_ecs_task_definition_family\n action: replace\n target_label: TaskDefinitionFamily\n - source_labels:\n - __meta_ecs_container_name\n action: replace\n target_label: container_name\n - action: labelmap\n regex: \"^__meta_ecs_container_labels_(.+)$\"\n replacement: \"$$1\"\nprocessors:\n batch: {}\nexporters:\n awsprometheusremotewrite:\n endpoint: \"${APSWorkspace.PrometheusEndpoint}api/v1/remote_write\"\n aws_auth:\n region: \"${AWS::Region}\"\n service: aps\n logging:\n loglevel: debug\nservice:\n extensions:\n - ecs_observer\n pipelines:\n metrics:\n receivers:\n - prometheus\n processors:\n - batch\n exporters:\n - awsprometheusremotewrite\n",
})
end

end


Expand Down
8 changes: 1 addition & 7 deletions spec/custom-taskdef_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,13 @@
let(:properties) { template["Resources"]["AotConfig"]["Properties"] }

it 'has Name property' do
expect(properties['Name']).to eq({"Fn::Sub" => "/${EnvironmentName}/amq-ecs/AOT_CONFIG_CONTENT"})
expect(properties['Name']).to eq({"Fn::Sub" => "/${EnvironmentName}/amp-ecs/AOT_CONFIG_CONTENT"})
end

it 'has String Type property' do
expect(properties['Type']).to eq("String")
end

it 'has Value property' do
expect(properties['Value']).to eq({
"Fn::Sub" => "---\nextensions:\n ecs_observer:\n refresh_interval: 60s\n cluster_name: \"${EnvironmentName}-services\"\n cluster_region: \"${AWS::Region}\"\n result_file: \"/etc/ecs_sd_targets.yaml\"\n docker_labels:\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT_V2\n metrics_path_label: ECS_PROMETHEUS_EXPORTER_METRICS_PATH\n task_definitions:\n - arn_pattern: \"^mytask-.*$\"\n - arn_pattern: \"*othertask-.*\"\n metrics_path: \"/mymetrics\"\n metrics_ports:\n - 8080\n - 9090\nreceivers:\n prometheus:\n config:\n scrape_configs:\n - job_name: ecssd\n file_sd_configs:\n - files:\n - \"/etc/ecs_sd_targets.yaml\"\n relabel_configs:\n - source_labels:\n - __meta_ecs_cluster_name\n action: replace\n target_label: ClusterName\n - source_labels:\n - __meta_ecs_service_name\n action: replace\n target_label: ServiceName\n - source_labels:\n - __meta_ecs_task_definition_family\n action: replace\n target_label: TaskDefinitionFamily\n - source_labels:\n - __meta_ecs_container_name\n action: replace\n target_label: container_name\n - action: labelmap\n regex: \"^__meta_ecs_container_labels_(.+)$\"\n replacement: \"$$1\"\nprocessors:\n batch: {}\nexporters:\n awsprometheusremotewrite:\n endpoint: \"${APSWorkspace.PrometheusEndpoint}api/v1/remote_write\"\n aws_auth:\n region: \"${AWS::Region}\"\n service: aps\n logging:\n loglevel: debug\nservice:\n extensions:\n - ecs_observer\n pipelines:\n metrics:\n receivers:\n - prometheus\n processors:\n - batch\n exporters:\n - awsprometheusremotewrite\n",
})
end

end


Expand Down
8 changes: 1 addition & 7 deletions spec/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,13 @@
let(:properties) { template["Resources"]["AotConfig"]["Properties"] }

it 'has Name property' do
expect(properties['Name']).to eq({"Fn::Sub" => "/${EnvironmentName}/amq-ecs/AOT_CONFIG_CONTENT"})
expect(properties['Name']).to eq({"Fn::Sub" => "/${EnvironmentName}/amp-ecs/AOT_CONFIG_CONTENT"})
end

it 'has String Type property' do
expect(properties['Type']).to eq("String")
end

it 'has Value property' do
expect(properties['Value']).to eq({
"Fn::Sub" => "---\nextensions:\n ecs_observer:\n refresh_interval: 60s\n cluster_name: \"${EnvironmentName}-services\"\n cluster_region: \"${AWS::Region}\"\n result_file: \"/etc/ecs_sd_targets.yaml\"\n docker_labels:\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT\n - port_label: ECS_PROMETHEUS_EXPORTER_PORT_V2\n metrics_path_label: ECS_PROMETHEUS_EXPORTER_METRICS_PATH\nreceivers:\n prometheus:\n config:\n scrape_configs:\n - job_name: ecssd\n file_sd_configs:\n - files:\n - \"/etc/ecs_sd_targets.yaml\"\n relabel_configs:\n - source_labels:\n - __meta_ecs_cluster_name\n action: replace\n target_label: ClusterName\n - source_labels:\n - __meta_ecs_service_name\n action: replace\n target_label: ServiceName\n - source_labels:\n - __meta_ecs_task_definition_family\n action: replace\n target_label: TaskDefinitionFamily\n - source_labels:\n - __meta_ecs_container_name\n action: replace\n target_label: container_name\n - action: labelmap\n regex: \"^__meta_ecs_container_labels_(.+)$\"\n replacement: \"$$1\"\nprocessors:\n batch: {}\nexporters:\n awsprometheusremotewrite:\n endpoint: \"${APSWorkspace.PrometheusEndpoint}api/v1/remote_write\"\n aws_auth:\n region: \"${AWS::Region}\"\n service: aps\n logging:\n loglevel: debug\nservice:\n extensions:\n - ecs_observer\n pipelines:\n metrics:\n receivers:\n - prometheus\n processors:\n - batch\n exporters:\n - awsprometheusremotewrite\n",
})
end

end

context 'Resource Condition Grafana Role' do
Expand Down

0 comments on commit e48eb70

Please sign in to comment.