Skip to content

[Review] Fix main branch failing tests#1

Open
govambam wants to merge 1 commit into
base-for-pr-2296from
review-pr-2296
Open

[Review] Fix main branch failing tests#1
govambam wants to merge 1 commit into
base-for-pr-2296from
review-pr-2296

Conversation

@govambam
Copy link
Copy Markdown
Owner

Recreated from astronomer#2296 for Macroscope review.

Original PR: astronomer#2296 by @tatiana
Status: closed (merged)

Recreated using squash merge commit - exact merged state preserved.

Original PR: astronomer#2296

Minimal changes on astronomer#2261 to see tests passing without changing the
original branch

I also created a PR on the @YourRoyalLinus PR:
YourRoyalLinus#1

This is a summary of the main issues:

(1) Some integration tests were failing with:
```
    ERROR tests/test_example_dags.py - AssertionError: assert not {'/home/runner/work/astronomer-cosmos/astronomer-cosmos/dev/dags/cosmos_manifest_selectors_example.py': 'Traceback (mo...he required Object Storage feature is unavailable in Airflow version 2.7.0. Please upgrade to Airflow 2.8 or later.\n'}
     +  where {'/home/runner/work/astronomer-cosmos/astronomer-cosmos/dev/dags/cosmos_manifest_selectors_example.py': 'Traceback (mo...he required Object Storage feature is unavailable in Airflow version 2.7.0. Please upgrade to Airflow 2.8 or later.\n'} = <airflow.models.dagbag.DagBag object at 0x7fa3c6e724d0>.import_errors
    ERROR tests/test_example_dags_no_connections.py - AssertionError: assert not {'/home/runner/work/astronomer-cosmos/astronomer-cosmos/dev/dags/cosmos_manifest_selectors_example.py': 'Traceback (mo...he required Object Storage feature is unavailable in Airflow version 2.7.0. Please upgrade to Airflow 2.8 or later.\n'}
     +  where {'/home/runner/work/astronomer-cosmos/astronomer-cosmos/dev/dags/cosmos_manifest_selectors_example.py': 'Traceback (mo...he required Object Storage feature is unavailable in Airflow version 2.7.0. Please upgrade to Airflow 2.8 or later.\n'} = <airflow.models.dagbag.DagBag object at 0x7fa3be1d89d0>.import_errors
```

The reason is "Object Storage feature is unavailable in Airflow version
2.7.0. Please upgrade to Airflow 2.8 or later". This is how you can fix
it:
astronomer@424a9a1

(2) dbt Fusion tests stopped working because the YAML selector file
defined a default selector, which did not select any nodes in the
`jaffle_shop` dbt project.

There were dbt Fusion tests that referenced the dbt project
`jaffle_shop` that were changed and would actually run the DAG and check
the DAG topology - including which nodes were rendered.

Since we set the default selector to not match any nodes, this behaviour
changed:
```
=========================== short test summary info ============================
FAILED tests/test_dbtf.py::test_dbt_dag_with_dbt_fusion - assert 0 == 23
 +  where 0 = len({})
 +    where {} = <cosmos.dbt.graph.DbtGraph object at 0x7f0b68bb80d0>.filtered_nodes
 +      where <cosmos.dbt.graph.DbtGraph object at 0x7f0b68bb80d0> = <DAG: snowflake_dbt_fusion_dag>.dbt_graph
```

I moved the changes originally done to `dev/dags/dbt/jaffle_shop` to
`dev/dags/dbt/altered_jaffle_shop`. I also removed the default selector
definition.

(3) The DAG `cosmos_manifest_selectors_examples.py` failed to run in a
clean database because it would attempt to run the dbt model
`customers`, without having run its upstream tasks. This can be observed
in
https://github.com/astronomer/astronomer-cosmos/actions/runs/21476188465/job/61860709231?pr=2296

(4) The DAG `example_cosmos_cleanup_dag.py` is not compatible with
Airflow 3. I logged a follow-up ticket for us to check this:
astronomer#2300. This issue
was not introduced by your PR. For now, it is skipped in AF3.
@macroscopeapp
Copy link
Copy Markdown

macroscopeapp Bot commented Feb 10, 2026

Fix failing main tests by switching example DAGs to the altered_jaffle_shop dbt manifest, inserting a pre_condition DbtTaskGroup, and updating cache hash expectations in cosmos_manifest_selectors_example.py and tests

Update the example DAG to load the altered_jaffle_shop manifest, add a pre_condition DbtTaskGroup selecting +customers, adjust cloud manifest paths to manifest_with_selector.json, remove the default selector in selectors.yml, and update test hash expectations and DAG test matrices.

📍Where to Start

Start with the DAG changes in cosmos_manifest_selectors_example.py; then review test updates in tests/dbt/test_graph.py and DAG matrices in tests/test_example_dags.py.


Macroscope summarized 9b2d42a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant