Skip to content

Conversation

@r2k1
Copy link
Contributor

@r2k1 r2k1 commented Feb 10, 2026

  • Add elapsed timestamps to test log output via testLogger wrapper
  • Add LogStep helpers that log → msg... at start and ✓ done (Xs) or ✗ failed (Xs) on completion via defer
  • Add LogStep to major operations: cluster create/delete, VMSS create, node/pod ready wait, scenario run, ACR setup, airgap network, garbage collection
  • Replace logf/log package-level aliases with direct toolkit.Logf/toolkit.Log calls to remove it from log stacktrace

This comment was marked as outdated.

This comment was marked as resolved.

- Add elapsed timestamps to test log output via testLogger wrapper
- Add LogStep helpers that log → start / ✓ done / ✗ failed with timing
- Add LogStep to major operations: cluster, VMSS, node/pod wait, ACR, etc.
- Remove redundant log lines while keeping skip-reason messages
- Fix ##vso wrappers: split into readable + ADO command
- Fix LogDuration to always log, emit ##vso only when over threshold
- Fix typo isAnonyomusPull → isNonAnonymousPull
- Replace logf/log aliases with direct toolkit.Logf/Log calls
@r2k1 r2k1 force-pushed the r2k1/e2e-log-steps branch from ce08c4c to 2692766 Compare February 10, 2026 09:22
Copilot AI review requested due to automatic review settings February 10, 2026 09:22
@r2k1 r2k1 enabled auto-merge (squash) February 10, 2026 09:23
@r2k1 r2k1 changed the title e2e: improve test logging test: improve test logging Feb 10, 2026

This comment was marked as resolved.

Copilot AI review requested due to automatic review settings February 10, 2026 19:20
Copy link
Contributor

Copilot AI left a comment

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 9 out of 9 changed files in this pull request and generated 3 comments.

Comment on lines 30 to 32
var (
logf = toolkit.Logf
log = toolkit.Log
// removed logf and log aliases - use toolkit.Logf and toolkit.Log directly
)
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

This var block is now empty, which is invalid Go syntax and will fail compilation. Remove the block entirely (or replace it with a regular comment outside of a var block).

Copilot uses AI. Check for mistakes.
e2e/kube.go Outdated

func (k *Kubeclient) createKubernetesSecret(ctx context.Context, namespace, secretName, registryName, username, password string) error {
logf(ctx, "Creating Kubernetes secret %s in namespace %s", secretName, namespace)
toolkit.LogStepCtxf(ctx, "creating kubernetes secret %s in namespace %s for registry %s", secretName, namespace, registryName)()
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

LogStepCtxf(... )() is invoked immediately here rather than being deferred, so it will log "done" before the secret creation has actually completed (and it won’t reflect failures). Use defer with the returned function so the end status/timing reflects the whole operation.

Suggested change
toolkit.LogStepCtxf(ctx, "creating kubernetes secret %s in namespace %s for registry %s", secretName, namespace, registryName)()
done := toolkit.LogStepCtxf(ctx, "creating kubernetes secret %s in namespace %s for registry %s", secretName, namespace, registryName)
defer done()

Copilot uses AI. Check for mistakes.
Comment on lines 17 to 21
func LogDuration(ctx context.Context, duration time.Duration, warningDuration time.Duration, message string) {
Log(ctx, message)
if duration > warningDuration {
Logf(ctx, "⚠️ ##vso[task.logissue type=warning;] %s", message)
} else {
Log(ctx, message)
Logf(ctx, "##vso[task.logissue type=warning;]%s", message)
}
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

LogDuration now always logs message and then logs the same message again as an Azure DevOps warning when the threshold is exceeded, which can create duplicate lines in test output. Consider logging only once in the warning case (either emit only the ##vso[...] line, or keep the normal log and use a shorter warning message).

Copilot uses AI. Check for mistakes.
@r2k1 r2k1 merged commit f64404a into main Feb 11, 2026
29 of 32 checks passed
@r2k1 r2k1 deleted the r2k1/e2e-log-steps branch February 11, 2026 00:02
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