Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow facter test log to be written to a file #2724

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

joshcooper
Copy link
Contributor

If the FACTER_TEST_LOG environment variable is set, then use it as the log
destination when running facter tests. This is borrowed from puppet's
PUPPET_TEST_LOG. The test file path and line number are written so you can tell
which test generated the log output:

I, [2024-05-20T16:26:04.852790 #3073378]  INFO -- : *** BEGIN TEST ./spec/custom_facts/core/execution_spec.rb:63
I, [2024-05-20T16:26:04.853239 #3073378]  INFO -- : *** BEGIN TEST ./spec/custom_facts/core/execution_spec.rb:71
W, [2024-05-20T16:26:04.853473 #3073378]  WARN -- : Facter::Core::Execution::Posix - Unexpected key passed to Facter::Core::Execution.execute option: time_limit - valid keys: on_fail,expand,logger,timeout
I, [2024-05-20T16:26:04.853680 #3073378]  INFO -- : *** BEGIN TEST ./spec/custom_facts/core/execution_spec.rb:71

@joshcooper joshcooper added the enhancement New feature or enhancement label May 23, 2024
@joshcooper joshcooper marked this pull request as ready for review May 25, 2024 00:19
@joshcooper joshcooper requested a review from a team as a code owner May 25, 2024 00:19
If the FACTER_TEST_LOG environment variable is set, then use it as the log
destination when running facter tests. This is borrowed from puppet's
PUPPET_TEST_LOG. The test file path and line number are written so you can tell
which test generated the log output:

    I, [2024-05-20T16:26:04.852790 #3073378]  INFO -- : *** BEGIN TEST ./spec/custom_facts/core/execution_spec.rb:63
    I, [2024-05-20T16:26:04.853239 #3073378]  INFO -- : *** BEGIN TEST ./spec/custom_facts/core/execution_spec.rb:71
    W, [2024-05-20T16:26:04.853473 #3073378]  WARN -- : Facter::Core::Execution::Posix - Unexpected key passed to Facter::Core::Execution.execute option: time_limit - valid keys: on_fail,expand,logger,timeout
    I, [2024-05-20T16:26:04.853680 #3073378]  INFO -- : *** BEGIN TEST ./spec/custom_facts/core/execution_spec.rb:71
@cthorn42 cthorn42 merged commit 27f870b into puppetlabs:main Jun 7, 2024
18 checks passed
@joshcooper joshcooper deleted the logtofile branch June 7, 2024 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants