Skip to content

Add e2e test that assert workflow depends_on enforces ordering#6711

Merged
6543 merged 5 commits into
woodpecker-ci:mainfrom
6543-forks:e2e-test-for-3858
Jun 9, 2026
Merged

Add e2e test that assert workflow depends_on enforces ordering#6711
6543 merged 5 commits into
woodpecker-ci:mainfrom
6543-forks:e2e-test-for-3858

Conversation

@6543

@6543 6543 commented Jun 9, 2026

Copy link
Copy Markdown
Member

close #3858

by add a test that proves we have fixed it on the way, while refactoring this code

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
@6543 6543 added the tests related to tests or other things CI check before merge label Jun 9, 2026
claude added 4 commits June 9, 2026 13:20
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

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.76%. Comparing base (2aaf487) to head (7a615ea).
⚠️ Report is 3 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@6543 6543 requested a review from a team June 9, 2026 12:55
@6543 6543 merged commit 31dd64f into woodpecker-ci:main Jun 9, 2026
9 checks passed
@6543 6543 deleted the e2e-test-for-3858 branch June 9, 2026 15:25
@woodpecker-bot woodpecker-bot mentioned this pull request Jun 9, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests related to tests or other things CI check before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

depends_on seems to be broken on workflow level

3 participants