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

Add unit tests from the smoke test PR #570

Merged
merged 13 commits into from
Feb 11, 2020
Merged

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Jan 24, 2020

Obsoletes #524.

This is ready for review.

Things to do:

@jyn514 jyn514 changed the title [WIP] Add unit tests from the smoke test PR Add unit tests from the smoke test PR Jan 28, 2020
@jyn514
Copy link
Member Author

jyn514 commented Jan 28, 2020

r? @pietroalbini

@jyn514
Copy link
Member Author

jyn514 commented Jan 28, 2020

This PR is best reviewed commit-by-commit.

This was referenced Feb 2, 2020
Copy link

@yvrhdn yvrhdn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left some comments, but overall this seems good to me :) I'm sure these tests will prove to be helpful in the future.

src/test/mod.rs Outdated
@@ -43,7 +43,11 @@ pub(crate) fn assert_redirect(path: &str, expected_target: &str, web: &TestFront
let status = response.status();

// Reqwest follows redirects automatically
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be a bit nit-picky... but I find this comment confusing now. This comment originally had a slightly different place/context. Now it seems to tell us something about the conversion of response to redirect_target, but the redirect has already happened by the time we get here.

I would propose:

  • move this comment up a bit, maybe at let response = web.get(path).send()?;?
  • perhaps add a (short) comment at let redirect_target = if ... to clarify why we sometimes take the full URL and sometimes the path only.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a change that comments this, does that make it more clear?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is great 👍

Copy link

@yvrhdn yvrhdn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fixes. Looks good to me!

@jyn514 jyn514 merged commit e3ab392 into rust-lang:master Feb 11, 2020
@jyn514 jyn514 deleted the unit-tests branch February 14, 2020 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants