TeamCity: Add ability to save test log artifacts to all build configurations#8690
Conversation
|
TODO:
Also, need to check other ENVs that may be missing from the new projects - e.g. TF_LOG, TF_OS |
2 similar comments
6732556 to
800bd35
Compare
…guration parameters
|
|
||
| // Set where logs are sent | ||
| text("PROVIDER_NAME", providerName) | ||
| text("env.TF_LOG_PATH_MASK", "%system.teamcity.build.checkoutDir%/debug-%PROVIDER_NAME%-%env.BUILD_NUMBER%-%s.log") |
There was a problem hiding this comment.
I found info about this ENV here:
Environment variable with path containing the string %s, which is
replaced with the test name, to save separate Terraform logs during
acceptance testing. This value sets TF_LOG_PATH in a safe manner when
executing Terraform CLI commands, which would otherwise be ignored since
it could interfere with how the underlying execution is performed.
|
This build reflects the latest commit that changes the file's extension to .txt, allowing us to open the file in our browsers instead of it downloading automatically: https://hashicorp.teamcity.com/buildConfiguration/TerraformProviders_Google_SarahManualTestingProject_GOOGLE_PACKAGE_BILLING/17701?buildTab=artifacts |
shuyama1
left a comment
There was a problem hiding this comment.
LGTM. Not sure if saving the debug log as a text file will have limitation on log length, but I think it's good for now
Me neither, but I don't think I have the ability to influence if TeamCity opens the file in-browser or makes it download by any other means. If problems do occur I'll revert the files to saving as .log files and they'll need to be downloaded. |
…rations (GoogleCloudPlatform#8690) * Add `artifactRules` to all build configurations * Set logging ENVs on builds via `TerraformLoggingParameters` * Fix copy+paste error in function signature * Remove space in parameter name * Add `PROVIDER_NAME` * Fix logging-related parameters to be environment varaibles, not configuration parameters * Change log files to use .txt extension, so they open in browser without downloading
…rations (GoogleCloudPlatform#8690) * Add `artifactRules` to all build configurations * Set logging ENVs on builds via `TerraformLoggingParameters` * Fix copy+paste error in function signature * Remove space in parameter name * Add `PROVIDER_NAME` * Fix logging-related parameters to be environment varaibles, not configuration parameters * Change log files to use .txt extension, so they open in browser without downloading
…rations (GoogleCloudPlatform#8690) * Add `artifactRules` to all build configurations * Set logging ENVs on builds via `TerraformLoggingParameters` * Fix copy+paste error in function signature * Remove space in parameter name * Add `PROVIDER_NAME` * Fix logging-related parameters to be environment varaibles, not configuration parameters * Change log files to use .txt extension, so they open in browser without downloading
This PR adds the ability to make log artefacts (see here for example in old projects) to the new TC projects.
Here's a place I manually tested the code changes in this PR and got log artifacts created per test : https://hashicorp.teamcity.com/buildConfiguration/TerraformProviders_Google_SarahManualTestingProject_GOOGLE_PACKAGE_BILLING/17306?buildTab=artifacts
If this PR is for Terraform, I acknowledge that I have:
Release Note Template for Downstream PRs (will be copied)