Skip to content

test(buildkite): group log output by --- RUN - #7645

Merged
rfay merged 13 commits into
ddev:mainfrom
rfay:20250920_rfay_buildkite_sections
Sep 25, 2025
Merged

rfay merged 13 commits into
ddev:mainfrom
rfay:20250920_rfay_buildkite_sections

Conversation

@rfay

@rfay rfay commented Sep 20, 2025 •

Copy link
Copy Markdown
Member

The Issue

Buildkite test output has been showing test failures nested under the previous test's name instead of the actual failing test. This has been an ongoing issue for years where failure details appear misaligned in the build logs.

Example: https://buildkite.com/ddev/macos-colima-vz/builds/4534#01996736-c75b-4c96-b51b-8a13b97b1b4d

How This PR Solves The Issue

  1. Replaces "--- " with "=== "
  2. Replaces "=== RUN " with "--- RUN " (if this is not a sub-test, which contains a forward slash)

Manual Testing Instructions

  1. Review buildkite output

🤖 Generated with Claude Code

@rfay
rfay requested a review from a team as a code owner September 20, 2025 13:50
@rfay

rfay commented Sep 20, 2025

Copy link
Copy Markdown
Member Author

Not sure this helped, although it does no harm: https://buildkite.com/ddev/ddev-macos-arm64-mutagen/builds/11483#01996764-07ac-45cc-a65c-3745741109fa

Although successful tests are shown in the right place, failures still show after it I think.

@rfay
rfay requested a review from stasadev September 20, 2025 20:51

@stasadev stasadev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any difference, but it doesn't harm.

@rfay
rfay force-pushed the 20250920_rfay_buildkite_sections branch from 840756d to 20db999 Compare September 22, 2025 17:16
@rfay

rfay commented Sep 22, 2025

Copy link
Copy Markdown
Member Author

Tried another round. Will look at actual buildkite output.

@rfay
rfay force-pushed the 20250920_rfay_buildkite_sections branch from 1b88efb to cb64e84 Compare September 22, 2025 22:14
@rfay

rfay commented Sep 22, 2025

Copy link
Copy Markdown
Member Author

I don't think this is going to be successful.

The buildkite docs are at https://buildkite.com/docs/pipelines/configure/managing-log-output, esp "Creating section boundaries"

Apparently the go test output (--- RUN etc) may interact with the buildkite expectations.

Giving up for now.

@rfay rfay closed this Sep 22, 2025
rfay and others added 9 commits September 24, 2025 23:16
## The Issue

Buildkite test output has been showing test failures nested under the previous test's name instead of the actual failing test. This has been an ongoing issue for years where failure details appear misaligned in the build logs.

## How This PR Solves The Issue

Removed inappropriate `---` markers from test execution echo statements in `.buildkite/test.sh`. Buildkite treats `---` as special markers for creating collapsible sections, so `echo "--- Running tests..."` was creating a section that all subsequent test output got nested under, causing failure details to appear under the wrong test name.

Changed:
- `echo "--- Running tests..."` → `echo "Running tests..."`
- `echo "--- Running Windows installer tests first..."` → `echo "Running Windows installer tests first..."`

The remaining `---` markers for testbot_maintenance.sh and sanetestbot.sh are intentional section headers for setup phases.

## Manual Testing Instructions

1. Run Buildkite build and observe test failure output
2. Verify failure details appear under the correct failing test name instead of the previous test

## Automated Testing Overview

No new tests needed - this is a logging/output formatting fix that will be validated by existing CI runs.

## Release/Deployment Notes

No deployment impact. This only affects Buildkite output formatting and improves debugging experience for failed tests.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Buildkite interprets lines starting with '---' as section markers, which
was causing test failure output to be nested under the wrong test name.
Go's test output naturally contains '--- PASS:' and '--- FAIL:' lines.

This change pipes test output through sed to replace '--- ' with '=== '
at the beginning of lines, preventing Buildkite from treating them as
section markers while preserving the readability of test results.

The pipefail option ensures test exit codes are still properly captured.
Add '^^^ +++' after setup sections to ensure test output doesn't get
nested under the 'running sanetestbot.sh' section. This closes all
previous Buildkite sections before tests begin, ensuring test failures
appear at the correct nesting level.
Go test output with '--- PASS:' and '--- FAIL:' creates useful collapsible
sections in Buildkite. The real issue was unclosed setup sections, which
is fixed by the '^^^ +++' section closer. This preserves the intended
test result navigation while fixing the nesting problem.
Add section closer (^^^ +++) after each test result line to prevent
subsequent test output from being nested under the previous test's
section in Buildkite. This ensures that test failures appear under
the correct test name rather than being nested under previous tests.

The awk command detects lines starting with '--- PASS:', '--- FAIL:',
or '--- SKIP:' and adds a section closer immediately after each one.
The awk approach created too many individual sections for every test
and subtest, making the output overwhelming. Keep only the simple
solution that closes setup sections with '^^^ +++' before tests begin.

This should fix the original nesting issue without creating visual clutter.
@stasadev stasadev reopened this Sep 24, 2025
@stasadev stasadev changed the title test(buildkite): correct Buildkite test failure nesting by removing --- markers test(buildkite): correct Buildkite test failure nesting by replacing --- and === markers Sep 24, 2025
@stasadev
stasadev force-pushed the 20250920_rfay_buildkite_sections branch from cb64e84 to aa8eebd Compare September 24, 2025 20:24

@stasadev stasadev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me.

I didn't test sed -u on Windows.

@stasadev

stasadev commented Sep 24, 2025 •

Copy link
Copy Markdown
Member

The only downside is that you need to open the last test in grouped tests to see the test results:

image

Edit: I fixed this:

image

@stasadev stasadev changed the title test(buildkite): correct Buildkite test failure nesting by replacing --- and === markers test(buildkite): group log output by --- RUN Sep 24, 2025
@rfay

rfay commented Sep 24, 2025

Copy link
Copy Markdown
Member Author

@rfay
rfay merged commit 2d76913 into ddev:main Sep 25, 2025
@rfay
rfay deleted the 20250920_rfay_buildkite_sections branch September 25, 2025 20:10
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.

2 participants