Skip to content

Refactor connection creation in system tests to use REST API instead #49804

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 1, 2025

Conversation

ramitkataria
Copy link
Contributor

Since direct DB access is not permitted in Airflow 3 due to Task SDK, the these system tests were failing during connection creation when run with Task SDK. This refactors the tests so they use REST API to create the connection.

Also added a helper method to make REST API calls for tests without having to manually create the request.

I've tested the create_connection task and confirmed it does create the connection.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@boring-cyborg boring-cyborg bot added area:providers provider:amazon AWS/Amazon - related issues labels Apr 26, 2025
@potiuk
Copy link
Member

potiuk commented Apr 26, 2025

We might eventually replace it with with python client - but I think it's good enough for now cc: @VladaZakharova @kosteev ?

@potiuk
Copy link
Member

potiuk commented Apr 26, 2025

BTW. The errors are unrelated - one of them random, one of them being fixed in main.

@ramitkataria ramitkataria force-pushed the ramitkataria/fix-aws-systest-conns branch 2 times, most recently from 57bef8a to 0600974 Compare April 29, 2025 18:11
@ramitkataria ramitkataria force-pushed the ramitkataria/fix-aws-systest-conns branch from 51ec100 to 2893ec6 Compare April 30, 2025 17:17
@ramitkataria
Copy link
Contributor Author

ramitkataria commented Apr 30, 2025

Hi @potiuk

BTW. The errors are unrelated - one of them random, one of them being fixed in main.

Is error occurring right now the one being fixed in main? Otherwise I was thinking of moving the import statement to be inside the function

@potiuk
Copy link
Member

potiuk commented Apr 30, 2025

@ramitkataria -> Generelly when in doubt - rebase and check if it still fails. Always Be Rebased is the motto you should use. That helps to see if the issue is resolved without involving maintainers - they migth or might not know about some current or even new failures. You are 20 commits behind already.

@ramitkataria ramitkataria force-pushed the ramitkataria/fix-aws-systest-conns branch from 2893ec6 to bff0268 Compare May 1, 2025 01:17
Since direct DB access is not permitted in Airflow 3 due to Task SDK,
the these system tests were failing during connection creation when run
with Task SDK. This refactors the tests so they use REST API to create
the connection.

Also added a helper method to make REST API calls for tests without
having to manually create the request.

I've tested the `create_connection` task and confirmed it does create
the connection.
@ramitkataria ramitkataria force-pushed the ramitkataria/fix-aws-systest-conns branch from bff0268 to 2d25b6e Compare May 1, 2025 02:01
@o-nikolas o-nikolas merged commit b2d7894 into apache:main May 1, 2025
97 checks passed
@o-nikolas o-nikolas deleted the ramitkataria/fix-aws-systest-conns branch May 1, 2025 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers provider:amazon AWS/Amazon - related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants