Skip to content

Add real-time test progress logging to stderr in e2e#8912

Draft
titilambert wants to merge 1 commit into
mainfrom
add-real-time-test-progress
Draft

Add real-time test progress logging to stderr in e2e#8912
titilambert wants to merge 1 commit into
mainfrom
add-real-time-test-progress

Conversation

@titilambert

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

@titilambert

Copy link
Copy Markdown
Contributor Author

This change is part of the following stack:

Change managed by git-spice.

Copilot AI review requested due to automatic review settings July 13, 2026 15:35
@github-actions

Copy link
Copy Markdown
Contributor

PR Title Lint Failed ❌

Current Title: Add real-time test progress logging to stderr in e2e

Your PR title doesn't follow the expected format. Please update your PR title to follow one of these patterns:

Conventional Commits Format:

  • feat: add new feature - for new features
  • fix: resolve bug in component - for bug fixes
  • docs: update README - for documentation changes
  • refactor: improve code structure - for refactoring
  • test: add unit tests - for test additions
  • chore: remove dead code - for maintenance tasks
  • chore(deps): update dependencies - for updating dependencies
  • ci: update build pipeline - for CI/CD changes

Guidelines:

  • Use lowercase for the type and description
  • Keep the description concise but descriptive
  • Use imperative mood (e.g., "add" not "adds" or "added")
  • Don't end with a period

Examples:

  • feat(windows): add secure TLS bootstrapping for Windows nodes
  • fix: resolve kubelet certificate rotation issue
  • docs: update installation guide
  • Added new feature
  • Fix bug.
  • Update docs

Please update your PR title and the lint check will run again automatically.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds real-time progress signals for e2e scenario execution by writing START/PASS/FAIL lines directly to stderr, aiming to surface test progress in Azure DevOps logs while tests are still running.

Changes:

  • Emit a STARTED line to stderr when a scenario begins.
  • Emit PASS/FAIL lines (with elapsed time) to stderr on subtest completion via a deferred helper.

Comment thread e2e/test_helpers.go
Comment on lines 77 to 81
func RunScenario(t *testing.T, s *Scenario) {
t.Parallel()
fmt.Fprintf(os.Stderr, "⏳ STARTED %s\n", t.Name())
start := time.Now()
// Special case for testing VHD caching. Not used by default.
Copilot AI review requested due to automatic review settings July 13, 2026 16:36
@titilambert titilambert force-pushed the add-real-time-test-progress branch from c279e19 to 35167d3 Compare July 13, 2026 16:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

Comment thread e2e/test_helpers.go Outdated
Comment on lines +79 to +80
fmt.Fprintf(os.Stderr, "⏳ STARTED %s\n", t.Name())
start := time.Now()
Comment thread e2e/test_helpers.go
Comment on lines 84 to 86
t.Parallel()
defer logTestResult(t, start)
runScenarioWithPreProvision(t, s)
Comment thread e2e/test_helpers.go
Comment on lines 91 to 93
t.Parallel()
defer logTestResult(t, start)
err := runScenario(t, copyScenario(s))
Comment thread e2e/test_helpers.go
Comment on lines 99 to 101
t.Parallel()
defer logTestResult(t, start)
sCopy := copyScenario(s)
Comment thread .pipelines/scripts/e2e_run.sh Outdated

# gotestsum configure to only show logs for failed tests, json file for detailed logs
# Run the tests! Yey!
echo "STDERR_STREAMING_CHECK: this should appear immediately" >&2
Copilot AI review requested due to automatic review settings July 13, 2026 17:09
@titilambert titilambert force-pushed the add-real-time-test-progress branch from 35167d3 to 9b3063d Compare July 13, 2026 17:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

Comment thread e2e/test_helpers.go Outdated
Comment on lines +79 to +80
logTestProgress("⏳ STARTED %s", t.Name())
start := time.Now()
Comment thread e2e/test_helpers.go
Comment on lines 83 to 87
t.Run("VHDCreation", func(t *testing.T) {
t.Parallel()
defer logTestResult(t, start)
runScenarioWithPreProvision(t, s)
})
Comment thread e2e/test_helpers.go
Comment on lines 91 to 93
t.Parallel()
defer logTestResult(t, start)
err := runScenario(t, copyScenario(s))
Comment thread e2e/test_helpers.go
Comment on lines 99 to 101
t.Parallel()
defer logTestResult(t, start)
sCopy := copyScenario(s)
Comment thread e2e/test_helpers.go
if path == "" {
return
}
f, err := os.OpenFile(path, os.O_APPEND|os.O_WRONLY, 0644)
Comment on lines 115 to +129
@@ -116,6 +125,9 @@ fi
${rerun_fails:+--rerun-fails=$rerun_fails} ${rerun_fails:+--packages=.} \
-- -parallel 60 -timeout "${E2E_GO_TEST_TIMEOUT}" || test_exit_code=$?

kill $TAIL_PID 2>/dev/null || true
rm -f "$E2E_PROGRESS_LOG"
Copilot AI review requested due to automatic review settings July 13, 2026 17:37
@titilambert titilambert force-pushed the add-real-time-test-progress branch from 9b3063d to f3c7059 Compare July 13, 2026 17:37
@titilambert titilambert force-pushed the add-real-time-test-progress branch from f3c7059 to 89e9f91 Compare July 13, 2026 17:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment on lines 115 to +129
@@ -116,6 +125,9 @@ fi
${rerun_fails:+--rerun-fails=$rerun_fails} ${rerun_fails:+--packages=.} \
-- -parallel 60 -timeout "${E2E_GO_TEST_TIMEOUT}" || test_exit_code=$?

kill $TAIL_PID 2>/dev/null || true
rm -f "$E2E_PROGRESS_LOG"
Comment thread e2e/test_helpers.go
Comment on lines +120 to +125
f, err := os.OpenFile(path, os.O_APPEND|os.O_WRONLY, 0644)
if err != nil {
return
}
defer f.Close()
fmt.Fprintf(f, format+"\n", args...)
Copilot AI review requested due to automatic review settings July 13, 2026 17:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread e2e/test_helpers.go
Comment on lines +133 to +140
func logTestResult(t testing.TB, start time.Time) {
duration := time.Since(start).Round(time.Second)
if t.Failed() {
logTestProgress("✗ FAIL %s (%s)", t.Name(), duration)
} else {
logTestProgress("✓ PASS %s (%s)", t.Name(), duration)
}
}
Comment on lines +115 to +117
export E2E_PROGRESS_LOG="$(mktemp)"
stdbuf -oL tail -f "$E2E_PROGRESS_LOG" &
TAIL_PID=$!
Copilot AI review requested due to automatic review settings July 13, 2026 18:24
@titilambert titilambert force-pushed the add-real-time-test-progress branch from 89e9f91 to 5d59834 Compare July 13, 2026 18:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment on lines +115 to 119
export E2E_PROGRESS_LOG="$(mktemp)"
stdbuf -oL tail -f "$E2E_PROGRESS_LOG" &
TAIL_PID=$!

test_exit_code=0
Comment thread e2e/test_helpers.go
if path == "" {
return
}
f, err := os.OpenFile(path, os.O_APPEND|os.O_WRONLY, 0644)
Copilot AI review requested due to automatic review settings July 14, 2026 16:36
@titilambert titilambert force-pushed the add-real-time-test-progress branch from 5d59834 to d859aac Compare July 14, 2026 16:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

# from within tests does not appear in real-time. Instead, tests write
# progress to a file and tail -f streams it outside of go test's capture.
export E2E_PROGRESS_LOG="$(mktemp)"
stdbuf -oL tail -f "$E2E_PROGRESS_LOG" &
Comment thread e2e/test_helpers.go
if path == "" {
return
}
f, err := os.OpenFile(path, os.O_APPEND|os.O_WRONLY, 0644)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants