Skip to content

fix: propagate config.group to test group when attached_node is null - #15940

Closed
waterWang wants to merge 1 commit into
dbt-labs:mainfrom
waterWang:fix/test-config-group-propagation-15930
Closed

waterWang wants to merge 1 commit into
dbt-labs:mainfrom
waterWang:fix/test-config-group-propagation-15930

Conversation

@waterWang

Copy link
Copy Markdown

Fix: config.group propagation for unattached test nodes

When a data test has no attached_node (source tests and singular tests), dbt-core 1.x copies the explicit config.group into the test's group property, but the Fusion engine leaves it null. This causes --select group:xxx and state:modified to give different results between the two engines.

Root cause

In resolve_data_tests.rs, the group field on DbtTestAttr was set only from the parent model's group:

let group = attached_node
    .as_deref()
    .and_then(|id| models.get(id))
    .and_then(|m| m.__model_attr__.group.clone());

When attached_node is None (source tests, singular tests), this always produced None, even when the test had an explicit config.group.

Fix

When attached_node is None, fall back to test_config.group (the explicit config value). Generic tests on models/seeds/snapshots continue to inherit the parent node's group.

Fixes: #15930

When a data test has no attached_node (source tests and singular tests),
dbt-core 1.x copies the explicit config.group into the test's group
property, but the Fusion engine leaves it null.

This causes --select group:xxx and state:modified to give different
results between the two engines for source tests and singular tests
that have an explicit config.group.

Fix: when attached_node is None, fall back to test_config.group instead
of always using None. Generic tests on models/seeds/snapshots continue
to inherit the parent node's group.
@waterWang
waterWang requested a review from a team as a code owner August 14, 2026 00:42
@cla-bot

cla-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR.

CLA has not been signed by users: @waterWang

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

@larspettermadsstuen

Copy link
Copy Markdown
Contributor

@waterWang will you complete required steps for this, or is this abandoned? Keen to get this fixed, happy to open a new pr.

@Thrasi

Thrasi commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

@larspettermadsstuen I am very eager as well but @waterWang might be very preoccupied with all the work they have been doing in August:
image

@HannanNaeem How can this move forward?

@larspettermadsstuen

Copy link
Copy Markdown
Contributor

@larspettermadsstuen I am very eager as well but @waterWang might be very preoccupied with all the work they have been doing in August

Busy bee indeed. Not too hopeful of an update, so I made a "competing" PR here.

@aiguofer

Copy link
Copy Markdown
Contributor

Thanks for your contribution! I'm closing this PR and moving forward with #16265

@aiguofer aiguofer closed this Sep 16, 2026
fa-assistant added a commit that referenced this pull request Sep 16, 2026
* fix: copy config.group onto source and singular tests

Closes #16265

Resolves #15930

@waterWang already fixed this in #15940. That PR is still open, but it looks stuck: CLA unsigned, no changelog, and it's gone dirty against main. I asked there whether they were going to finish it; no movement, and other people still want the fix. Opening a fresh PR so this can actually land.

The code change is theirs — I reapplied it on current main and added the changelog. Credit for the diagnosis and the patch goes to them.

### Problem

On Fusion, source tests and singular tests never get a top-level `group`, even when you set `config.group`. Core 1.x copies that config onto `group`. Selectors like `group:…`, `state:modified`, and group notifications all look at the top-level field, so those tests quietly drop out of group-based workflows.

Generic tests on models are already fine — they inherit the parent model's group, and we should leave that alone (including the case where the parent has no group).

### Solution

If the test has no `attached_node`, use `config.group`. If it does (model/seed/snapshot), keep inheriting the parent.

#15940 doesn't include a repro. The parse setup and how to check `config.group` vs `group` are in #15930 — I ran that on a local build of this branch and the three bug rows now get `group=test_group`.

No new unit test — the check that matters is parse + the manifest field.

### Checklist

- [x] I have read the contributing guide and understand what's expected of me.
- [x] I have run this code in development, and it appears to resolve the stated issue.
- [x] This PR includes tests, or tests are not required or relevant for this PR.
- [x] This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.

Made with [Cursor](https://cursor.com)

Copybara-Public-Head-SHA: 3add97d
GitOrigin-RevId: d2e6ac8

* Mirror contributed changelog entry into the Fusion changelog

* test: add regression test for config.group on source/singular tests

Covers the manifest top-level `group` field for test nodes with no
attached_node (source generic tests, singular tests) falling back to
config.group, and confirms model-attached generic tests still inherit
the parent model's group.

Closes #15930

---------

Co-authored-by: larspettermadsstuen <100695195+larspettermadsstuen@users.noreply.github.com>
Co-authored-by: Diego Fernandez <diego.fernandez@dbtlabs.com>
GitOrigin-RevId: b8f60418839a87bd975c8432ea6e096c9f8ebea5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v2 Bug] Fusion drops explicit config.group → top-level group on unattached test nodes (source-attached generic + singular tests)

4 participants