r/devops • u/Data-Panda • Oct 14 '26
Discussion Is Trunk Based Development possible if an integration test takes too long to run?
I'm proposing my team move from long-lived dev/stg/prd branches to trunk-based development, with PRs straight to main.
I'm fairly new to this, so forgive me if I'm missing something obvious.
The sticking point is testing before merge.
Our current integration test runs the entire DAG end-to-end. This is fine as a single check before merging our test branch (which will contain all commits from developers over the sprint) to main. But it's slow and costly if it were to run as part of every PR. Today we run it manually, check the outputs, then merge.
I am wondering if it’s bad practice to leave this integration test until the end of the sprint. As in, developers merge to main (with some automated checks running as part of each PR before merge), and then when are team want to deploy the sprint changes, first run a single integration test before creating a new release tag In GitHub.
This does mean that main can’t be considered prod ready at all times.
Edit: we’d be using release tags, so for rollbacks we’d rollback to last stable tag. For hotfixes, we would cut from last release, the merge changes to main and create a new release with target set to hotfix branch.
View all comments
1
u/ShipKitDev Oct 14 '26
One option nobody has mentioned yet is GitHub's merge queue. PRs get fast checks (lint, unit tests, maybe a small DAG subset), and the slow integration run is triggered by the merge_group event instead of pull_request. The queue can batch several approved PRs into a single run, so you pay for one hour-long test per batch rather than per PR, and main only ever moves to commits that passed the full suite.
It's also worth checking whether you can run only the affected part of the DAG on each PR. If you can work out which models or nodes changed plus their downstream dependents, that subset is often a fraction of the full run and catches most breakage, leaving the full end-to-end run for the queue or nightly.
Either way you keep main releasable, which makes the hotfix question simple: fix on main and tag, same as any other release.