Add e2e test that assert workflow depends_on enforces ordering#6711
Merged
Conversation
Without this test, a regression in the queue's dep-tracking logic could silently allow a downstream workflow to start before its dependency finishes. Final status would still be 'success', making the bug invisible to existing scenario fixtures. The test uses step timestamps (Started/Finished) to prove the dependent workflow did not begin until the dependency's step had fully completed, matching the failure mode reported in woodpecker-ci#3858 where a docker image built by the upstream workflow was missing when the downstream tried to pull it. Verified: removing depends_on from the fixture causes an assertion failure with the exact timestamp inversion described in woodpecker-ci#3858. Refs woodpecker-ci#3858
Closer reproduction: the reporter used filenames with spaces
('Build Auth.yml', 'Auth server tests.yml') and depended on the
workflow name derived from those filenames. Using the same names
exercises the exact path — including name resolution through
SanitizePath — that was broken in the original report.
Refs woodpecker-ci#3858
The single-edge test only proves one depends_on link. The issue example was a chain (Build base -> Build Auth -> Auth server tests) and the author also described a fan-in flow where a workflow depends on two parents. Add a 4-workflow DAG covering: - a transitive chain (3 levels deep) - two consumers of the same dependency running in parallel - a fan-in where the final workflow must wait for the slowest of its two parents Each dependency edge is asserted independently via step timestamps, so a regression on any single edge is pinpointed by name. Refs woodpecker-ci#3858
Step timestamps are unix-second granularity, so a 1s base sleep and 2s slow-parent sleep are enough to land an out-of-order start in a strictly earlier second while keeping detection reliable. Cuts the two tests from ~7.3s to ~4.3s. Refs woodpecker-ci#3858
godot wanted the comment sentence punctuated correctly and misspell (US locale) rejected 'behaviour'. Reword the doc comment to drop the embedded ellipsis that tripped godot and use US spelling. Refs woodpecker-ci#3858
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6711 +/- ##
==========================================
+ Coverage 44.33% 44.76% +0.42%
==========================================
Files 436 436
Lines 29190 29190
==========================================
+ Hits 12941 13066 +125
+ Misses 15146 15020 -126
- Partials 1103 1104 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
qwerty287
approved these changes
Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #3858
by add a test that proves we have fixed it on the way, while refactoring this code