Skip to content

Conversation

@mrodm
Copy link
Contributor

@mrodm mrodm commented Jul 22, 2025

Relates #1903

This PR reviews the output shown by the elastic-package test command. Mainly focused on test system

  • Move log messages with info about http queries to Trace level
  • Move log messages about docker commands to Trace level
  • Show short docker ID containers in log messages
  • Re-order some log messages to avoid duplication
  • Set some messages as Info level to show meaningful information

Example of output with verbose mode: https://buildkite.com/elastic/elastic-package/builds/5726#0198319b-a5a9-4464-b193-cdbaf0bbd898/253-614

Example of output without verbose mode:

  • Before:
 $ elastic-package -C test/packages/parallel/nginx/ test system --data-streams access Run system tests for the package 2025/07/22 13:17:53 INFO License text found in "/home/mariorodriguez/Coding/work/elastic-package-revisit-output/LICENSE.txt" will be included in package 2025/07/22 13:18:10 INFO Using service variant: ServiceVariant{Name: v1, Env: SERVICE_VERSION=1.19.5} 2025/07/22 13:18:28 WARN Dynamic object found but no fields ingested under path: "container.labels.*" 2025/07/22 13:18:29 INFO Write container logs to file: /home/mariorodriguez/Coding/work/elastic-package-revisit-output/build/container-logs/nginx-1753183109194284252.log 2025/07/22 13:18:32 INFO Write container logs to file: /home/mariorodriguez/Coding/work/elastic-package-revisit-output/build/container-logs/elastic-agent-1753183112802675866.log --- Test results for package: nginx - START --- ╭─────────┬─────────────┬───────────┬───────────────────────┬────────┬───────────────╮ │ PACKAGE │ DATA STREAM │ TEST TYPE │ TEST NAME │ RESULT │ TIME ELAPSED │ ├─────────┼─────────────┼───────────┼───────────────────────┼────────┼───────────────┤ │ nginx │ access │ system │ default (variant: v1) │ PASS │ 32.381574367s │ ╰─────────┴─────────────┴───────────┴───────────────────────┴────────┴───────────────╯ --- Test results for package: nginx - END --- Done 
  • After:
 $ elastic-package -C test/packages/parallel/nginx/ test system --data-streams access Run system tests for the package 2025/07/22 12:57:46 INFO Installing package... 2025/07/22 12:57:46 INFO License text found in "/home/mariorodriguez/Coding/work/elastic-package-revisit-output/LICENSE.txt" will be included in package 2025/07/22 12:57:48 INFO Running test for data_stream "access" with configuration 'default (variant: v1)' 2025/07/22 12:57:55 INFO Setting up independent Elastic Agent... 2025/07/22 12:58:10 INFO Setting up service... 2025/07/22 12:58:10 INFO Using service variant: ServiceVariant{Name: v1, Env: SERVICE_VERSION=1.19.5} 2025/07/22 12:58:28 WARN Dynamic object found but no fields ingested under path: "container.labels.*" 2025/07/22 12:58:28 INFO Tearing down service... 2025/07/22 12:58:28 INFO Write container logs to file: /home/mariorodriguez/Coding/work/elastic-package-revisit-output/build/container-logs/nginx-1753181908966369574.log 2025/07/22 12:58:32 INFO Tearing down agent... 2025/07/22 12:58:32 INFO Write container logs to file: /home/mariorodriguez/Coding/work/elastic-package-revisit-output/build/container-logs/elastic-agent-1753181912555161827.log 2025/07/22 12:58:37 INFO Uninstalling package... --- Test results for package: nginx - START --- ╭─────────┬─────────────┬───────────┬───────────────────────┬────────┬───────────────╮ │ PACKAGE │ DATA STREAM │ TEST TYPE │ TEST NAME │ RESULT │ TIME ELAPSED │ ├─────────┼─────────────┼───────────┼───────────────────────┼────────┼───────────────┤ │ nginx │ access │ system │ default (variant: v1) │ PASS │ 39.435041188s │ ╰─────────┴─────────────┴───────────┴───────────────────────┴────────┴───────────────╯ --- Test results for package: nginx - END --- Done 

Author's Checklist

  • Validate Serverless build output
  • Validate Pull Requests builds output
@mrodm mrodm self-assigned this Jul 22, 2025
Comment on lines -60 to -63
err := os.RemoveAll(options.Output)
if err != nil {
return nil, fmt.Errorf("can't remove output location: %w", err)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this remove call to the if checking if options.Output is not an empty string.

}

func dumpStackLogs(ctx context.Context, options DumpOptions) ([]DumpResult, error) {
logger.Debugf("Dump stack logs (location: %s)", options.Output)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove this message in favor of the one in Dump()

@mrodm
Copy link
Contributor Author

mrodm commented Jul 24, 2025

test serverless

@mrodm
Copy link
Contributor Author

mrodm commented Jul 24, 2025

test serverless

if host != "" {
c.host = host
}
logger.Debugf("Using Elastic Cloud URL: %s", c.host)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this message is not needed. WDYT ?
Another option is move that message to Trace log level.

@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 24, 2025

💛 Build succeeded, but was flaky

Failed CI Steps

History

cc @mrodm

@mrodm mrodm marked this pull request as ready for review July 24, 2025 18:48
@mrodm mrodm requested a review from a team July 24, 2025 18:48
@mrodm mrodm merged commit 8fc0b3f into elastic:main Jul 25, 2025
3 checks passed
@mrodm mrodm deleted the revisit-output branch July 25, 2025 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants