-
Notifications
You must be signed in to change notification settings - Fork 348
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
sign: Hide tests behind feature #3100
sign: Hide tests behind feature #3100
Conversation
9052413
to
42c543c
Compare
I'll update this later this evening, and add some docs to the contributing section 👍🏻 |
Sorry I didn't get a chance to address this today. Will tackle first thing in the morning. |
42c543c
to
bcf1116
Compare
I updated to conditionally run only if gpg is installed. @yuja Please can you take a look. |
bcf1116
to
8501597
Compare
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.
Thanks!
} | ||
test(); | ||
} | ||
|
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.
nit: alternatively, this could be a declarative macro. I don't know which is better overall. Both approaches have pros and cons.
macro_rules! gpg_guard {
() => {
if Command::new("gpg").arg("--version").status().is_err() {
eprintln!("Skipping because gpg is not installed on the system");
return;
}
};
}
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! Never used macros before. This looks nice to me will use this. Out of interest what would you consider the pros and cons in this context?
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.
closure: + obvious control flow, - nesting
macro: + less noisy, - hidden return statement
8501597
to
a61fa6b
Compare
This adds a guard to the gpg signing tests which will skip the test if `gpg` is not installed on the system. This is done in order to avoid requiring all collaborators to have setup all the tools on their local machines that are required to test commit signing.
a61fa6b
to
e875b26
Compare
This adds a cargo feature
signing-tests
which is used to disable the gpg and ssh signing tests unless set.This is done in order to avoid requiring all collaborators to have setup all the tools on their local machines that are required to test commit signing.
Not sure if this is the best way to address this.
Closes #3096