Skip to content

Conversation

steveklabnik
Copy link
Contributor

This checks that we render the example book correctly. In order to do
that, we put a known-good copy of the book under tests/book, and then in
tests/smoke.rs, we generate a copy of it, and then diff the two
directories.

This means that PRs that change the generated output will need to update
this fixture, but it also means we get to see an easy way of what they
actually update.

Part of #11

@azerupi
Copy link
Contributor

azerupi commented Apr 14, 2017

Oh yes yes yes! I am all in for better tests :)
I have accepted a couple of PRs so make sure that the test passed before merging.

@steveklabnik
Copy link
Contributor Author

I have accepted a couple of PRs so make sure that the test passed before merging.

👍 ❤️

This checks that we render the example book correctly. In order to do
that, we put a known-good copy of the book under tests/book, and then in
tests/smoke.rs, we generate a copy of it, and then diff the two
directories.

This means that PRs that change the generated output will need to update
this fixture, but it also means we get to see an easy way of what they
actually update.

Part of #11
Some PRs were landed in the meantime
@steveklabnik
Copy link
Contributor Author

only a small amount of change, as you can see in the second commit 😄

@steveklabnik
Copy link
Contributor Author

Ahh, line endings are the issue here.... I made this PR on Windows, so windows stuff succeeds, but linux stuff fails. Hrm.

@steveklabnik
Copy link
Contributor Author

..... I am not sure how to fix this, given that if I change it the other way, it will fail on Windows. Hrm.

@carols10cents
Copy link
Member

Sounds like something that should be fixed in dir-diff, I filed an issue for you ❤️

@steveklabnik
Copy link
Contributor Author

steveklabnik commented Apr 29, 2017 via email

</div>

<div id="content" class="content">
<a class="header" href="misc\introduction.html#introduction" id="introduction"><h1>Introduction</h1></a>
Copy link

Choose a reason for hiding this comment

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

This is the actual problem. Backslashes shouldn't be used in URLs. I've opened a more relevant issue: #263

@azerupi
Copy link
Contributor

azerupi commented Jun 26, 2017

Thinking about this a bit, this kind of test might be a bit too restrictive. Since the output often changes with small PRs I think it would be better to drop this idea and instead implement a lot of small tests checking for one particular property in the generated output. It would probably not catch everything, but it would be more granular than this solution.

Now the major drawback would be to actually write all of the small tests. But we have had a lot of contributions recently and I think that if we make easy issues, we can get most of them contributed as mentored PRs.

What do you think?

@Michael-F-Bryan
Copy link
Contributor

Hey @azerupi and @steveklabnik I just noticed this PR.

I think it would be better to drop this idea and instead implement a lot of small tests checking for one particular property in the generated output

I've started something similar in #374. In particular the /tests/rendered_output.rs test file seems to do exactly what you are talking about. If I can abstract the checking out into a nice macro, would it be worth merging that and then supplementing it with a "fuzzier" version of this smoke test (perhaps something which compares simplified HTML ASTs)?

I'd also be happy to mentor a PR for asserting particular patterns appear in the output as expected.

@steveklabnik
Copy link
Contributor Author

Let's do it! 😄

@steveklabnik steveklabnik deleted the smoke-test branch July 31, 2017 15:03
@Michael-F-Bryan Michael-F-Bryan mentioned this pull request Sep 3, 2017
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.

5 participants