-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
roachtest: allow adding extra github parameters #134885
Conversation
pkg/cmd/roachtest/github.go
Outdated
// is worth the noise. | ||
paramLogger, err := l.ChildLogger("params", logger.QuietStdout, logger.QuietStderr) | ||
if err == nil { | ||
paramLogger.Printf("Roachtest Parameters:\n%s", jsonBytes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small Nit: Could close the logger paramLogger.Close()
right after this if it's not used further on.
pkg/cmd/roachtest/github.go
Outdated
skipReason := g.shouldPost(t) | ||
if skipReason != "" { | ||
l.Printf("skipping GitHub issue posting (%s)", skipReason) | ||
|
||
// If we're skipping issue posting, we still want to log the parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question around this logic: I think I would find it confusing if sometimes I find this log and other times not (when no issue was created). Would it make sense to lift this out as part of a test's regular logging and always log it? It's relatively small so I don't see the harm in having 'duplicate' data, but I might be missing some other context here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds reasonable, I've lifted it to be part of the test runner and it now unconditionally logs the parameters on failure.
@@ -750,6 +750,11 @@ func (t *Test) Run() { | |||
|
|||
t.logger.Printf("mixed-version test:\n%s", plan.PrettyPrint()) | |||
|
|||
// Mark the deployment mode and versions, so they show up in the github issue. This makes | |||
// it easier to group failures together without having to dig into the test logs. | |||
t.rt.AddParam("MVT_DEPLOYMENT_MODE", string(plan.deploymentMode)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super Nit: These look a bit different MVT_DEPLOYMENT_MODE
vs mvtDeploymentMode
as the other parameters are camelCase. Although we have the ROACHTEST_
prefix, so I'm not sure if there's a certain style to the parameters here we need to follow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about MVT_deploymentMode
and then we don't add the prefix? I'd argue the ROACHTEST_
prefix is redundant if we're just going to append it to everything so at least this way we can differentiate between roachtest framework parameters and test specific parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd argue the ROACHTEST_ prefix is redundant if we're just going to append it to everything so at least this way we can differentiate between roachtest framework parameters and test specific parameters.
Yeah, I was thinking about the same thing when I wrote my other comment. I do think maybe we should drop ROACHTEST_
; I don't think anyone really cares about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, no prefix + camel case sounds good to me 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! A few small questions and some minor nits, but nothing necessarily worth holding up the PR over.
6106d71
to
733852b
Compare
``` | ||
|
||
Parameters: | ||
- <code>MVT_deploymentMode=separate-process</code> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It breaks the symmetry... Since we have this historical prefix, ROACHTEST_
, and since mixed version tests are technically embedded in the roachtest framework, ROACHTEST_MVT_deploymentMode
seems reasonable.
} | ||
} | ||
|
||
func getTestParameters(t *testImpl, c *clusterImpl, createOpts *vm.CreateOpts) map[string]string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I like its new place!
733852b
to
f3f6d47
Compare
When github issue posting, we denote various parameters describing the test, i.e. cloud, metamorphic encryption, etc. This is useful as it allows one to easily determine properties of a test without digging into the logs. However, this feature only works if github posting is enabled. We've seen some cases where it is not enabled and we have trouble figuring out the aforementioned parameters. This change makes it so the parameters are logged to the artifacts directory in case github posting is not enabled or fails. It also exposes the notion of extra parameters to the test interface. This allows for tests that have metamorphic properties to easily list them in the issue itself. One example of this is in mixed version tests, where we randomize the deployment mode and the versions used. We often run into issues that pertain to only a specific deployment mode or version, and it can be cumbersome to dig through the artifacts for each individual failure. Release note: none Epic: none Fixes: none
f3f6d47
to
b29d6f6
Compare
TFTRs! bors r=herkolategan, srosenberg |
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating merge commit from b29d6f6 to blathers/backport-release-24.1-134885: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 24.1.x failed. See errors above. error creating merge commit from b29d6f6 to blathers/backport-release-24.2-134885: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 24.2.x failed. See errors above. error creating merge commit from b29d6f6 to blathers/backport-release-24.3-134885: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 24.3.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
When github issue posting, we denote various parameters describing the test, i.e. cloud, metamorphic encryption, etc. This is useful as it allows one to easily determine properties of a test without digging into the logs.
However, this feature only works if github posting is enabled. We've seen some cases where it is not enabled and we have trouble figuring out the aforementioned parameters. This change makes it so the parameters are logged to the artifacts directory if github posting is not enabled.
It also exposes the notion of extra parameters to the test interface. This allows for tests that have metamorphic properties to easily list them in the issue itself.
One example of this is in mixed version tests, where we randomize the deployment mode and the versions used. We often run into issues that pertain to only a specific deployment mode or version, and it can be cumbersome to dig through the artifacts for each individual failure.
Release note: none
Epic: none
Fixes: none