-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Implement integration test for airflowctl with 3.1 #56124
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
Conversation
f0cc805 to
0dc8757
Compare
|
Running locally but until today morning, I have been trying to integrate the keyring into the prod image. I will make a debug/test mode in airflowctl to disable keyring integration for debugging. It is not to include this integration test. This can purely be with Airflow and API. I think we can add additional keyring integration test later on which is another tool and interaction with only 2 lines one for set and one for get, that could be done in a more isolated environment and we don't fill these dependencies in our prod image like gnome-keyring and all the dbus libs which are not related. This makes me think we should provide lighter images for airflowctl to enable easier automations and test these kinds of things with that image |
ba4c93b to
877d465
Compare
|
I undo those commits and enabled debug mode while warning users not to use it if they are not debugging and a warning is raised before each command run they are in debug mode. Maybe we can have airflowctl debug clean or something clean the created files for token |
4e98c61 to
e0be173
Compare
e0be173 to
3e8ed79
Compare
|
will take a look today :) |
gopidesupavan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall
potiuk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIce - few small things to address.
|
Thanks a lot for the comments! I will address them soon :) |
3e8ed79 to
da3ece1
Compare
potiuk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!!!!
c71bfec to
9bd9e3f
Compare
|
Strange, it failed to import python on whales, maybe due to the pytest context. I will try to move Docker creation to conftest in an isolated method |
…gration tests to skip keyring * Warn user while running each command if debug mode enabled and explicitly state it shouldn't be used unless debugging or integration tests
…e, update documentation mistakes
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
9bd9e3f to
c6d8436
Compare
|
All of them install devel-common on pytest init but not airflowctl. Their only difference is having the airflow-core. It could come from there, will check what the difference is |
|
Reproduced locally, seems airflow-ctl-tests/ not using the same venv and trying to create it's own Good version of Docker: 28.3.3.
Good version of docker-compose: 2.39.1
Executable permissions on entrypoints are OK
Running airflowctl integration tests with PROD image: ghcr.io/apache/airflow/main/prod/python3.10
Using airflowctl version: 1.0.0
warning: `VIRTUAL_ENV=/home/bugra/PycharmProjects/airflow/.venv` does not match the project environment path `.venv` and will be ignored; use `--active` to target the active environment instead
ImportError while loading conftest '/home/bugra/PycharmProjects/airflow/airflow-ctl-tests/tests/airflowctl_tests/conftest.py'.
tests/airflowctl_tests/conftest.py:24: in <module>
from python_on_whales import DockerClient, docker
E ModuleNotFoundError: No module named 'python_on_whales' |
|
Okay, it seems an |
…nsole to singleton __init__.py
…nsole to singleton __init__.py
Nice! |
Backport failed to create: v3-1-test. View the failure log Run details
You can attempt to backport this manually by running: cherry_picker 80911e8 v3-1-testThis should apply the commit to the v3-1-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continue |
* Implement initial integration test for airflowctl with 3.1 * password can be passed without interaction, update integration tests * Add AIRFLOW_CLI_DEBUG_MODE for enhanced CLI debugging and update integration tests to skip keyring * Warn user while running each command if debug mode enabled and explicitly state it shouldn't be used unless debugging or integration tests * Move python-on-whales to devel-common, use shared docker-composer file, update documentation mistakes * remove shared python-on-whales from airflow-ctl-tests/ Co-authored-by: Jarek Potiuk <jarek@potiuk.com> * Decouple docker compose logic from test method to pytest_sessionstart in conftest * Move python_on_whale import to file level * Reorder dependencies in pyproject.toml for consistency * Add workspace to main pyproject.toml, remove unused variable, move console to singleton __init__.py * Add workspace to main pyproject.toml, remove unused variable, move console to singleton __init__.py --------- Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
* Implement initial integration test for airflowctl with 3.1 * password can be passed without interaction, update integration tests * Add AIRFLOW_CLI_DEBUG_MODE for enhanced CLI debugging and update integration tests to skip keyring * Warn user while running each command if debug mode enabled and explicitly state it shouldn't be used unless debugging or integration tests * Move python-on-whales to devel-common, use shared docker-composer file, update documentation mistakes * remove shared python-on-whales from airflow-ctl-tests/ Co-authored-by: Jarek Potiuk <jarek@potiuk.com> * Decouple docker compose logic from test method to pytest_sessionstart in conftest * Move python_on_whale import to file level * Reorder dependencies in pyproject.toml for consistency * Add workspace to main pyproject.toml, remove unused variable, move console to singleton __init__.py * Add workspace to main pyproject.toml, remove unused variable, move console to singleton __init__.py --------- (cherry picked from commit 80911e8) Co-authored-by: Bugra Ozturk <bugraoz93@users.noreply.github.com> Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
* Implement initial integration test for airflowctl with 3.1 * password can be passed without interaction, update integration tests * Add AIRFLOW_CLI_DEBUG_MODE for enhanced CLI debugging and update integration tests to skip keyring * Warn user while running each command if debug mode enabled and explicitly state it shouldn't be used unless debugging or integration tests * Move python-on-whales to devel-common, use shared docker-composer file, update documentation mistakes * remove shared python-on-whales from airflow-ctl-tests/ Co-authored-by: Jarek Potiuk <jarek@potiuk.com> * Decouple docker compose logic from test method to pytest_sessionstart in conftest * Move python_on_whale import to file level * Reorder dependencies in pyproject.toml for consistency * Add workspace to main pyproject.toml, remove unused variable, move console to singleton __init__.py * Add workspace to main pyproject.toml, remove unused variable, move console to singleton __init__.py --------- Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
* Implement initial integration test for airflowctl with 3.1 * password can be passed without interaction, update integration tests * Add AIRFLOW_CLI_DEBUG_MODE for enhanced CLI debugging and update integration tests to skip keyring * Warn user while running each command if debug mode enabled and explicitly state it shouldn't be used unless debugging or integration tests * Move python-on-whales to devel-common, use shared docker-composer file, update documentation mistakes * remove shared python-on-whales from airflow-ctl-tests/ Co-authored-by: Jarek Potiuk <jarek@potiuk.com> * Decouple docker compose logic from test method to pytest_sessionstart in conftest * Move python_on_whale import to file level * Reorder dependencies in pyproject.toml for consistency * Add workspace to main pyproject.toml, remove unused variable, move console to singleton __init__.py * Add workspace to main pyproject.toml, remove unused variable, move console to singleton __init__.py --------- (cherry picked from commit 80911e8) Co-authored-by: Bugra Ozturk <bugraoz93@users.noreply.github.com> Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
… (#56986) * [v3-1-test] Implement integration test for airflowctl with 3.1 (#56124) * Implement initial integration test for airflowctl with 3.1 * password can be passed without interaction, update integration tests * Add AIRFLOW_CLI_DEBUG_MODE for enhanced CLI debugging and update integration tests to skip keyring * Warn user while running each command if debug mode enabled and explicitly state it shouldn't be used unless debugging or integration tests * Move python-on-whales to devel-common, use shared docker-composer file, update documentation mistakes * remove shared python-on-whales from airflow-ctl-tests/ Co-authored-by: Jarek Potiuk <jarek@potiuk.com> * Decouple docker compose logic from test method to pytest_sessionstart in conftest * Move python_on_whale import to file level * Reorder dependencies in pyproject.toml for consistency * Add workspace to main pyproject.toml, remove unused variable, move console to singleton __init__.py * Add workspace to main pyproject.toml, remove unused variable, move console to singleton __init__.py --------- (cherry picked from commit 80911e8) Co-authored-by: Bugra Ozturk <bugraoz93@users.noreply.github.com> Co-authored-by: Jarek Potiuk <jarek@potiuk.com> * Remove e2e tests came from merge and rerun breeze images for all commands to fix accepting changes while merging * Add env file to compose and update error --------- Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
closes: #54243
Runs API Server
Executes airflowctl commands listed
It controls generic error, aligns with airflowctl client error handling
If no error means the command was successful
Future work, as an enhancement, we can add expected response as well, but I think this should already cover integration with the API without getting an error from the API.
^ 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.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.