derrickaw commented on code in PR #38362: URL: https://github.com/apache/beam/pull/38362#discussion_r3208821702
########## sdks/python/apache_beam/yaml/tests/datadog.yaml: ########## @@ -0,0 +1,63 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +fixtures: + - name: DATADOG_AGENT + type: "apache_beam.yaml.integration_tests.temp_datadog_agent" + config: + expected_records: + - { ddsource: "apache-beam1", ddtags: "test-tags1", hostname: "test-host", service: "test-service", message: "Event for label 11a" } + - { ddsource: "apache-beam2", ddtags: "test-tags2", hostname: "test-host", service: "test-service", message: "Event for label 37a" } + - { ddsource: "apache-beam3", ddtags: "test-tags3", hostname: "test-host", service: "test-service", message: "Event for label 389a" } + - { ddsource: "apache-beam4", ddtags: "test-tags4", hostname: "test-host", service: "test-service", message: "Event for label 3821b" } + +pipelines: + - pipeline: + type: composite + transforms: + - type: Create + config: + elements: + - { ddsource: "apache-beam1", ddtags: "test-tags1", hostname: "test-host", service: "test-service", message: "Event for label 11a" } + - { ddsource: "apache-beam2", ddtags: "test-tags2", hostname: "test-host", service: "test-service", message: "Event for label 37a" } + - { ddsource: "apache-beam3", ddtags: "test-tags3", hostname: "test-host", service: "test-service", message: "Event for label 389a" } + - { ddsource: "apache-beam4", ddtags: "test-tags4", hostname: "test-host", service: "test-service", message: "Event for label 3821b" } + - { ddsource: "apache-beam-broken", hostname: "test-host" } # Triggers mandatory field failure + - type: WriteToDatadog + input: Create + config: + url: "{DATADOG_AGENT.url}" + api_key: "{DATADOG_AGENT.api_key}" + min_batch_count: 1 + batch_count: 2 + max_buffer_size: 1000 + parallelism: 1 + error_handling: + output: error_output + - type: MapToFields + input: WriteToDatadog.error_output + config: + language: python + fields: + failed_source: "failed_row.ddsource" + - type: AssertEqual + input: MapToFields + config: + elements: + - { failed_source: "apache-beam-broken" } + # Asserting good records is taken care of by the fixture Review Comment: We don't have read capabilities straight from Yaml, so the only way I could figure out how to verify the good records was to add the verification as part of the integration testing via checking the records on the test container for datadog before teardown. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
