diff --git a/airflow/providers/jenkins/example_dags/__init__.py b/airflow/providers/jenkins/example_dags/__init__.py deleted file mode 100644 index 217e5db960782..0000000000000 --- a/airflow/providers/jenkins/example_dags/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -# 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. diff --git a/docs/apache-airflow-providers-jenkins/index.rst b/docs/apache-airflow-providers-jenkins/index.rst index 9a23555000ed5..f9fec0645e6ad 100644 --- a/docs/apache-airflow-providers-jenkins/index.rst +++ b/docs/apache-airflow-providers-jenkins/index.rst @@ -37,7 +37,7 @@ Content :maxdepth: 1 :caption: Resources - Example DAGs + Example DAGs PyPI Repository Installing from sources diff --git a/airflow/providers/jenkins/example_dags/example_jenkins_job_trigger.py b/tests/system/providers/jenkins/example_jenkins_job_trigger.py similarity index 91% rename from airflow/providers/jenkins/example_dags/example_jenkins_job_trigger.py rename to tests/system/providers/jenkins/example_jenkins_job_trigger.py index ce2c8ac5efab0..248beafe55a14 100644 --- a/airflow/providers/jenkins/example_dags/example_jenkins_job_trigger.py +++ b/tests/system/providers/jenkins/example_jenkins_job_trigger.py @@ -15,6 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +import os from datetime import datetime from requests import Request @@ -25,9 +26,11 @@ from airflow.providers.jenkins.operators.jenkins_job_trigger import JenkinsJobTriggerOperator JENKINS_CONNECTION_ID = "your_jenkins_connection" +ENV_ID = os.environ.get("SYSTEM_TESTS_ENV_ID") +DAG_ID = "test_jenkins" with DAG( - "test_jenkins", + DAG_ID, default_args={ "retries": 1, "concurrency": 8, @@ -65,3 +68,9 @@ def grab_artifact_from_jenkins(url): # Task dependency created via `XComArgs`: # job_trigger >> grab_artifact_from_jenkins() + + +from tests.system.utils import get_test_run # noqa: E402 + +# Needed to run the example DAG with pytest (see: tests/system/README.md#run_via_pytest) +test_run = get_test_run(dag)