john-jac commented on code in PR #66046: URL: https://github.com/apache/airflow/pull/66046#discussion_r3157663704
########## providers/amazon/tests/system/amazon/aws/example_mwaa_serverless.py: ########## @@ -0,0 +1,59 @@ +# 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. +from __future__ import annotations + +from datetime import datetime + +from airflow.providers.amazon.aws.operators.mwaa_serverless import ( + MwaaServerlessStartWorkflowRunOperator, +) +from airflow.providers.common.compat.sdk import DAG + +from system.amazon.aws.utils import SystemTestContextBuilder + +DAG_ID = "example_mwaa_serverless" + +sys_test_context_task = SystemTestContextBuilder().build() + +# NOTE: This system test requires a pre-existing MWAA Serverless workflow. +# Set the WORKFLOW_ARN variable to the ARN of your workflow. +WORKFLOW_ARN = "arn:aws:mwaa-serverless:us-east-1:123456789012:workflow/example" + +with DAG( + dag_id=DAG_ID, + schedule=None, + start_date=datetime(2024, 1, 1), + catchup=False, +) as dag: + test_context = sys_test_context_task() + + # [START howto_operator_mwaa_serverless_start_workflow_run] + start_workflow = MwaaServerlessStartWorkflowRunOperator( Review Comment: It actually wasn't creating any resources...it was wrongly assuming that they already existed. Now it should create the workflow, run it, then clean up after itself. -- 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]
