-
Notifications
You must be signed in to change notification settings - Fork 212
Assert that redirects go directly to their target location #1814
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,12 @@ impl<'a> RenderingTimesRecorder<'a> { | |
|
||
fn record_current(&mut self) { | ||
if let Some(current) = self.current.take() { | ||
#[cfg(test)] | ||
log::debug!( | ||
"rendering time - {}: {:?}", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added this while trying to figure out why I was getting timeouts from the two reqwest clients deadlocking, but I thought it could be useful to leave in. |
||
current.step, | ||
current.start.elapsed() | ||
); | ||
self.metric | ||
.with_label_values(&[current.step]) | ||
.observe(duration_to_seconds(current.start.elapsed())); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -223,6 +223,7 @@ struct MatchVersion { | |
pub corrected_name: Option<String>, | ||
pub version: MatchSemver, | ||
pub rustdoc_status: bool, | ||
pub target_name: String, | ||
} | ||
|
||
impl MatchVersion { | ||
|
@@ -324,6 +325,7 @@ fn match_version( | |
corrected_name, | ||
version: MatchSemver::Exact((release.version.to_string(), release.id)), | ||
rustdoc_status: release.rustdoc_status, | ||
target_name: release.target_name.clone(), | ||
}); | ||
} | ||
} | ||
|
@@ -358,6 +360,7 @@ fn match_version( | |
MatchSemver::Semver((release.version.to_string(), release.id)) | ||
}, | ||
rustdoc_status: release.rustdoc_status, | ||
target_name: release.target_name.clone(), | ||
}); | ||
} | ||
|
||
|
@@ -371,6 +374,7 @@ fn match_version( | |
corrected_name: corrected_name.clone(), | ||
version: MatchSemver::Semver((release.version.to_string(), release.id)), | ||
rustdoc_status: release.rustdoc_status, | ||
target_name: release.target_name.clone(), | ||
}) | ||
.ok_or(Nope::VersionNotFound); | ||
} | ||
|
@@ -759,7 +763,7 @@ mod test { | |
.create() | ||
.unwrap(); | ||
let web = env.frontend(); | ||
assert_redirect("/bat//", "/bat/latest/bat/", web)?; | ||
assert_redirect_unchecked("/bat//", "/bat/", web)?; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This redirect is handled by |
||
Ok(()) | ||
}) | ||
} | ||
|
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)
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 think the double and is more correct, even if a little weird
vs