hussein-awala commented on code in PR #36275:
URL: https://github.com/apache/airflow/pull/36275#discussion_r1430616725
##########
tests/api_connexion/endpoints/test_dag_run_endpoint.py:
##########
@@ -1861,3 +1861,17 @@ def test_should_respond_404(self):
environ_overrides={"REMOTE_USER": "test"},
)
assert response.status_code == 404
+
+ def test_should_respond_200_with_anonymous_user(self, dag_maker, session):
+ self.app.config["AIRFLOW__API__AUTH_BACKENDS"] =
"airflow.api.auth.backend.default"
+ self.app.config["AUTH_ROLE_PUBLIC"] = "Admin"
+
+ dag_runs = self._create_test_dag_run(DagRunState.SUCCESS)
+ session.add_all(dag_runs)
+ session.commit()
+ created_dr = dag_runs[0]
+ response = self.client.post(
+ f"api/v1/dags/{created_dr.dag_id}/dagRuns",
+ json={"dag_run_id": "TEST_DAG_RUN_ID_1", "note": "I am setting a
note with anonymous user"},
+ )
+ assert response.status_code == 200
Review Comment:
There were some problems in the implemented test (wrong endpoint, wrong
method, the application was already created and configured, etc.). I just
pushed a commit to fix it, and I tested it before (I had SQL integrity
exception) and after your change (it works).
--
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]