[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: b7393297a2c65e8aef5762d7c17056985c0d2bae / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: e46df75b2ad158f607d882b432378c4e3823d657 / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 63a478dce6fd0dd2e9ef709b3c21e2cdc0d2bc08 / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 654a6957860c966fc764e502c161ba1f3defa370 / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: b63b5d591eb631eca2044f37347a6ffe01882c1b / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 654a6957860c966fc764e502c161ba1f3defa370 / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: b7393297a2c65e8aef5762d7c17056985c0d2bae / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 654a6957860c966fc764e502c161ba1f3defa370 / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 654a6957860c966fc764e502c161ba1f3defa370 / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 1a4375dae3f813f2e297516f44f3c267e2aba89f / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 7b2c54f1051b18ce779d98413bc10e6bd3db4175 / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 6be3ac56dc4490fefd468abe85ecbea7df722f56 / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 6305d866a3b17b623cad2d8990ffa0e4483d7d5d / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 8fd3beb5ad240715f031a6cd7d46d381399b3c09 / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 9156a2a2351a38d663b0a195c074b1e097c4cd5f / vincbeck Test Report URL: https://github.com/apache/airflow/actions/runs/17862118178 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 16a53821138b378294b116103e7408ef4a34ace5 / vincbeck Test Report URL: https://github.com/apache/airflow/actions/runs/17860608008 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 15a64af809b9719554efcb1c938cfb7df3f9ec67 / vincbeck Test Report URL: https://github.com/apache/airflow/actions/runs/17839604373 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 9ef74202bfb7f12132a87e10f2c2582863f752ba / vincbeck Test Report URL: https://github.com/apache/airflow/actions/runs/17837448214 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 350ead406f86969444fb36b10fb22024ae7de372 / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 3ef7a1c81ffad788f6435235a964e93b732190c6 / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: d910b02019b9c86cadea76ea0f478cd705349e60 / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 689a5ecaa35d84fbd67fad83a484bf6e757760b4 / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 7a9f23d8108cd838f9f96e9717d2b829530664b6 / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 7af08681d022afb4d598e3779227edde6977799f / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: cfdb2b7504cdc2b35854399f5e630fafd8d0dc27 / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 6e72f96625ee8b23eb5cce8178c0be0403136d88 / Dev-iL Fix TP's comments (#317) * Fix TP's comments * Update devel-common/src/tests_common/pytest_plugin.py Co-authored-by: Copilot <[email protected]> - Co-authored-by: Jarek Potiuk Co-authored-by: Copilot <[email protected]> Report URL: https://github.com/apache/airflow/actions/runs/16759979286 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: 8e26836673334db1de903f89f21b37451cd1ac25 / Dev-iL Fix TP's comments (#317) * Fix TP's comments * Update devel-common/src/tests_common/pytest_plugin.py Co-authored-by: Copilot <[email protected]> - Co-authored-by: Jarek Potiuk Co-authored-by: Copilot <[email protected]> Report URL: https://github.com/apache/airflow/actions/runs/16397902916 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: e7f79716b7d9031fe4b7b6aa0a98356170791bb5 / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing this
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: bcc070981e21b6c6bfc288143bc2aadd7a0a81cc / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing this
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 6ad87d5dd3b48515a42d6d6f9c739481ef4864f6 / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: 656ca96eb73ce111ca18ace05cf58f356bb5064e / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing this
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: 73602a7915d8d26ef18a1c27f343748fcd0af240 / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing this
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: 97e5adcd8a75e2078f2de86506dba288ca0e84ff / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing this
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 159c584228d7f4900ae080692390617ceef59f53 / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: bca62204f53904254c33281224e2dd62281d751c / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: b36e9f87465faf4c67b357de41d2b3544b559ea5 / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 99de14f96d0db2349f940b3ecb599b44f1b05db2 / Jarek Potiuk Upgrade FAB to FAB 5 Switch to using flask-sqlalchemy db session management, and include Auth Manager Provider Test Isolation and Reliability - Refactor test fixtures to always use Flask app contexts for DB and app operations. - Add a global pytest fixture to clear SQLAlchemy metadata before each test, reducing test flakiness. - Standardize session access and cleanup patterns across all tests. - Refactor user/role creation and deletion to ensure proper isolation. - Update test logic to use new app and auth manager creation utilities. - Remove or update redundant or fragile test code. - Normalize test constants and improve code readability. Note: Clearing SQLAlchemy metadata and explicit app context management are workarounds for test isolation issues. The root cause of metadata and pool persistence between tests should be investigated further for a more robust solution. General Theme: The main strategies are: * Ensuring proper use of Flask app contexts in tests * Cleaning up database state and metadata between tests * Using the correct SQLAlchemy session and interface patterns * Refactoring test fixtures for better isolation and reliability * Removing or updating code that is no longer needed or that could cause test flakiness Key File-by-File Changes 1. providers/fab/tests/unit/fab/conftest.py (New file) What: Adds a global pytest fixture that clears SQLAlchemy metadata before each test. Why: This is to prevent metadata leakage between tests, which can cause flaky or non-deterministic test results. Uncertainty: Clearing metadata is a workaround; the root cause of metadata persistence between tests may need deeper investigation. 2. Test files for API endpoints, CLI commands, models, schemas, and views What: * Many test fixtures now use with app.app_context(): to ensure all DB and app operations are performed within a Flask application context. * User and role creation/deletion is now always wrapped in an app context. * Some teardown logic is moved into the fixture's context manager to ensure cleanup happens after the test. * Session access is standardized to use appbuilder.session instead of get_session. * Some test constants (e.g., default times) are normalized (e.g., removing timezone info). * Some test logic is refactored for clarity and reliability (e.g., using addfinalizer for logout in user endpoint tests). Why: Ensures that tests do not leak state or context, which can cause failures when running tests in parallel or in different environments. Using the correct session and context patterns is more robust and future-proof. Uncertainty: While these changes improve test isolation, the need to clear metadata and manage app contexts so explicitly suggests there may be deeper issues with how the test environment is set up or torn down. Further investigation into the test infrastructure may be warranted. 3. test_fab_auth_manager.py and related files What: * Switches to using the new create_app and get_auth_manager utilities for creating Flask apps and auth managers. * Updates test logic to use the new app and session patterns. * Fixes some test assertions to compare user IDs instead of user objects directly. * Moves some permission synchronization logic to after DAG creation and session commit. Why: These changes align the tests with the latest best practices and APIs in Airflow and Flask AppBuilder. They also fix subtle bugs where tests could pass or fail depending on object identity rather than value. Uncertainty: The need to manually commit and close sessions, and to synchronize permissions, may indicate that the test setup/teardown is not fully robust. 4. test_security.py What: * Removes some unused or redundant code (e.g., a test for DAG permission views). * Updates session and app context usage. Why: Cleans up the test suite and ensures all tests are using the correct patterns. Uncertainty: The removal of some tests may need to be reviewed to ensure no loss of coverage. 5. Miscellaneous What: * Minor formatting and import cleanups. * Some test parameters and constants are updated for consistency. Why: Improves code readability and maintainability. Summary of Uncertainties and Next Steps * Clearing SQLAlchemy metadata and disposing pools: These are workarounds for test isolation issues. The root cause (why metadata and pools persist between tests) should be investigated further. Ideally, the test infrastructure should handle this automatically. App context management: The need for explicit app contexts in so many places may indicate that the test setup could be improved to provide a more consistent environment. Session and teardown logic: Manual session management and teardown in tests can be error-prone. Consider centralizing t
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: 54477dcf14e2c64765b9074906a5db7bdf0a9467 / Jarek Potiuk fixup! fixup! fixup! fixup! fixup! feat: add color support for XCom json (#51323) Report URL: https://github.com/apache/airflow/actions/runs/15456299285 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: 621ff5b0ebf0388276252799d9cc058256880bd8 / Jarek Potiuk fixup! fixup! fixup! fixup! feat: add color support for XCom json (#51323) Report URL: https://github.com/apache/airflow/actions/runs/15455800315 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: 382f02cc6f92eae909b0f2a3a11c0585adf3d607 / Jarek Potiuk fixup! fixup! fixup! feat: add color support for XCom json (#51323) Report URL: https://github.com/apache/airflow/actions/runs/15455225288 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: a6365146637794acffeff10a7f0d21bd872bf64d / Jarek Potiuk fixup! fixup! feat: add color support for XCom json (#51323) Report URL: https://github.com/apache/airflow/actions/runs/15454438747 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: 434b4287ea6fc199fe9f7dcdb7003d06a5aa8ada / Jarek Potiuk fixup! feat: add color support for XCom json (#51323) Report URL: https://github.com/apache/airflow/actions/runs/15452379440 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: 9a9dc46fa88e88f00b0d1e45ba6b667c27e1c9a7 / Jarek Potiuk fixup! fixup! Partially fix `tests/unit/fab/auth_manager/cli_commands/test_user_command.py` Report URL: https://github.com/apache/airflow/actions/runs/15450038206 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: 90f42c8693cf5f9efcd951d4583ad3ff1131370a / vincbeck Partially fix `tests/unit/fab/auth_manager/cli_commands/test_user_command.py` Report URL: https://github.com/apache/airflow/actions/runs/15441968673 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: cb10f9926fea1b86709d2bf7436b56074639781d / vincbeck Merge branch 'main' into fab-5 Report URL: https://github.com/apache/airflow/actions/runs/15424977060 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 3f8d3487335f305751b86f20c8767e13491f4645 / vincbeck Merge branch 'main' into fab-5 Report URL: https://github.com/apache/airflow/actions/runs/15422977491 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: db27558242ffdd88c0e7ae8366b002d9346ef0cb / Jarek Potiuk fixup! Fix `providers/fab/tests/unit/fab/auth_manager/models/test_db.py` Report URL: https://github.com/apache/airflow/actions/runs/15421163318 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: bfb85671bf930d5eb4f6ceb96b662fc7b40dc53c / vincbeck Fix `providers/fab/tests/unit/fab/auth_manager/models/test_db.py` Report URL: https://github.com/apache/airflow/actions/runs/15419009511 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: 185e5ee4499f427132e260524a27520fb30436ba / Jarek Potiuk fixup! fixup! Fix `tests/unit/fab/auth_manager/schemas/test_role_and_permission_schema.py` Report URL: https://github.com/apache/airflow/actions/runs/15418065688 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: d860130d2ddd02128d2d9146175706a574a5f7aa / Jarek Potiuk fixup! Fix `tests/unit/fab/auth_manager/schemas/test_role_and_permission_schema.py` Report URL: https://github.com/apache/airflow/actions/runs/15416707197 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: 844ae7f3c5dcc79d6ec63dff04bc100ab5f8cbe9 / vincbeck Fix `tests/unit/fab/auth_manager/schemas/test_role_and_permission_schema.py` Report URL: https://github.com/apache/airflow/actions/runs/15414901784 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 1bbada0c0f49336c2f7c7717cd8e9a3742742023 / vincbeck Fix `tests/unit/fab/auth_manager/schemas/test_role_and_permission_schema.py` Report URL: https://github.com/apache/airflow/actions/runs/15400630936 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 452baef66aade27e6a9d7bf7439191803b37a471 / vincbeck Fix FAB auth manager tests Report URL: https://github.com/apache/airflow/actions/runs/15399492601 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: a7142e18c6e67f609c2ddd4590331c8bef54da0f / vincbeck Fix k8s tests attempt Report URL: https://github.com/apache/airflow/actions/runs/15397849946 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: 950589be91f02148933e887a1d8e796e03c18e4e / vincbeck Move `conftest` Report URL: https://github.com/apache/airflow/actions/runs/15389169491 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: b51fbc3ad974a641dcb84960037016b7066d83c2 / vincbeck Move `conftest` Report URL: https://github.com/apache/airflow/actions/runs/15333561429 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 4dfc907f6bdc86a4c9bb941f61accebdc5333b13 / vincbeck Fix `providers/fab/tests/unit/fab/www/views/test_views_custom_user_views.py` Report URL: https://github.com/apache/airflow/actions/runs/15332549872 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 68b514019c359d93d30d1a82cca71c44188c8729 / vincbeck Logout the user after test Report URL: https://github.com/apache/airflow/actions/runs/15330639295 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: 1f8e496a3e5dad0055b896d7ad951282111d5313 / Jarek Potiuk fixup! fixup! fixup! fixup! Revert "fixup! fixup! Upgrade `Flask-appbuilder` to 5" Report URL: https://github.com/apache/airflow/actions/runs/15329336449 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: 6ded9d24b79a8534915722a7e707ed2c39448d13 / Jarek Potiuk fixup! fixup! Revert "fixup! fixup! Upgrade `Flask-appbuilder` to 5" Report URL: https://github.com/apache/airflow/actions/runs/15325701169 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: 09a7322f8335286ecfd28849ce31af1e1565a033 / Jarek Potiuk fixup! Revert "fixup! fixup! Upgrade `Flask-appbuilder` to 5" Report URL: https://github.com/apache/airflow/actions/runs/15320837036 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: b831ee4972405225b17b5468aa40c2cdd2eb28c0 / Jarek Potiuk fixup! Revert "fixup! fixup! Upgrade `Flask-appbuilder` to 5" Report URL: https://github.com/apache/airflow/actions/runs/15208137612 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: 494f6edbcce0b01ce60ed831d296836010c3afb2 / Jarek Potiuk fixup! Revert "fixup! fixup! Upgrade `Flask-appbuilder` to 5" Report URL: https://github.com/apache/airflow/actions/runs/15197102230 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: 76e303fbe8318d334a5324288b68982290fafc3b / Jarek Potiuk fixup! Revert "fixup! fixup! Upgrade `Flask-appbuilder` to 5" Report URL: https://github.com/apache/airflow/actions/runs/15195863774 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: 39cb3adedf4a3fe093a9b99cd0cf0e0f5951217a / vincbeck Revert "fixup! fixup! Upgrade `Flask-appbuilder` to 5" This reverts commit f0b0d4f3d0390ae236dcc0c2fd99294f0ce5aeb7. Report URL: https://github.com/apache/airflow/actions/runs/15193955108 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user vincbeck (triggered by vincbeck). Head commit for run: b86c63ee6ed092eba6361560baf928df9dca58e9 / vincbeck Use already initialized DB instead of creating new one Report URL: https://github.com/apache/airflow/actions/runs/15191367015 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: f0b0d4f3d0390ae236dcc0c2fd99294f0ce5aeb7 / Jarek Potiuk fixup! fixup! Upgrade `Flask-appbuilder` to 5 Report URL: https://github.com/apache/airflow/actions/runs/15189687286 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: 7d91cb624c5f9594689bd53e8748f83aafb59b0d / Jarek Potiuk fixup! Upgrade `Flask-appbuilder` to 5 Report URL: https://github.com/apache/airflow/actions/runs/15188717396 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[GH] (airflow/fab-5): Workflow run "Tests AMD" failed!
The GitHub Actions job "Tests AMD" on airflow.git/fab-5 has failed. Run started by GitHub user potiuk (triggered by potiuk). Head commit for run: 88c303567b0f7439a51b428590e1d138129a798f / vincbeck Upgrade `Flask-appbuilder` to 5 Report URL: https://github.com/apache/airflow/actions/runs/15187353834 With regards, GitHub Actions via GitBox - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
